{"id":19070157,"url":"https://github.com/iotic-labs/py-ubjson","last_synced_at":"2025-04-07T07:09:13.301Z","repository":{"id":36593985,"uuid":"40899998","full_name":"Iotic-Labs/py-ubjson","owner":"Iotic-Labs","description":"Universal Binary JSON draft-12 serializer for Python","archived":false,"fork":false,"pushed_at":"2024-07-18T14:40:21.000Z","size":1651,"stargazers_count":43,"open_issues_count":4,"forks_count":14,"subscribers_count":13,"default_branch":"dev-contrib","last_synced_at":"2025-03-31T05:06:04.928Z","etag":null,"topics":["c-extension","decoder","encoder","pure-python","python","ubjson"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Iotic-Labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","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":"2015-08-17T14:09:33.000Z","updated_at":"2025-03-22T17:19:53.000Z","dependencies_parsed_at":"2024-04-22T21:56:53.704Z","dependency_job_id":"0e4ab6bf-5f52-4446-bf6e-179abc24a4fc","html_url":"https://github.com/Iotic-Labs/py-ubjson","commit_stats":{"total_commits":83,"total_committers":5,"mean_commits":16.6,"dds":0.06024096385542166,"last_synced_commit":"3d8e8a24d5cd4c3c09da76aea580a0032e120a36"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iotic-Labs%2Fpy-ubjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iotic-Labs%2Fpy-ubjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iotic-Labs%2Fpy-ubjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iotic-Labs%2Fpy-ubjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Iotic-Labs","download_url":"https://codeload.github.com/Iotic-Labs/py-ubjson/tar.gz/refs/heads/dev-contrib","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608151,"owners_count":20965952,"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":["c-extension","decoder","encoder","pure-python","python","ubjson"],"created_at":"2024-11-09T01:17:19.804Z","updated_at":"2025-04-07T07:09:13.276Z","avatar_url":"https://github.com/Iotic-Labs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n\nThis is a Python v3.2+ (and 2.7+) [Universal Binary JSON](http://ubjson.org) encoder/decoder based on the [draft-12](UBJSON-Specification.md) specification.\n\n\n# Installing / packaging\n```shell\n# To get from PyPI\npip3 install py-ubjson\n\n# To only build extension modules inline (e.g. in repository)\npython3 setup.py build_ext -i\n\n# To build \u0026 install globally\npython3 setup.py install\n\n# To skip building of extensions when installing (or building)\nPYUBJSON_NO_EXTENSION=1 python3 setup.py install\n```\n**Notes**\n\n- The extension module is not required but provide a significant speed boost.\n- The above can also be run with v2.7+\n- This module is also available via [Anaconda (conda-forge)](https://anaconda.org/conda-forge/py-ubjson)\n- PyPI releases are signed with the [Iotic Labs Software release signing key](https://developer.iotic-labs.com/iotic-labs.com.asc)\n- At run time, one can check whether compiled version is in use via the _ubjson.EXTENSION_ENABLED_ boolean\n\n\n# Usage\nIt's meant to behave very much like Python's built-in [JSON module](https://docs.python.org/3/library/json.html), e.g.:\n```python\nimport ubjson\n\nencoded = ubjson.dumpb({u'a': 1})\n\ndecoded = ubjson.loadb(encoded)\n```\n**Note**: Only unicode strings in Python 2 will be encoded as strings, plain *str* will be encoded as a byte array.\n\n\n# Documentation\n```python\nimport ubjson\nhelp(ubjson.dump)\nhelp(ubjson.load)\n```\n\n# Command-line utility\nThis converts between JSON and UBJSON formats:\n```shell\npython3 -mubjson\nUSAGE: ubjson (fromjson|tojson) (INFILE|-) [OUTFILE]\n```\n\n\n# Tests\n\n## Static\nThis library has been checked using [flake8](https://pypi.python.org/pypi/flake8) and [pylint](http://www.pylint.org), using a modified configuration - see _pylint.rc_ and _flake8.cfg_.\n\n## Unit\n```shell\npython3 -mvenv py\n. py/bin/activate\npip install -U pip setuptools\npip install -e .[dev]\n\n./coverage_test.sh\n```\n**Note**: See `coverage_test.sh` for additional requirements.\n\n\n# Limitations\n- The **No-Op** type is only supported by the decoder. (This should arguably be a protocol-level rather than serialisation-level option.) Specifically, it is **only** allowed to occur at the start or between elements of a container and **only** inside un-typed containers. (In a typed container it is impossible to tell the difference between an encoded element and a No-Op.)\n- Strongly-typed containers are only supported by the decoder (apart from for **bytes**/**bytearray**) and not for No-Op.\n- Encoder/decoder extensions are not supported at this time.\n\n\n# Why?\nThe only existing implementation I was aware of at the time of writing ([simpleubjson](https://github.com/brainwater/simpleubjson)) had the following limitations:\n\n- Does not support efficient binary encoding\n- Only supports draft-9\n- Only supports individual Python types rather than anything implementing an interface (e.g. _Mapping_)\n- Does not decode nested arrays or objects in expected form\n- Lacks C extension speed-up\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotic-labs%2Fpy-ubjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiotic-labs%2Fpy-ubjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotic-labs%2Fpy-ubjson/lists"}