{"id":16392508,"url":"https://github.com/adhaamehab/jsonabc","last_synced_at":"2025-07-25T04:02:19.851Z","repository":{"id":65148724,"uuid":"584105198","full_name":"adhaamehab/jsonabc","owner":"adhaamehab","description":"Minimal, pythonic JSON to class serializer with zero dependencies.","archived":false,"fork":false,"pushed_at":"2023-01-16T14:04:20.000Z","size":8,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T12:51:21.023Z","etag":null,"topics":["json","python"],"latest_commit_sha":null,"homepage":"","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/adhaamehab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-01T11:41:20.000Z","updated_at":"2024-11-25T01:27:28.000Z","dependencies_parsed_at":"2023-02-10T03:45:31.266Z","dependency_job_id":null,"html_url":"https://github.com/adhaamehab/jsonabc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adhaamehab/jsonabc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adhaamehab%2Fjsonabc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adhaamehab%2Fjsonabc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adhaamehab%2Fjsonabc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adhaamehab%2Fjsonabc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adhaamehab","download_url":"https://codeload.github.com/adhaamehab/jsonabc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adhaamehab%2Fjsonabc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260451027,"owners_count":23011187,"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","python"],"created_at":"2024-10-11T04:50:19.394Z","updated_at":"2025-06-17T22:34:46.111Z","avatar_url":"https://github.com/adhaamehab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONABC\n\n\u003e Json Abstract Base Class\n\nJSONABC is a minimal, pythonic JSON to class serializer. It has __zero__ dependencies which makes it very lightweight. It provide a very minimal API with few options and play nicely with python type checking.\n\n\n## Install\n```shell\npip install jsonabc\n```\n\n## Examples\n\n__example 1 (simple)__\n\n```python\nfrom jsonabc import JSONABC\n\n# All you need to do is define JSONABC as your metaclass\nclass Response(metaclass=JSONABC):\n    args: dict\n    headers: dict\n    origin: str\n    url: str\n\nresp = requests.get(\"https://httpbin.org/get\")\njson_data = resp.json()\n\n# Your class can now take a single dict and automatically validate and parse it.\nobj = Response(response)\n\n# obj attributes now have their correspondent values from our json data.\n# you can also convert your class back to its json form.\n# JSONABC will preserve the same names for the original json keys.\nprint(obj.json())\n\n```\n\n__example 2 (composite)__\n```python\nfrom jsonabc import JSONABC\n\n# You can also define composite values instead of using dicts\nclass Headers(metaclass=JSONABC):\n    accept: str\n    accept_encoding: str\n\nclass Response(metaclass=JSONABC):\n    args: dict\n    headers: Headers\n    origin: str\n    url: str\n\nresp = requests.get(\"https://httpbin.org/get\")\njson_data = resp.json()\n\nobj = Response(response)\n\n# headers attr is now an instance of Headers with the same behavior as Response\nobj.headers \n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadhaamehab%2Fjsonabc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadhaamehab%2Fjsonabc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadhaamehab%2Fjsonabc/lists"}