{"id":21102879,"url":"https://github.com/planetarium/bencodex-python","last_synced_at":"2025-09-16T12:55:03.136Z","repository":{"id":57414627,"uuid":"155277013","full_name":"planetarium/bencodex-python","owner":"planetarium","description":"Bencodex reader/writer for Python","archived":false,"fork":false,"pushed_at":"2022-11-10T03:05:17.000Z","size":39,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-10-11T12:37:26.205Z","etag":null,"topics":["bencode","bencodex","python","python3"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/bencodex/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/planetarium.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","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":"2018-10-29T20:29:58.000Z","updated_at":"2022-11-10T03:00:21.000Z","dependencies_parsed_at":"2023-01-21T20:35:12.456Z","dependency_job_id":null,"html_url":"https://github.com/planetarium/bencodex-python","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetarium%2Fbencodex-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetarium%2Fbencodex-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetarium%2Fbencodex-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetarium%2Fbencodex-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/planetarium","download_url":"https://codeload.github.com/planetarium/bencodex-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225444611,"owners_count":17475354,"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":["bencode","bencodex","python","python3"],"created_at":"2024-11-19T23:56:52.010Z","updated_at":"2025-09-16T12:54:58.110Z","avatar_url":"https://github.com/planetarium.png","language":"Python","readme":"Bencodex reader/writer for Python\n=================================\n\n.. image:: https://img.shields.io/pypi/v/bencodex\n   :alt: PyPI\n   :target: https://pypi.org/project/bencodex/\n\n.. image:: https://github.com/planetarium/bencodex-python/actions/workflows/build.yaml/badge.svg\n   :alt: Build Status\n   :target: https://github.com/planetarium/bencodex-python/actions/workflows/build.yaml\n\nThis package implements Bencodex_ serialization format which extends Bencoding_.\n\n.. _Bencodex: https://github.com/planetarium/bencodex\n.. _Bencoding: http://www.bittorrent.org/beps/bep_0003.html#bencoding\n\n\nUsage\n-----\n\nThis package's API follows the tradition of Python's ``pickle`` and ``json``\nmodules:\n\n- ``bencodex.dump(obj: bencodex.BValue, fileobj: typing.BinaryIO) -\u003e None``\n- ``bencodex.dumps(obj: bencodex.BValue) -\u003e bytes``\n- ``bencodex.load(fileobj: typing.BinaryIO) -\u003e bencodex.BValue``\n- ``bencodex.loads(encoded: bytes) -\u003e bencodex.BValue``\n\n\nExamples\n--------\n\n\u003e\u003e\u003e from bencodex import dumps, loads\n\u003e\u003e\u003e dumps({'name': 'Jane Doe', 'age': 30, 'nationality': ['BR', 'US']})\nb'du3:agei30eu4:nameu8:Jane Doeu11:nationalitylu2:BRu2:USee'\n\u003e\u003e\u003e loads(_)\n{'age': 30, 'name': 'Jane Doe', 'nationality': ['BR', 'US']}\n\n\nDebug-friendly formatter\n------------------------\n\nThe package also provides a CLI program named ``show-bencodex``, which shows\nthe given Bencodex data file (or data from the stdin) in the debug-friendly\nformat:\n\n.. code:: console\n\n   $ show-bencodex bencodex.dat\n   $ cat bencodex.dat | show-bencodex\n\n\nLicense\n-------\n\nDistributed under GPLv3_ or later.\n\n.. _GPLv3: https://www.gnu.org/licenses/gpl-3.0.html\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetarium%2Fbencodex-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplanetarium%2Fbencodex-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetarium%2Fbencodex-python/lists"}