{"id":16217270,"url":"https://github.com/synodriver/fast-bencode","last_synced_at":"2025-03-19T10:30:43.991Z","repository":{"id":50656822,"uuid":"371790352","full_name":"synodriver/fast-bencode","owner":"synodriver","description":"fast bencode for python, based on cython","archived":false,"fork":false,"pushed_at":"2024-10-23T10:59:52.000Z","size":936,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"sds","last_synced_at":"2025-03-17T06:11:24.001Z","etag":null,"topics":["bencode","cython"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/synodriver.png","metadata":{"files":{"readme":"README.markdown","changelog":"changename.py","contributing":null,"funding":null,"license":null,"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":"2021-05-28T18:41:42.000Z","updated_at":"2024-10-23T10:59:56.000Z","dependencies_parsed_at":"2024-10-22T22:40:34.572Z","dependency_job_id":null,"html_url":"https://github.com/synodriver/fast-bencode","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"1d9139e82697eadf0b01cfa950dabfe376e385cb"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Ffast-bencode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Ffast-bencode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Ffast-bencode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Ffast-bencode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synodriver","download_url":"https://codeload.github.com/synodriver/fast-bencode/tar.gz/refs/heads/sds","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244407729,"owners_count":20447842,"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","cython"],"created_at":"2024-10-10T11:26:21.841Z","updated_at":"2025-03-19T10:30:43.712Z","avatar_url":"https://github.com/synodriver.png","language":"C","readme":"\u003ch1 align=\"center\"\u003e\u003ci\u003e✨ fast-bencode ✨ \u003c/i\u003e\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003eThe cython version of bencode\u003c/a\u003e \u003c/h3\u003e\n\n[![pypi](https://img.shields.io/pypi/v/fast-bencode.svg)](https://pypi.org/project/fast-bencode/)\n![python](https://img.shields.io/pypi/pyversions/fast-bencode)\n![implementation](https://img.shields.io/pypi/implementation/fast-bencode)\n![wheel](https://img.shields.io/pypi/wheel/fast-bencode)\n![license](https://img.shields.io/github/license/synodriver/fast-bencode.svg)\n![action](https://img.shields.io/github/workflow/status/synodriver/fast-bencode/run%20unitest)\n\n### forked from [bencode](https://github.com/bittorrent/bencode) to support latest version of python\n\n- extra cython extension to speedup\n- ```typing``` with mypy check\n\n### Usage\n\n```python\nfrom pprint import pprint\nfrom bencode import bdecode, bencode\n\nwith open(\"test.torrent\", \"rb\") as f:\n    data = f.read()\n\nraw = bdecode(data, decode=False) # do not decode bytes to str, use this to speedup. default is True\npprint(raw)\n\nassert bencode(raw, bufsize=1000000) == data # customize buffer size(in bytes) to speedup, this reduces call to realloc\n```\n- There are alias function ```loads``` for ```bdecode``` and ```dumps``` for ```bencode```\n- ```load``` and ```dump``` are useful for file-like object\n```python\nfrom pprint import pprint\nfrom bencode import load, dumps, loads, dumps\n\nwith open(\"test.torrent\", \"rb\") as f:\n    data = load(f, decode=False)\n\npprint(data)\n\nprint(dumps(data, bufsize=1000000))\n```\n\n### build\ngit clone https://github.com/synodriver/fast-bencode.git\ncd fast-bencode\npython setup.py build_ext -i\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynodriver%2Ffast-bencode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynodriver%2Ffast-bencode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynodriver%2Ffast-bencode/lists"}