From cab856e292d96f8ae3686b0d25a778d1682691ae Mon Sep 17 00:00:00 2001 From: Matt Lyon Date: Sun, 23 Aug 2020 20:48:34 +1000 Subject: added top to README --- README.md | 14 +++++++++++++- setup.py | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 083310f..bb4ad7c 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,18 @@ torrents = t.browse(category=CATEGORIES.VIDEOS) torrents = t.browse(category=CATEGORIES.VIDEO.MOVIES, page=1, order=ORDERS.UPLOADED.DES) ``` +## Top +```python +from tpblite import TPB, CATEGORIES +t = TPB() + +# Get the top recent torrents +torrents = t.top(CATEGORIES.GAMES.ALL) + +# Customize with category and restriction to torrents from the last 48h +torrents = t.top(category=CATEGORIES.GAMES.ALL, last_48=True) +``` + ## Categories and Sort Order ```python # To print all available categories, use the classmethod printOptions @@ -76,6 +88,7 @@ You can see how many `Torrent` objects your query has returned, by using the `le ## Torrent object `Torrent` objects represent each torrent found in the `Torrents` class, they have the following attributes + ### Attributes - `Torrent.title` - The name of the torrent (str) - `Torrent.seeds` - The number of seeders (int) @@ -86,7 +99,6 @@ You can see how many `Torrent` objects your query has returned, by using the `le - `Torrent.byte_size` - The filesize in bytes of the torrent (int) - `Torrent.magnetlink` - magnetlink of the torrent (str) - Example Workflow ========== diff --git a/setup.py b/setup.py index 4a48939..3cbfc72 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ this_dir = path.abspath(path.dirname(__file__)) with open(path.join(this_dir, 'README.md'), encoding='utf-8') as f: long_description = f.read() -version = '0.3.0' +version = '0.4.0' setup(name = 'tpblite', version = version, -- cgit v1.2.3