{"id":15547798,"url":"https://github.com/jacksmith15/statham-schema","last_synced_at":"2025-04-13T12:24:42.740Z","repository":{"id":41579860,"uuid":"219737673","full_name":"jacksmith15/statham-schema","owner":"jacksmith15","description":"Statham is a Python Model Parsing Library for JSON Schema.","archived":false,"fork":false,"pushed_at":"2023-08-06T10:19:22.000Z","size":436,"stargazers_count":38,"open_issues_count":10,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T07:18:00.672Z","etag":null,"topics":["json-schema","model","parsing","python","serialization"],"latest_commit_sha":null,"homepage":"https://statham-schema.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacksmith15.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-05T12:17:15.000Z","updated_at":"2025-02-06T18:08:37.000Z","dependencies_parsed_at":"2024-06-19T09:46:10.646Z","dependency_job_id":null,"html_url":"https://github.com/jacksmith15/statham-schema","commit_stats":{"total_commits":181,"total_committers":7,"mean_commits":"25.857142857142858","dds":"0.18784530386740328","last_synced_commit":"d283dccf26180f910efe2fe89c929852d24b07a5"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksmith15%2Fstatham-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksmith15%2Fstatham-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksmith15%2Fstatham-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksmith15%2Fstatham-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacksmith15","download_url":"https://codeload.github.com/jacksmith15/statham-schema/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245773380,"owners_count":20669765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json-schema","model","parsing","python","serialization"],"created_at":"2024-10-02T13:10:24.610Z","updated_at":"2025-03-29T08:31:36.635Z","avatar_url":"https://github.com/jacksmith15.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/jacksmith15/statham-schema.svg?token=JrMQr8Ynsmu5tphpTQ2p\u0026branch=master)](https://travis-ci.com/jacksmith15/statham-schema)  [![Documentation Status](https://readthedocs.org/projects/statham-schema/badge/?version=latest)](https://statham-schema.readthedocs.io/en/latest/?badge=latest)\n\n# Statham\n\n`statham` is a Python Model Parsing Library for [JSON Schema]. Read the [documentation](https://statham-schema.readthedocs.io/en/latest/).\n\nThis project includes tools for writing and generating extensible Python classes based on [JSON Schema] documents.\n\n## Example Model Definition\n\n`statham` can be used to write JSON Schema documents and their corresponding application-level models in one go:\n\n```python\nfrom typing import List\n\nfrom statham.schema.elements import Array, Integer, Object, String\nfrom statham.schema.property import Property\n\n\nclass Choice(Object):\n    choice_text: str = Property(String(maxLength=200), required=True)\n    votes: int = Property(Integer(default=0))\n\n\nclass Poll(Object):\n    question: str = Property(String(), required=True)\n    choices: List[Choice] = Property(Array(Choice), required=True)\n```\n\n# Generating python classes\nAlternatively, Python models may be generated automatically from an existing schema:\n```\nstatham --input http://example.com/schema.json\n```\n\n\n## Command-line arguments\n```\nRequired arguments:\n  --input INPUT    Specify the path to the JSON Schema to be generated.\n\n                   If the target schema is not at the root of a document, specify the\n                   JSON Pointer in the same format as a JSON Schema `$ref`, e.g.\n                   `--input path/to/document.json#/definitions/schema`\n\n\nOptional arguments:\n  --output OUTPUT  Output directory or file in which to write the output.\n\n                   If the provided path is a directory, the command will derive the name\n                   from the input argument. If not passed, the command will write to\n                   stdout.\n\n  -h, --help       Display this help message and exit.\n```\n\n\n# Installation\nThis project requires Python 3.6+ and may be installed using [pip]:\n```\npip install statham-schema\n```\n\n# Compatibility\nSee [Compatibility](https://statham-schema.readthedocs.io/en/latest/compatibility.html) for information regarding the currently supported JSON Schema draft and exceptions.\n\n# Development\n1. Clone the repository: `git clone git@github.com:jacksmith15/statham-schema.git \u0026\u0026 cd statham-schema`\n2. Initialise git submodules: `git submodule update --init --recursive`\n3. Install the requirements: `pip install -r requirements.txt -r requirements-test.txt`\n4. Run `pre-commit install`\n5. Run the tests: `bash run_test.sh -c -a`\n\nThis project uses the following QA tools:\n- [PyTest](https://docs.pytest.org/en/latest/) - for running unit tests.\n- [PyLint](https://www.pylint.org/) - for enforcing code style.\n- [MyPy](http://mypy-lang.org/) - for static type checking.\n- [Travis CI](https://travis-ci.org/) - for continuous integration.\n- [Black](https://black.readthedocs.io/en/stable/) - for uniform code formatting.\n\nDocumentation is written using [Sphinx](https://www.sphinx-doc.org/en/master/).\n\n# License\nThis project is distributed under the MIT license.\n\n![statham](https://giant.gfycat.com/GrotesqueNauticalCaracal.gif)\n\n[pip]: https://pip.pypa.io/en/stable/\n[JSON Schema]: https://json-schema.org/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacksmith15%2Fstatham-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacksmith15%2Fstatham-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacksmith15%2Fstatham-schema/lists"}