{"id":25164469,"url":"https://github.com/vizonex/ypyjson","last_synced_at":"2025-04-03T15:47:52.933Z","repository":{"id":158931812,"uuid":"626111608","full_name":"Vizonex/YpyJson","owner":"Vizonex","description":"Yet Another Python Json Library as a Cython wrapper for using yyjson ","archived":false,"fork":false,"pushed_at":"2023-05-14T21:53:06.000Z","size":229,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T04:41:05.110Z","etag":null,"topics":["cython","json","python","yapyjson","yyjson"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/ypyjson/0.0.1/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vizonex.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-10T20:26:45.000Z","updated_at":"2024-01-30T06:45:36.000Z","dependencies_parsed_at":"2023-05-31T21:31:05.692Z","dependency_job_id":null,"html_url":"https://github.com/Vizonex/YpyJson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizonex%2FYpyJson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizonex%2FYpyJson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizonex%2FYpyJson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vizonex%2FYpyJson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vizonex","download_url":"https://codeload.github.com/Vizonex/YpyJson/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247033132,"owners_count":20872521,"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":["cython","json","python","yapyjson","yyjson"],"created_at":"2025-02-09T04:32:15.765Z","updated_at":"2025-04-03T15:47:52.928Z","avatar_url":"https://github.com/Vizonex.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YpyJson\n\nYet Another Python Json Library \n\nA Fast Json Reader made in Cython for handling fast json parsing \nusing the yyjson library. \n\nSome of it's techniques are simillar to simdjson but with a few\nfast conversion methods to convert objects to python objects. \n\nYpyjson can trade safety for speed since yyjson is faster than simdjson\n\n```python \nfrom ypyjson import YpyObject\n\ny = YpyObject(b'{\"Eggs\":\"spam\",\"Foo\":[\"bar\",\"baz\"]}', 0)\nbar = y.get_pointer(\"/Foo/0\")\nprint(f\"result :{bar!r}\")\n# result: 'bar'\nprint(y[\"Eggs\"])\n# spam\n```\n\nYpy also has flags for reading json files as well\n\n```python\nfrom ypyjson import loads, YpyReadFlag\n\n\ny = loads(b'{\"ypy\":\"json\",\"data\":{\"text\":[1,2,3,4]}}', YpyReadFlag.ALLOW_COMMENTS | YpyReadFlag.READ_NUMBER_AS_RAW)\n\n\ntext = y.get_pointer(\"/data/text\")\n\nprint(text)\nfor t in text:\n    print(t)\n\n# \u003cypyjson.reader.YpyArray object at 0x00000256F6DD1D30\u003e\n# b'1'\n# b'2'\n# b'3'\n# b'4'\n\n```\n\nYpyjson has Cython compatability and is really made for Cython as well for expandable performance benefits elsewhere...\n\n```cython \nfrom ypyjson.reader cimport cloads, YpyObject , YpyArray \n#etc...\n```\nNote that for the read flags, you'll need to refer to the Variable Documentation linked below in yyjson's documentation \n\nhttps://ibireme.github.io/yyjson/doc/doxygen/html/yyjson_8h.html#aff1d62b68993630e74355e4611b77520\n\nLuckily , `ypyjson.reader.pxd` has them already inplace \nso you'll just have to do the following\nto access those variables...\n\n```cython \n#cython: langauge_level = 3\nfrom ypyjson.reader cimport (\n    cloads, \n    YpyObject , \n    YpyArray , \n    YYJSON_READ_ALLOW_COMMENTS,\n    YYJSON_READ_ALLOW_INF_AND_NAN,\n    YYJSON_READ_ALLOW_INVALID_UNICODE\n    #etc...\n)\n\n```\n## Installation\n- Requires Cython and Setuptools \nthen do the following...\n```\npip install ypyjson \n```\nAs of currently, Cython compatability under pip install is still being proto-typed but the python library works just fine for right now...\n\n## TODOs\n- [x] Implement a reader and extract all variables directly to python...\n\n- [] Create Benchmarks with SimdJson's python library to figure what could be needed to improve this library's performance...\n\n- [] Make sure that after launching to pypi\nlibrary for this code that YpyJson can work directly with Cython via cimport , Might have to look into numpy for ideas on it's implementation...\n\n- [] Maybe look into Adding YpyJson as a Header File for CPython Usage....\n\n- [] Make a YpyVariable cdef class Object in Cython (Cython only...) to improve upon speed until the Object needs or is ready to be identified in either C or Python...\n\n- [] In a future update, implement a mutable writer (The Current one made is broken and is having issues...)\n\n- [] When yyjson comes out with a Streaming API , add streaming API Under a DynamicLoader class varaible\n\n- [] Once Beta Version of this python library is avalibe and inplace via pypi Make sure that yyjson.c as well as yyjson.h is included for compiling to Cython.\n \n- [x] including/bundling cython package with pypi when I've figure it out...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvizonex%2Fypyjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvizonex%2Fypyjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvizonex%2Fypyjson/lists"}