Registry / serialization / spotlight

spotlight

JSON →
library3.4.0pypypi✓ verified 89d ago

Data validation library for Python, inspired by Laravel's validation system. Current version 3.4.0, supports Python >=3.6. Active development with frequent releases.

pip install spotlight
INSTALL
IMPORT
SIG · SPOTLIGHT
S
spotlight
serializationpythonv3.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Validator
✓ from spotlight import Validator
Correct import for the main Validator class.
ValidationError
✓ from spotlight import ValidationError
Correct import for the validation error exception.
validate
✓ from spotlight import validate
✗ from spotlight.helpers import validate
The `validate` helper function is directly in the spotlight package, not in a submodule.

Minimal example of creating a Validator instance, checking passes, and retrieving errors.

from spotlight import Validator v = Validator({'email': 'user@example.com'}, {'email': 'required|email'}) if v.passes(): print('Validation passed') else: print(v.errors())
Debug
Known issues
gotchaThe import path `from spotlight import Validator` is correct, but many online snippets incorrectly use `from spotlight.validator import Validator` which does not exist.
fix
Use `from spotlight import Validator`.
affects: all
gotchaRule strings are space-separated (e.g., 'required|email'), not comma-separated. Using commas will silently fail.
fix
Use pipe-separated rules: `'required|email|min:5'`.
affects: all
deprecatedThe `validate()` function (direct call) is deprecated in favor of the `Validator` class for complex rules. It may be removed in future versions.
fix
Use `Validator` class with `passes()` or `fails()` methods instead of `validate()`.
affects: >=3.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'spotlight.validator'
Incorrect import path; many tutorials mistakenly use `from spotlight.validator import Validator` instead of `from spotlight import Validator`.
fix
Use `from spotlight import Validator`.
KeyError: 'email' when accessing errors
Calling `v.errors()` before checking validation; errors are only populated after `passes()` or `fails()` is called.
fix
First call `v.passes()` or `v.fails()`, then access `v.errors()`.
Upgrade
Version history
3.4.0latest on PyPI · released May 4, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
spotlight — pip install spotlight · libregistry