{"id":15677675,"url":"https://github.com/avanov/typeit","last_synced_at":"2025-08-29T09:24:19.133Z","repository":{"id":32626972,"uuid":"137624501","full_name":"avanov/typeit","owner":"avanov","description":"Infer Python types from JSON data, use them for auto serialisation and parsing","archived":false,"fork":false,"pushed_at":"2023-10-27T19:35:52.000Z","size":279,"stargazers_count":13,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-05-06T22:08:35.434Z","etag":null,"topics":["colander","deserialization","json","mypy","parser","parsing","pyrsistent","python","python3","serialization","structured-data","typechecking","typing"],"latest_commit_sha":null,"homepage":"https://typeit.readthedocs.io/en/develop/","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/avanov.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["avanov"]}},"created_at":"2018-06-17T02:51:03.000Z","updated_at":"2024-05-31T16:23:21.000Z","dependencies_parsed_at":"2022-08-24T03:10:38.156Z","dependency_job_id":"a94355b0-3171-4216-a6f2-625cf4059f1d","html_url":"https://github.com/avanov/typeit","commit_stats":{"total_commits":67,"total_committers":2,"mean_commits":33.5,"dds":0.4925373134328358,"last_synced_commit":"21b5ae81cab293fc3d004ee55e85c2e3eb6f8a21"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanov%2Ftypeit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanov%2Ftypeit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanov%2Ftypeit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanov%2Ftypeit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avanov","download_url":"https://codeload.github.com/avanov/typeit/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252776581,"owners_count":21802468,"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":["colander","deserialization","json","mypy","parser","parsing","pyrsistent","python","python3","serialization","structured-data","typechecking","typing"],"created_at":"2024-10-03T16:10:14.516Z","updated_at":"2025-05-06T22:08:37.313Z","avatar_url":"https://github.com/avanov.png","language":"Python","funding_links":["https://github.com/sponsors/avanov"],"categories":[],"sub_categories":[],"readme":".. _badges:\n\n.. image:: https://github.com/avanov/typeit/workflows/CI/badge.svg?branch=develop\n    :target: https://github.com/avanov/typeit/actions?query=branch%3Adevelop\n\n.. image:: https://coveralls.io/repos/github/avanov/typeit/badge.svg?branch=develop\n    :target: https://coveralls.io/github/avanov/typeit?branch=develop\n\n.. image:: https://requires.io/github/avanov/typeit/requirements.svg?branch=master\n    :target: https://requires.io/github/avanov/typeit/requirements/?branch=master\n    :alt: Requirements Status\n\n.. image:: https://readthedocs.org/projects/typeit/badge/?version=latest\n    :target: http://typeit.readthedocs.org/en/latest/\n    :alt: Documentation Status\n\n.. image:: http://img.shields.io/pypi/v/typeit.svg\n    :target: https://pypi.python.org/pypi/typeit\n    :alt: Latest PyPI Release\n\n\nTypeit\n------\n\n**typeit** infers Python types from a sample JSON/YAML data, and provides you with the tools\nfor serialising and parsing it. It also provides you with smart constructors for arbitrarily nested data structures.\nThe library works superb on Python 3.7 and above.\n\nStart using it by generating types for your JSON payloads:\n\n.. code-block:: bash\n\n    $ echo '{\"first-name\": \"Hello\", \"initial\": null, \"last_name\": \"World\"}' | typeit gen\n\n\nThe snipped above produces output similar to this:\n\n.. code-block:: python\n\n    from typing import Any, NamedTuple, Optional, Sequence\n    from typeit import TypeConstructor\n\n\n    class Main(NamedTuple):\n        first_name: str\n        initial: Optional[Any]\n        last_name: str\n\n\n    overrides = {\n        Main.first_name: 'first-name',\n    }\n\n\n    mk_main, serialize_main = TypeConstructor \u0026 overrides ^ Main\n\nUse these functions to construct and serialize your payloads:\n\n.. code-block:: python\n\n    payload = {\"first-name\": \"Hello\", \"initial\": None, \"last_name\": \"World\"}\n\n    data = mk_main(payload)\n    assert isinstance(data, Main)\n    assert serialize_main(data) == payload\n\n\nDocumentation\n-------------\n\nDocumentation is hosted on ReadTheDocs: https://typeit.readthedocs.io/en/develop/\n\n\nTest framework\n--------------\n\nRun existing test suite with\n\n.. code::\n\n   $ make test\n\n\nChangelog\n---------\n\nSee `CHANGELOG \u003chttps://github.com/avanov/typeit/blob/master/CHANGELOG.rst\u003e`_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favanov%2Ftypeit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favanov%2Ftypeit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favanov%2Ftypeit/lists"}