# 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/4a/f0/29045312623dd01aa956f6c043ea6b97b569d0fea4756e1ea3dea973286f/torrent_tool-0.0.4.3.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.3",
"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": "2921d2742c23269f5d67a1072e0468b5db0a8b48af2c9fa330aef260f0959dae",
"md5": "413ae63e9960fb60c4de7a3d2995d624",
"sha256": "b50c6612635b3fcd19d2f2ee1ba85ce664788d54c1b36828d465a39e011bc97f"
},
"downloads": -1,
"filename": "torrent_tool-0.0.4.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "413ae63e9960fb60c4de7a3d2995d624",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 7156,
"upload_time": "2024-09-21T06:32:49",
"upload_time_iso_8601": "2024-09-21T06:32:49.792423Z",
"url": "https://files.pythonhosted.org/packages/29/21/d2742c23269f5d67a1072e0468b5db0a8b48af2c9fa330aef260f0959dae/torrent_tool-0.0.4.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4af029045312623dd01aa956f6c043ea6b97b569d0fea4756e1ea3dea973286f",
"md5": "2248743befcd5b3e3aec9f6fc65297f6",
"sha256": "8d15c3495ff03cee6783bab38685088eae17b8a5c98527fb40aef38dca2852f1"
},
"downloads": -1,
"filename": "torrent_tool-0.0.4.3.tar.gz",
"has_sig": false,
"md5_digest": "2248743befcd5b3e3aec9f6fc65297f6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 5186,
"upload_time": "2024-09-21T06:32:51",
"upload_time_iso_8601": "2024-09-21T06:32:51.708338Z",
"url": "https://files.pythonhosted.org/packages/4a/f0/29045312623dd01aa956f6c043ea6b97b569d0fea4756e1ea3dea973286f/torrent_tool-0.0.4.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-21 06:32:51",
"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"
}