torrent_tool


Nametorrent_tool JSON
Version 0.0.4.2 PyPI version JSON
download
home_pagehttps://github.com/ChenyangGao/web-mount-packs/tree/main/python-module/torrent_tool
Summarytorrent tool.
upload_time2024-04-30 17:04:40
maintainerNone
docs_urlNone
authorChenyangGao
requires_python<4.0,>=3.10
licenseMIT
keywords torrent magnet
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # BitTorrent Tool Module

- [The BitTorrent Protocol Specification](http://www.bittorrent.org/beps/bep_0003.html)
- [Peer-to-Peer (P2P) Architecture](https://www.rfc-editor.org/rfc/rfc5694)
- [Peer-to-Peer Streaming Peer Protocol (PPSPP)](https://www.rfc-editor.org/rfc/rfc7574.txt)
- http://jonas.nitro.dk/bittorrent/bittorrent-rfc.html

## Installation

You can install from [pypi](https://pypi.org/project/torrent_tool/)

```console
pip install -U torrent_tool
```

## Usage

### As a Command Line

You can use this module to convert torrent files to magnet links.

```console
$ python -m torrent_tool -h
usage: torrent_tool.py [-h] [-f] [files ...]

torrent to magnet

positional arguments:
  files       paths to torrent files

options:
  -h, --help  show this help message and exit
  -f, --full  append more detailed queries
```

### As a Module

```python
>>> import torrent_tool
>>> help(torrent_tool)

Help on module torrent_tool:

NAME
    torrent_tool - # encoding: utf-8

FUNCTIONS
    bdecode(data, /) -> 'BDecodedType'
        Decode bencode formatted bytes object.
    
    bencode(o, fp=None, /)
        Encode `object` into the bencode format.
    
    dump = bencode(o, fp=None, /)
        Encode `object` into the bencode format.
    
    load = bdecode(data, /) -> 'BDecodedType'
        Decode bencode formatted bytes object.
    
    torrent_files(data, /, tree: 'bool' = False) -> 'dict'
        show all files and their lengths for a torrent
    
    torrent_to_magnet(data, /, full: 'bool' = False, infohash_alg: 'str' = 'btih') -> 'str'
        convert a torrent to a magnet link

DATA
    __all__ = ['bencode', 'bdecode', 'dump', 'load', 'torrent_files', 'tor...

VERSION
    (0, 0, 2, 1)

AUTHOR
    ChenyangGao <https://chenyanggao.github.io>

FILE
    /path/to/torrent_tool.py
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ChenyangGao/web-mount-packs/tree/main/python-module/torrent_tool",
    "name": "torrent_tool",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "torrent, magnet",
    "author": "ChenyangGao",
    "author_email": "wosiwujm@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d8/82/1d114fe181fa6e4517c156ecd98bef4a9433ad5e684d10eacb1eb9764850/torrent_tool-0.0.4.2.tar.gz",
    "platform": null,
    "description": "# BitTorrent Tool Module\n\n- [The BitTorrent Protocol Specification](http://www.bittorrent.org/beps/bep_0003.html)\n- [Peer-to-Peer (P2P) Architecture](https://www.rfc-editor.org/rfc/rfc5694)\n- [Peer-to-Peer Streaming Peer Protocol (PPSPP)](https://www.rfc-editor.org/rfc/rfc7574.txt)\n- http://jonas.nitro.dk/bittorrent/bittorrent-rfc.html\n\n## Installation\n\nYou can install from [pypi](https://pypi.org/project/torrent_tool/)\n\n```console\npip install -U torrent_tool\n```\n\n## Usage\n\n### As a Command Line\n\nYou can use this module to convert torrent files to magnet links.\n\n```console\n$ python -m torrent_tool -h\nusage: torrent_tool.py [-h] [-f] [files ...]\n\ntorrent to magnet\n\npositional arguments:\n  files       paths to torrent files\n\noptions:\n  -h, --help  show this help message and exit\n  -f, --full  append more detailed queries\n```\n\n### As a Module\n\n```python\n>>> import torrent_tool\n>>> help(torrent_tool)\n\nHelp on module torrent_tool:\n\nNAME\n    torrent_tool - # encoding: utf-8\n\nFUNCTIONS\n    bdecode(data, /) -> 'BDecodedType'\n        Decode bencode formatted bytes object.\n    \n    bencode(o, fp=None, /)\n        Encode `object` into the bencode format.\n    \n    dump = bencode(o, fp=None, /)\n        Encode `object` into the bencode format.\n    \n    load = bdecode(data, /) -> 'BDecodedType'\n        Decode bencode formatted bytes object.\n    \n    torrent_files(data, /, tree: 'bool' = False) -> 'dict'\n        show all files and their lengths for a torrent\n    \n    torrent_to_magnet(data, /, full: 'bool' = False, infohash_alg: 'str' = 'btih') -> 'str'\n        convert a torrent to a magnet link\n\nDATA\n    __all__ = ['bencode', 'bdecode', 'dump', 'load', 'torrent_files', 'tor...\n\nVERSION\n    (0, 0, 2, 1)\n\nAUTHOR\n    ChenyangGao <https://chenyanggao.github.io>\n\nFILE\n    /path/to/torrent_tool.py\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "torrent tool.",
    "version": "0.0.4.2",
    "project_urls": {
        "Homepage": "https://github.com/ChenyangGao/web-mount-packs/tree/main/python-module/torrent_tool",
        "Repository": "https://github.com/ChenyangGao/web-mount-packs/tree/main/python-module/torrent_tool"
    },
    "split_keywords": [
        "torrent",
        " magnet"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66d4a8604cbc24be32ce0c133503dc1cf2846a0a7a9dcc5a3c04f902d3bb00e4",
                "md5": "48f89893e5d4822e957bdf7e9d7fabda",
                "sha256": "1d351d8bcdb8372b0e1a2f430f097efc3382eb3d63ddc053e79e28971ffd3668"
            },
            "downloads": -1,
            "filename": "torrent_tool-0.0.4.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "48f89893e5d4822e957bdf7e9d7fabda",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 6734,
            "upload_time": "2024-04-30T17:04:38",
            "upload_time_iso_8601": "2024-04-30T17:04:38.544314Z",
            "url": "https://files.pythonhosted.org/packages/66/d4/a8604cbc24be32ce0c133503dc1cf2846a0a7a9dcc5a3c04f902d3bb00e4/torrent_tool-0.0.4.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d8821d114fe181fa6e4517c156ecd98bef4a9433ad5e684d10eacb1eb9764850",
                "md5": "57fa413d7fd95ed3d094e42062c31dfe",
                "sha256": "0540631da8d3c50db9fbc3fb0740da1fffc7cec57c4e2c1b52a8536b5b28aab1"
            },
            "downloads": -1,
            "filename": "torrent_tool-0.0.4.2.tar.gz",
            "has_sig": false,
            "md5_digest": "57fa413d7fd95ed3d094e42062c31dfe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 5051,
            "upload_time": "2024-04-30T17:04:40",
            "upload_time_iso_8601": "2024-04-30T17:04:40.701621Z",
            "url": "https://files.pythonhosted.org/packages/d8/82/1d114fe181fa6e4517c156ecd98bef4a9433ad5e684d10eacb1eb9764850/torrent_tool-0.0.4.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-30 17:04:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ChenyangGao",
    "github_project": "web-mount-packs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "torrent_tool"
}
        
Elapsed time: 0.25529s