# A bencode serialize/deserialize library written in Rust with pyo3
## install
```shell
pip install bencode-rs
```
## basic usage
```python
import bencode_rs
assert bencode_rs.bdecode(b"d4:spaml1:a1:bee") == {b"spam": [b"a", b"b"]}
assert bencode_rs.bencode({'hello': 'world'}) == b'd5:hello5:worlde'
```
## Notice
### decoding
there is no str/string in bencode, only bytes.
so we decode bencode bytes to python bytes, since it may not be a utf8 string.
### encoding
we encode python `True` as int `1` and `False` as int 0.
Raw data
{
"_id": null,
"home_page": null,
"name": "bencode-rs",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.10",
"maintainer_email": null,
"keywords": "bittorrent, bencode, p2p",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/db/f5/091727719e840af53ff2e30cad673ba1ccc3fef86dc5ea2390499d21c7bd/bencode_rs-0.0.7.tar.gz",
"platform": null,
"description": "# A bencode serialize/deserialize library written in Rust with pyo3\n\n## install\n\n```shell\npip install bencode-rs\n```\n\n## basic usage\n\n```python\nimport bencode_rs\n\nassert bencode_rs.bdecode(b\"d4:spaml1:a1:bee\") == {b\"spam\": [b\"a\", b\"b\"]}\n\nassert bencode_rs.bencode({'hello': 'world'}) == b'd5:hello5:worlde'\n```\n\n## Notice\n\n### decoding\nthere is no str/string in bencode, only bytes.\nso we decode bencode bytes to python bytes, since it may not be a utf8 string.\n\n### encoding\nwe encode python `True` as int `1` and `False` as int 0.\n\n",
"bugtrack_url": null,
"license": null,
"summary": "a bencode parser build with pyo3",
"version": "0.0.7",
"project_urls": {
"Homepage": "https://github.com/trim21/bencode-rs"
},
"split_keywords": [
"bittorrent",
" bencode",
" p2p"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0fb9776ea10006cd4442d68bfea4bdca981b3e72587316dfb80551ce48663889",
"md5": "4dd896247e497fe79be1812056221de1",
"sha256": "d446d7fce52e135c65b5e15cdaef5fc64c39aa4215bccb4b803676df05a3ab45"
},
"downloads": -1,
"filename": "bencode_rs-0.0.7-cp310-abi3-macosx_10_12_x86_64.whl",
"has_sig": false,
"md5_digest": "4dd896247e497fe79be1812056221de1",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "~=3.10",
"size": 237428,
"upload_time": "2024-12-23T23:32:53",
"upload_time_iso_8601": "2024-12-23T23:32:53.775534Z",
"url": "https://files.pythonhosted.org/packages/0f/b9/776ea10006cd4442d68bfea4bdca981b3e72587316dfb80551ce48663889/bencode_rs-0.0.7-cp310-abi3-macosx_10_12_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b5daeb12d4ff850032b24a913d704116bc318c5a974ccaa5f15269e3337a6bfa",
"md5": "73985e61d815423c7a69b31baefb8357",
"sha256": "89de74e7b34eabe20c5a8ba58cabc75764ec881a0b1dae02b1d7bcb6b2a5ce6c"
},
"downloads": -1,
"filename": "bencode_rs-0.0.7-cp310-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "73985e61d815423c7a69b31baefb8357",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "~=3.10",
"size": 234279,
"upload_time": "2024-12-23T23:32:56",
"upload_time_iso_8601": "2024-12-23T23:32:56.415310Z",
"url": "https://files.pythonhosted.org/packages/b5/da/eb12d4ff850032b24a913d704116bc318c5a974ccaa5f15269e3337a6bfa/bencode_rs-0.0.7-cp310-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3541360fb61a132436f64c26f8b2ab379980439d569eceba4e48ff3499de2b1f",
"md5": "fac1f94728a38a185b25b91eb6fff3a1",
"sha256": "354a30aa7c840684f7e48ea8b3f598f0e4c8dcbe77297ce040f92081396107fd"
},
"downloads": -1,
"filename": "bencode_rs-0.0.7-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "fac1f94728a38a185b25b91eb6fff3a1",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "~=3.10",
"size": 266038,
"upload_time": "2024-12-23T23:32:58",
"upload_time_iso_8601": "2024-12-23T23:32:58.847452Z",
"url": "https://files.pythonhosted.org/packages/35/41/360fb61a132436f64c26f8b2ab379980439d569eceba4e48ff3499de2b1f/bencode_rs-0.0.7-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "842e2f3cf968f8381991583382976fe953942dfe82b995f3aa75df3d53f11a62",
"md5": "fb286e4351eb7386afca93ee8e31a313",
"sha256": "24df67362897e3b638ac7e4830fca37059d3372d3ece2973eba06506ca7a4bbe"
},
"downloads": -1,
"filename": "bencode_rs-0.0.7-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"has_sig": false,
"md5_digest": "fb286e4351eb7386afca93ee8e31a313",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "~=3.10",
"size": 273318,
"upload_time": "2024-12-23T23:33:00",
"upload_time_iso_8601": "2024-12-23T23:33:00.292369Z",
"url": "https://files.pythonhosted.org/packages/84/2e/2f3cf968f8381991583382976fe953942dfe82b995f3aa75df3d53f11a62/bencode_rs-0.0.7-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "78a4eb1c96d4ca749f8b50b6046597cfe5cd9456800800f2dc50a852a6cf72d5",
"md5": "ed07cf3d1ee5e1f08a97f45b535b6fab",
"sha256": "08913a6b89e7d9fdf29d3d2582a1e4b769695a4dff643a85cdcc5bd1c4de1f72"
},
"downloads": -1,
"filename": "bencode_rs-0.0.7-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl",
"has_sig": false,
"md5_digest": "ed07cf3d1ee5e1f08a97f45b535b6fab",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "~=3.10",
"size": 309943,
"upload_time": "2024-12-23T23:33:01",
"upload_time_iso_8601": "2024-12-23T23:33:01.721852Z",
"url": "https://files.pythonhosted.org/packages/78/a4/eb1c96d4ca749f8b50b6046597cfe5cd9456800800f2dc50a852a6cf72d5/bencode_rs-0.0.7-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ab62efbfd79c3c72747354cba385e1a167017fc090e7d3d88a1bf01475d0d2e5",
"md5": "6441ef8779efe656ef6f2c9044b2dd21",
"sha256": "c367ec0313da98f85e8f2bd1f8a659cc1a89a91355e658a6db4b84dbb848460b"
},
"downloads": -1,
"filename": "bencode_rs-0.0.7-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl",
"has_sig": false,
"md5_digest": "6441ef8779efe656ef6f2c9044b2dd21",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "~=3.10",
"size": 308774,
"upload_time": "2024-12-23T23:33:04",
"upload_time_iso_8601": "2024-12-23T23:33:04.211068Z",
"url": "https://files.pythonhosted.org/packages/ab/62/efbfd79c3c72747354cba385e1a167017fc090e7d3d88a1bf01475d0d2e5/bencode_rs-0.0.7-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9f2c3900449623c33514f60639e91c559c6307cb2e598902c4afbb5099b60cd9",
"md5": "0ce324c4185dbcceb1b101d5cb7df439",
"sha256": "8aa3bbfb15fa67b49a7afb138344b22b2ab36333f9dc640aa8e002b254975621"
},
"downloads": -1,
"filename": "bencode_rs-0.0.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "0ce324c4185dbcceb1b101d5cb7df439",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "~=3.10",
"size": 270641,
"upload_time": "2024-12-23T23:33:05",
"upload_time_iso_8601": "2024-12-23T23:33:05.612439Z",
"url": "https://files.pythonhosted.org/packages/9f/2c/3900449623c33514f60639e91c559c6307cb2e598902c4afbb5099b60cd9/bencode_rs-0.0.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2c0d219db7e13c86b8e1a9fa91ac4489fdd01e26bd51a39a57b2b0271b87165a",
"md5": "9b69e81d958ddd045e2e2abcd2f93a43",
"sha256": "1393e3c66f2b697e2b7d9f40c2720e1812b410b3536ceaa1d0170bd0636b286a"
},
"downloads": -1,
"filename": "bencode_rs-0.0.7-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl",
"has_sig": false,
"md5_digest": "9b69e81d958ddd045e2e2abcd2f93a43",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "~=3.10",
"size": 284133,
"upload_time": "2024-12-23T23:33:08",
"upload_time_iso_8601": "2024-12-23T23:33:08.190838Z",
"url": "https://files.pythonhosted.org/packages/2c/0d/219db7e13c86b8e1a9fa91ac4489fdd01e26bd51a39a57b2b0271b87165a/bencode_rs-0.0.7-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d6c2bc67dbc082c709fb33fc4c51bd5cc95ba29221b3cf96656788dd8f4ccaa0",
"md5": "6af25d1cd6b8e5ca55be2da5759c3a80",
"sha256": "17975cc8b040c05301ced06cbda5dbd2b2d6c2b45e5e2164f0fb35774c66c5eb"
},
"downloads": -1,
"filename": "bencode_rs-0.0.7-cp310-abi3-win32.whl",
"has_sig": false,
"md5_digest": "6af25d1cd6b8e5ca55be2da5759c3a80",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "~=3.10",
"size": 124755,
"upload_time": "2024-12-23T23:33:10",
"upload_time_iso_8601": "2024-12-23T23:33:10.065496Z",
"url": "https://files.pythonhosted.org/packages/d6/c2/bc67dbc082c709fb33fc4c51bd5cc95ba29221b3cf96656788dd8f4ccaa0/bencode_rs-0.0.7-cp310-abi3-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "78115c8d779d7d1138446a669f3f0f4e07148cb193fd6c78245ad547b3367465",
"md5": "79b9ff3cd7f8479b699464ea5494543e",
"sha256": "723c611af79972fc19aca5482f3c1372613e2bbfd618714f336578749db36080"
},
"downloads": -1,
"filename": "bencode_rs-0.0.7-cp310-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "79b9ff3cd7f8479b699464ea5494543e",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "~=3.10",
"size": 130137,
"upload_time": "2024-12-23T23:33:12",
"upload_time_iso_8601": "2024-12-23T23:33:12.425163Z",
"url": "https://files.pythonhosted.org/packages/78/11/5c8d779d7d1138446a669f3f0f4e07148cb193fd6c78245ad547b3367465/bencode_rs-0.0.7-cp310-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dbf5091727719e840af53ff2e30cad673ba1ccc3fef86dc5ea2390499d21c7bd",
"md5": "bb1b19debdad467bb0e76c698e535fe8",
"sha256": "ac975fe2901154b6882411fdafe44fd0fd54c21bca6c9f546941336482c8bd7b"
},
"downloads": -1,
"filename": "bencode_rs-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "bb1b19debdad467bb0e76c698e535fe8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.10",
"size": 397651,
"upload_time": "2024-12-23T23:33:13",
"upload_time_iso_8601": "2024-12-23T23:33:13.657805Z",
"url": "https://files.pythonhosted.org/packages/db/f5/091727719e840af53ff2e30cad673ba1ccc3fef86dc5ea2390499d21c7bd/bencode_rs-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-23 23:33:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "trim21",
"github_project": "bencode-rs",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "maturin",
"specs": [
[
"<",
"2.0"
],
[
">=",
"1.7.8"
]
]
},
{
"name": "abi3audit",
"specs": []
},
{
"name": "pip",
"specs": []
},
{
"name": "pre-commit",
"specs": []
},
{
"name": "pytest",
"specs": []
},
{
"name": "pytest-codspeed",
"specs": [
[
"==",
"3.1.0"
]
]
},
{
"name": "pytest-github-actions-annotate-failures",
"specs": [
[
"==",
"0.2.0"
]
]
}
],
"lcname": "bencode-rs"
}