JSL
Documentation | GitHub | PyPI
JSL is a Python DSL for defining JSON Schemas.
Example
import jsl
class Entry(jsl.Document):
name = jsl.StringField(required=True)
class File(Entry):
content = jsl.StringField(required=True)
class Directory(Entry):
content = jsl.ArrayField(jsl.OneOfField([
jsl.DocumentField(File, as_ref=True),
jsl.DocumentField(jsl.RECURSIVE_REFERENCE_CONSTANT)
]), required=True)
Directory.get_schema(ordered=True) will return the following JSON schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"directory": {
"type": "object",
"properties": {
"name": {"type": "string"},
"content": {
"type": "array",
"items": {
"oneOf": [
{"$ref": "#/definitions/file"},
{"$ref": "#/definitions/directory"}
]
}
}
},
"required": ["name", "content"],
"additionalProperties": false
},
"file": {
"type": "object",
"properties": {
"name": {"type": "string"},
"content": {"type": "string"}
},
"required": ["name", "content"],
"additionalProperties": false
}
},
"$ref": "#/definitions/directory"
}
Installing
pip install jsl
License
Metadata
Release files for jsl 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jsl-0.2.4.tar.gz | 21.0 kB | Without provenance | Details for jsl-0.2.4.tar.gz |
Release files / jsl-0.2.4.tar.gz
| Download URL | jsl-0.2.4.tar.gz |
|---|---|
| Size | 21.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
222621116b6ff508f12b2d9e17a576d08d618b06c0845b1867b000a90424c19d
|
|
BLAKE2b-256 checksum How to use checksums |
c16347d4bc4e4bfae29e00ff9256b52dfbf945b409804cfadf95714c113b8efb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for jsl 0.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.