Python client for PreDB.net API
Project description
PreDB Python Client 🎉
Python client for the PreDB.net API.
Like it? I'd appreciate the support :)
Installation
pip install predb
Usage
from predb import PreDBClient
# Initialize the client
client = PreDBClient()
# Search for releases
response = client.search("!search Ubuntu", user_agent="MyApp/1.0")
# Check the response
if response and response.get("status") == "success":
for row in response.get("data", {}).get("rows", []):
print(f"{row['name']} - {row['cat']}")
Search Types
The client supports different search types using the command prefix format:
!search <query>or!dupe <query>- General search!pre <name>- Search by exact release name!nfo <query>- Search in NFO files!group <name>- Search by group name!section <name>or!cat <name>- Search by section/category!genre <name>- Search by genre!tag <name>or!lang <name>- Search by tag/language!nuked,!unnuked,!delpre,!undelpre- Filter by status!last- Get last releases
Example
from predb import PreDBClient
client = PreDBClient()
# Search for a specific release
result = client.search("!pre Some.Release.Name-GRP", user_agent="MyApp/1.0")
# Search by group
result = client.search("!group RARBG", user_agent="MyApp/1.0")
# Get latest releases
result = client.search("!last", user_agent="MyApp/1.0")
API Response
The API returns a dictionary with the following structure:
{
"status": "success",
"message": "",
"data": {
"offset": 0,
"total": 100,
"time": 0.5,
"rows": [
{
"id": "12345",
"name": "Release.Name-GRP",
"team": "GRP",
"cat": "TV",
"genre": "...",
"url": "...",
"size": "...",
"files": "...",
"pretime": 1234567890,
"nuke": "...",
"unnuke": "...",
"reason": "...",
...
}
]
}
}
Requirements
- Python 3.7+
- requests
- timeago
License
MIT
That's it!
Be excellent to each other. And, Party on, dudes!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
predb-1.0.1.tar.gz
(5.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
predb-1.0.1-py3-none-any.whl
(5.5 kB
view details)
File details
Details for the file predb-1.0.1.tar.gz.
File metadata
- Download URL: predb-1.0.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fff71bd74777d6d23a095fb684b18de1453dd50549c87c89d92ed978514d791d
|
|
| MD5 |
b4df6c02c2c801cee22224e74d81e7a1
|
|
| BLAKE2b-256 |
defa016691181b21f58f1283e6847e04262d57bac849c402756ad863843fded6
|
File details
Details for the file predb-1.0.1-py3-none-any.whl.
File metadata
- Download URL: predb-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe03c4033430ce3243cba0a7c331b3940258ab9cf37f31a91c2abde81248b004
|
|
| MD5 |
46110d45e0b36072d4a1db08a0b8294e
|
|
| BLAKE2b-256 |
019294421f05dee9c3c80d73b3505e011a80781f7b4c02026d6a1684b656c52f
|