Metadata-Version: 2.1
Name: torrent_tool
Version: 0.0.2
Summary: torrent tool.
Home-page: https://github.com/ChenyangGao/web-mount-packs/tree/main/python-cmdline/torrent_tool
License: MIT
Keywords: torrent,magnet
Author: ChenyangGao
Author-email: wosiwujm@gmail.com
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Project-URL: Repository, https://github.com/ChenyangGao/web-mount-packs/tree/main/python-cmdline/torrent_tool
Description-Content-Type: text/markdown

# 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(s, /) -> '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(s, /) -> 'BDecodedType'
        Decode bencode formatted bytes object.
    
    torrent_list(data, /) -> 'list[str]'
        list all files from a torrent
    
    torrent_to_magnet(data, /, full: 'bool' = False, infohash_alg: 'str' = 'btih') -> 'str'
        convert a torrent into a magnet link
    
    torrent_tree(data, /) -> 'dict'
        tree all files from a torrent

DATA
    __all__ = ['bencode', 'bdecode', 'dump', 'load', 'torrent_list', 'torr...

VERSION
    (0, 0, 1)

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

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

