A Pygments lexer for JSON Schema
Project description
Introduction
jsonschema-lexer provides a lexer for syntax highlighting JSON Schema documents via Pygments.
Usage
Once installed, you can use it in your Python code to highlight JSON Schema documents.
Here’s a simple example:
from jsonschema_lexer import JSONSchemaLexer
from rich.console import Console
from rich.syntax import Syntax
console = Console()
code = """
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/product.schema.json",
"title": "Product",
"description": "A product from Acme's catalog",
"type": "object",
"properties": {
"productId": {
"description": "The unique identifier for a product",
"type": "integer"
},
"productName": {
"description": "Name of the product",
"type": "string"
}
}
}
"""
syntax = Syntax(code, lexer=JSONSchemaLexer(), background_color="default", word_wrap=True)
console.print(syntax)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jsonschema_lexer-0.3.0.tar.gz.
File metadata
- Download URL: jsonschema_lexer-0.3.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd0e63bcee6d9b6470d4e4963bf6bd24a208d619c895071708dbbbee6afb5f6d
|
|
| MD5 |
dbd2514c01ec5a20fa033a5c87d9299d
|
|
| BLAKE2b-256 |
31da0fb7df72257986fc706a324d6eb05790b60492111c98a756e046b018c7de
|
Provenance
The following attestation bundles were made for jsonschema_lexer-0.3.0.tar.gz:
Publisher:
ci.yml on python-jsonschema/jsonschema-lexer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jsonschema_lexer-0.3.0.tar.gz -
Subject digest:
cd0e63bcee6d9b6470d4e4963bf6bd24a208d619c895071708dbbbee6afb5f6d - Sigstore transparency entry: 163016181
- Sigstore integration time:
-
Permalink:
python-jsonschema/jsonschema-lexer@b28b61cc01d38322a164ab9ccbd347ef51a7268b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/python-jsonschema
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@b28b61cc01d38322a164ab9ccbd347ef51a7268b -
Trigger Event:
push
-
Statement type:
File details
Details for the file jsonschema_lexer-0.3.0-py3-none-any.whl.
File metadata
- Download URL: jsonschema_lexer-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fda8187aa7348656df77decaf8f3931492818c082714cc7e3a26376d9587f67
|
|
| MD5 |
91b6026c05afd042441acbe52029f98a
|
|
| BLAKE2b-256 |
077f2e04eebdc90eea0eebf10d697fcd599eadf921e436caa2a43f46df747358
|
Provenance
The following attestation bundles were made for jsonschema_lexer-0.3.0-py3-none-any.whl:
Publisher:
ci.yml on python-jsonschema/jsonschema-lexer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jsonschema_lexer-0.3.0-py3-none-any.whl -
Subject digest:
2fda8187aa7348656df77decaf8f3931492818c082714cc7e3a26376d9587f67 - Sigstore transparency entry: 163016182
- Sigstore integration time:
-
Permalink:
python-jsonschema/jsonschema-lexer@b28b61cc01d38322a164ab9ccbd347ef51a7268b -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/python-jsonschema
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@b28b61cc01d38322a164ab9ccbd347ef51a7268b -
Trigger Event:
push
-
Statement type: