PyJSG
Python JSON Schema Grammar interpreter
Decision gist · record as of 2026-08-14
Yes, if you work with JSON Schema Grammar and need type-safe Python bindings. The package is actively maintained, has no known vulnerabilities, installs cleanly, and is permissively licensed. The main consideration is whether your project already uses JSG; if you're starting fresh, evaluate whether JSG's grammar syntax fits your schema needs better than alternatives.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; the package depends on internal features of the typing library which may require testing when upgrading Python versions.
- Low install friction with a pure Python wheel distribution.
- Maintenance status is active with a recent release.
License · maintenance · safety
CC0 1.0 Universal (permissive) — Licensed under CC0 1.0 Universal (public domain dedication), which is permissive and places no restrictions on use, modification, or distribution.
last release 2026-05-01 (105 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 292,377 downloads/mo, #7,965 on PyPI
Alternatives
Verify before relying
pip install pyjsg
generate_parser input.jsg
from pyjsg.jsglib.jsg import loads
schema_json = '{"type": "Schema"}'
s = loads(schema_json)
print(s._as_json_dumps())- Current compatibility with Python 3.13 and 3.14 (listed as supported but package last released 2026-05-01)
- Whether antlr4-python3-runtime introduces any platform-specific compilation requirements
- Real-world validation performance and error message clarity for complex schemas
What it is and what it does
PyJSG is a code generator that reads JSON Schema Grammar (JSG) specifications and produces Python 3 classes representing the schema's structure. It bridges the gap between declarative schema definitions and typed Python objects, using the typing library to provide IDE support and type hints.
The generated classes inherit from JSG base types and include built-in validation, serialization to JSON, and attribute access control. You define a schema in JSG syntax, run the generate_parser command-line tool, and get back a Python module with classes ready to instantiate, populate, validate, and serialize. The package includes a validation library that checks whether Python objects conform to their schema definitions.
Use it for
- Generate strongly-typed Python models from existing JSON Schema Grammar definitions for data interchange formats.
- Build configuration file parsers that validate structure and types at runtime using generated schema classes.
- Create domain-specific language interpreters where the grammar defines both syntax and Python object structure.
- Validate JSON data against a schema before processing, catching structural errors early in a pipeline.
- Serialize Python objects back to JSON while enforcing schema constraints and type safety.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with JSON Schema Grammar and need type-safe Python bindings.
The package is actively maintained, has no known vulnerabilities, installs cleanly, and is permissively licensed. The main consideration is whether your project already uses JSG; if you're starting fresh, evaluate whether JSG's grammar syntax fits your schema needs better than alternatives.
Install
pyjsg on PyPI
Before you install
Low install friction with a pure Python wheel distribution. Maintenance status is active with a recent release. Three runtime dependencies (antlr4-python3-runtime, jsonasobj, requests) are standard libraries in the Python ecosystem.
Requires Python 3.10 or later; the package depends on internal features of the typing library which may require testing when upgrading Python versions.
License in practice
Licensed under CC0 1.0 Universal (public domain dedication), which is permissive and places no restrictions on use, modification, or distribution.
Quickstart
pip install pyjsg
generate_parser input.jsg
from pyjsg.jsglib.jsg import loads
schema_json = '{"type": "Schema"}'
s = loads(schema_json)
print(s._as_json_dumps())
Verify before relying
- Current compatibility with Python 3.13 and 3.14 (listed as supported but package last released 2026-05-01)
- Whether antlr4-python3-runtime introduces any platform-specific compilation requirements
- Real-world validation performance and error message clarity for complex schemas
Package facts
| License | CC0 1.0 Universal permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesantlr4-python3-runtimejsonasobjrequests |
| Maintenance | Actively maintained 105 days since the last release |
| First released | |
| Downloads | 292,377 / month, #7,965 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: CC0 1.0 Universal (CC0 1.0) Public Domain DedicationProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software DevelopmentTopic :: Software Development :: Code Generators |
Evidence: pyjsg-0.12.4-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “json schema grammar python”
- PyJSGGenerates Python 3 classes from JSON Schema Grammar (JSG)…
- llguidanceEnforces structured output from large language models by computing…
- tree-sitter-jsonProvides a JSON grammar parser for tree-sitter, enabling incremental…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also ShExJSG · PyShexC · jsonasobj · dataclasses-jsonschema · pyPEG2 · jsonasobj2 · marshmallow-jsonschema · PyShEx · tree-sitter-html · types-orjson