{"id":21831583,"url":"https://github.com/devkral/generic-json-encoders","last_synced_at":"2026-03-12T07:02:19.674Z","repository":{"id":263660875,"uuid":"890926875","full_name":"devkral/generic-json-encoders","owner":"devkral","description":"More speedier and correct lilya like encoders","archived":false,"fork":false,"pushed_at":"2025-06-14T15:37:41.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-03T08:54:25.072Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devkral.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"zenodo":null}},"created_at":"2024-11-19T12:30:38.000Z","updated_at":"2025-06-14T15:37:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f8a09b6-ba5c-4b2e-9dc3-34ea2d066715","html_url":"https://github.com/devkral/generic-json-encoders","commit_stats":null,"previous_names":["devkral/generic-json-encoders"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/devkral/generic-json-encoders","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkral%2Fgeneric-json-encoders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkral%2Fgeneric-json-encoders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkral%2Fgeneric-json-encoders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkral%2Fgeneric-json-encoders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devkral","download_url":"https://codeload.github.com/devkral/generic-json-encoders/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkral%2Fgeneric-json-encoders/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30417685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T06:40:58.731Z","status":"ssl_error","status_checked_at":"2026-03-12T06:40:40.296Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-27T19:11:57.247Z","updated_at":"2026-03-12T07:02:19.669Z","avatar_url":"https://github.com/devkral.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generic-json-encoders\n\n**THIS PROJECT IS DEPRECATED!!!!!!**\n\nI got the changes implemented in lilya.\n\n\nA speedier version of the lilya encoders with more correct results and support for pydantic and msgspec.\nIt uses under the hood orjson.\n\n[![PyPI - Version](https://img.shields.io/pypi/v/generic-json-encoders.svg)](https://pypi.org/project/generic-json-encoders)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/generic-json-encoders.svg)](https://pypi.org/project/generic-json-encoders)\n\n-----\n\n## Table of Contents\n\n- [Installation](#installation)\n- [License](#license)\n\n## Installation\n\n```console\npip install generic-json-encoders\n```\n\n## Usage\n\n**Basic**\n\n\n``` python\nimport datetime\nfrom decimal import Decimal\nfrom generic_json_encoders import json_encode, simplify\n\ntest_obj = {\n    \"datetime\": datetime.datetime.now(),\n    \"date\": datetime.date.today(),\n    \"decimal\": Decimal(\"0.3\").\n}\n\n# get json byte string\nprint(json_encode(test_obj))\n# get simplified json serializable object\nprint(json_encode(test_obj))\n```\n\n**Advanced**\n\n`generic_json_encoders` can also apply annotations in esmerald style. However the annotations must be evaluated.\n\n\n``` python\nimport datetime\nfrom functools import partial\nfrom decimal import Decimal\nfrom generic_json_encoders import apply_annotation\n\napply_annotation(\"2.333\", Decimal)\napply_annotation(\"2.333\", Decimal, partial(transform_fn=simplify))\n```\n\n\n### Integrating in lilya\n\nPut somewhere in the init code of your application\n\n``` python\nfrom importlib import import_module\nfrom contextlib import suppress\n\n...\nwith suppress(ImportError):\n    import_module(\"generic_json_encoders.lilya_monkey_patcher\")\n...\n\n```\n\n### Integrating in esmerald\n\n``` python\nimport esmerald\n\nfrom generic_json_encoders.lilya_monkey_patcher import GenericJsonEncoder\n\n# you need it here too, for registering at the first place\napp = esmerald.Esmerald(encoders=[GenericJsonEncoder()])\n\n```\n\n\n## License\n\n`generic-json-encoders` is distributed under the terms of the [BSD](https://spdx.org/licenses/BSD-3-Clause.html) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevkral%2Fgeneric-json-encoders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevkral%2Fgeneric-json-encoders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevkral%2Fgeneric-json-encoders/lists"}