Skip to main content

Python client for PreDB.net API

Project description

PreDB Python Client 🎉

Made with Python

Python client for the PreDB.net API.

Like it? I'd appreciate the support :)

Watch on Twitch Join on Discord Donate on Ko-Fi

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


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.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

predb-1.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file predb-1.0.0.tar.gz.

File metadata

  • Download URL: predb-1.0.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for predb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6a739405686f55e07dfb2f5a209845ee8bf75f79645db230f09512e73fd9cc2d
MD5 28aaf3fb8819a3c13eb04a10ff046789
BLAKE2b-256 29cf69a19d5b4bfa41dedc69f515fb05418f65aa5022a65a5bea2432c3e0576f

See more details on using hashes here.

File details

Details for the file predb-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: predb-1.0.0-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

Hashes for predb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5cf33a66d4a80109766a3afddc7268a1e0aeb2063d138981c7be07d24bc8a35
MD5 5f0a6870b856dc9518777c188778f5d4
BLAKE2b-256 e25d6e81ec812a11cdbfed6328a5d79a99db20b8f7719af6fe25ad2f3b79b190

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page