bencode-rs


Namebencode-rs JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
Summarya bencode parser binding build with pyo3
upload_time2024-05-26 16:09:40
maintainerNone
docs_urlNone
authorNone
requires_python<4.0,>=3.8
licenseNone
keywords bittorrent bencode p2p
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # 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": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "bittorrent, bencode, p2p",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/4d/71/ae4952b3d107ea6f9049dff940fdf8fbaa0781ab9d130827f1a0efda0d21/bencode_rs-0.0.4.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 binding build with pyo3",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://github.com/trim21/bencode-rs"
    },
    "split_keywords": [
        "bittorrent",
        " bencode",
        " p2p"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d88acf586f4aeaa823031ffc72962fc424f75e0a97b4dc0afc059845d5f6482",
                "md5": "dbdb52788d93c990572e4e1651bc6472",
                "sha256": "a68c2561de21ca64a391ed399872c619e7134d1bc7407072b7672ad502ad67fd"
            },
            "downloads": -1,
            "filename": "bencode_rs-0.0.4-cp38-abi3-macosx_10_12_x86_64.whl",
            "has_sig": false,
            "md5_digest": "dbdb52788d93c990572e4e1651bc6472",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<4.0,>=3.8",
            "size": 244029,
            "upload_time": "2024-05-26T16:09:25",
            "upload_time_iso_8601": "2024-05-26T16:09:25.787630Z",
            "url": "https://files.pythonhosted.org/packages/9d/88/acf586f4aeaa823031ffc72962fc424f75e0a97b4dc0afc059845d5f6482/bencode_rs-0.0.4-cp38-abi3-macosx_10_12_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5b1cc8286838d5cc188a03c7e2df37479506b9601ca39dc2501cf141fe6caf73",
                "md5": "81551e94a2f53f5b51aae4b764185f96",
                "sha256": "815eb63665e76f82e1ab106c54abd61348b6dd05fc4482d405957cada6fdf418"
            },
            "downloads": -1,
            "filename": "bencode_rs-0.0.4-cp38-abi3-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "81551e94a2f53f5b51aae4b764185f96",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<4.0,>=3.8",
            "size": 239401,
            "upload_time": "2024-05-26T16:09:27",
            "upload_time_iso_8601": "2024-05-26T16:09:27.220517Z",
            "url": "https://files.pythonhosted.org/packages/5b/1c/c8286838d5cc188a03c7e2df37479506b9601ca39dc2501cf141fe6caf73/bencode_rs-0.0.4-cp38-abi3-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "61e8065258ee1b511448ce6ddd768b5d4b5bf37ca443c956d6295106b86401ce",
                "md5": "ca0892a7e528cbedc704d67387407ee1",
                "sha256": "d943e7b70689b9262618bba55a7353e6c091918d399c6f223e3c52bfccb9a433"
            },
            "downloads": -1,
            "filename": "bencode_rs-0.0.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "has_sig": false,
            "md5_digest": "ca0892a7e528cbedc704d67387407ee1",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<4.0,>=3.8",
            "size": 1014782,
            "upload_time": "2024-05-26T16:09:28",
            "upload_time_iso_8601": "2024-05-26T16:09:28.906989Z",
            "url": "https://files.pythonhosted.org/packages/61/e8/065258ee1b511448ce6ddd768b5d4b5bf37ca443c956d6295106b86401ce/bencode_rs-0.0.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b45129395c2eb560cad475b8ef2fcb136da15fc2dbccf09bbca11eb0426e20c5",
                "md5": "bbe3004f043cf2a3242da4e17eb0adb0",
                "sha256": "2b50a800cb43013546d293b804a941170e8dc935eec0df184b18e3aa3f034859"
            },
            "downloads": -1,
            "filename": "bencode_rs-0.0.4-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "has_sig": false,
            "md5_digest": "bbe3004f043cf2a3242da4e17eb0adb0",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<4.0,>=3.8",
            "size": 1028907,
            "upload_time": "2024-05-26T16:09:30",
            "upload_time_iso_8601": "2024-05-26T16:09:30.197263Z",
            "url": "https://files.pythonhosted.org/packages/b4/51/29395c2eb560cad475b8ef2fcb136da15fc2dbccf09bbca11eb0426e20c5/bencode_rs-0.0.4-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e620869558a6fc08a5f75c2b3e816737a99050a3f45af06c22fc6655938e3ba7",
                "md5": "211cc0bd1e84b2ad8d61a55789d14336",
                "sha256": "e90da6b64f1250d3ac7f5dce6089ac5d9275403589c2ed4bf2eb02bfc25afeb7"
            },
            "downloads": -1,
            "filename": "bencode_rs-0.0.4-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl",
            "has_sig": false,
            "md5_digest": "211cc0bd1e84b2ad8d61a55789d14336",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<4.0,>=3.8",
            "size": 1045313,
            "upload_time": "2024-05-26T16:09:31",
            "upload_time_iso_8601": "2024-05-26T16:09:31.405233Z",
            "url": "https://files.pythonhosted.org/packages/e6/20/869558a6fc08a5f75c2b3e816737a99050a3f45af06c22fc6655938e3ba7/bencode_rs-0.0.4-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a0e9acbd0c5af6861f6b753937aad01170ef74fa17ca21142a6cb8e8ca098a8a",
                "md5": "06382b0f78fce205fcbe220627dfd8e4",
                "sha256": "ceaf4c8ba7124fe2e26402c8e56fc936fd4b277cc95046a49fe7fadc53d37fff"
            },
            "downloads": -1,
            "filename": "bencode_rs-0.0.4-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl",
            "has_sig": false,
            "md5_digest": "06382b0f78fce205fcbe220627dfd8e4",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<4.0,>=3.8",
            "size": 1161700,
            "upload_time": "2024-05-26T16:09:33",
            "upload_time_iso_8601": "2024-05-26T16:09:33.195502Z",
            "url": "https://files.pythonhosted.org/packages/a0/e9/acbd0c5af6861f6b753937aad01170ef74fa17ca21142a6cb8e8ca098a8a/bencode_rs-0.0.4-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c2be2d514a6c8a388548078ce1354c0387dd250e1e5128ecaee0ad63e6cd8c09",
                "md5": "76146bd61966d222a951a5b3dbc7da8b",
                "sha256": "7bc9c9812946e77dd3e4fc2b48756701edd7c643377ab9fb972da49c01dacbb0"
            },
            "downloads": -1,
            "filename": "bencode_rs-0.0.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "76146bd61966d222a951a5b3dbc7da8b",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<4.0,>=3.8",
            "size": 1014990,
            "upload_time": "2024-05-26T16:09:35",
            "upload_time_iso_8601": "2024-05-26T16:09:35.008164Z",
            "url": "https://files.pythonhosted.org/packages/c2/be/2d514a6c8a388548078ce1354c0387dd250e1e5128ecaee0ad63e6cd8c09/bencode_rs-0.0.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a585b743abc376bedc008c5e044bc27183e1ac319270de1dd21c6b436f3d0567",
                "md5": "8bb318a2734cb177bcb387a33a648b74",
                "sha256": "456fc915d7b717cd1b071de444c7d9c8cbb6c9e515b082396eee8c5d72923bf6"
            },
            "downloads": -1,
            "filename": "bencode_rs-0.0.4-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl",
            "has_sig": false,
            "md5_digest": "8bb318a2734cb177bcb387a33a648b74",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<4.0,>=3.8",
            "size": 1039487,
            "upload_time": "2024-05-26T16:09:36",
            "upload_time_iso_8601": "2024-05-26T16:09:36.431495Z",
            "url": "https://files.pythonhosted.org/packages/a5/85/b743abc376bedc008c5e044bc27183e1ac319270de1dd21c6b436f3d0567/bencode_rs-0.0.4-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d565aae9fbd91a0baf7ed7ddc95ecf7149d16083a4a63eb580c4f69a520fe818",
                "md5": "44a717f576f45322f093e1deab8a7ffd",
                "sha256": "992819d0807d55e086bfb95e3bac248060a9f13f2068fbb1d94e5e8892127280"
            },
            "downloads": -1,
            "filename": "bencode_rs-0.0.4-cp38-abi3-win32.whl",
            "has_sig": false,
            "md5_digest": "44a717f576f45322f093e1deab8a7ffd",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<4.0,>=3.8",
            "size": 133256,
            "upload_time": "2024-05-26T16:09:38",
            "upload_time_iso_8601": "2024-05-26T16:09:38.006163Z",
            "url": "https://files.pythonhosted.org/packages/d5/65/aae9fbd91a0baf7ed7ddc95ecf7149d16083a4a63eb580c4f69a520fe818/bencode_rs-0.0.4-cp38-abi3-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e2626830b22f2894f40802a5b87c0a1daf4a2a0c07e716c8978e22c005379a30",
                "md5": "6299d8ba7e5d0c3c8903a6c93037caf3",
                "sha256": "28b67b15b451870e1cc48dfa5d6947a89f72202774e0fc816a996b5ce2f48bfc"
            },
            "downloads": -1,
            "filename": "bencode_rs-0.0.4-cp38-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "6299d8ba7e5d0c3c8903a6c93037caf3",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": "<4.0,>=3.8",
            "size": 135120,
            "upload_time": "2024-05-26T16:09:38",
            "upload_time_iso_8601": "2024-05-26T16:09:38.968891Z",
            "url": "https://files.pythonhosted.org/packages/e2/62/6830b22f2894f40802a5b87c0a1daf4a2a0c07e716c8978e22c005379a30/bencode_rs-0.0.4-cp38-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d71ae4952b3d107ea6f9049dff940fdf8fbaa0781ab9d130827f1a0efda0d21",
                "md5": "f07c635ef8739e557be4096beee7c867",
                "sha256": "d927f9670aa3d73384a08ca22be79ad5f77072098d160660c99bab7c1a0ecb25"
            },
            "downloads": -1,
            "filename": "bencode_rs-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "f07c635ef8739e557be4096beee7c867",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 396073,
            "upload_time": "2024-05-26T16:09:40",
            "upload_time_iso_8601": "2024-05-26T16:09:40.062405Z",
            "url": "https://files.pythonhosted.org/packages/4d/71/ae4952b3d107ea6f9049dff940fdf8fbaa0781ab9d130827f1a0efda0d21/bencode_rs-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-26 16:09:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "trim21",
    "github_project": "bencode-rs",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "bencode-rs"
}
        
Elapsed time: 0.61586s