Skip to main content

PyPI version Supported Python versions Build status

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)

Metadata

Release files for jsonschema-lexer 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jsonschema-lexer 0.3.0
File Size Uploaded
jsonschema_lexer-0.3.0.tar.gz 12.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jsonschema-lexer 0.3.0
File Interpreter ABI Platform
jsonschema_lexer-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / jsonschema_lexer-0.3.0.tar.gz

Download URL jsonschema_lexer-0.3.0.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cd0e63bcee6d9b6470d4e4963bf6bd24a208d619c895071708dbbbee6afb5f6d
BLAKE2b-256 checksum
How to use checksums
31da0fb7df72257986fc706a324d6eb05790b60492111c98a756e046b018c7de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 16, 2025.

Transparency log

Release files / jsonschema_lexer-0.3.0-py3-none-any.whl

Download URL jsonschema_lexer-0.3.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fda8187aa7348656df77decaf8f3931492818c082714cc7e3a26376d9587f67
BLAKE2b-256 checksum
How to use checksums
077f2e04eebdc90eea0eebf10d697fcd599eadf921e436caa2a43f46df747358
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 16, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page