An async Python client library for the Seedr API.
Project description
seedr-api-client
An async Python client library for the Seedr API (v0.1).
Features
- ✅ Fully async — built on
aiohttp - ✅ Typed — Pydantic v2 models,
py.typed,mypy --strictcompliant - ✅ Dual auth — OAuth 2.0 tokens or email/password
- ✅ Streaming downloads — memory-efficient
AsyncGeneratorinterface - ✅ Modular — resources split by domain (filesystem, tasks, media, etc.)
- ✅ PEP standards — modern packaging with
hatchling
Installation
pip install seedr-api-client
Quick Start
With an OAuth access token
import asyncio
from seedr_api import SeedrClient
async def main() -> None:
async with SeedrClient.from_token("your-access-token") as client:
# List root folder
root = await client.filesystem.list_root_contents()
print(root)
# Add a magnet link
task = await client.tasks.add_magnet("magnet:?xt=urn:btih:...")
print(task)
# Stream a file download
async with client.downloads.stream_file(file_id=123) as stream:
with open("output.mkv", "wb") as f:
async for chunk in stream:
f.write(chunk)
asyncio.run(main())
With email & password
async with SeedrClient.from_credentials("you@example.com", "password") as client:
user = await client.user.get()
print(user.username, user.email)
Resources
| Resource | Accessor | Description |
|---|---|---|
| OAuth | client.auth |
Token management, device code flow |
| User | client.user |
Profile, quota, settings |
| Filesystem | client.filesystem |
Folders, files, batch operations |
| Tasks | client.tasks |
Torrent tasks (add, pause, resume, delete) |
| Downloads | client.downloads |
Stream files, get download URLs |
| Presentations | client.presentations |
Streaming URLs, thumbnails, playlists |
| Subtitles | client.subtitles |
List, upload, search OpenSubtitles |
| Search | client.search |
Search library, scrape for magnets |
Device Code Flow (CLI apps)
async with SeedrClient.from_credentials("", "") as client:
device = await client.auth.request_device_code(client_id="your-client-id")
print(f"Visit {device.verification_uri} and enter code: {device.user_code}")
# Poll until user authorizes
token = await client.auth.poll_device_token(
client_id="your-client-id",
device_code=device.device_code,
interval=device.interval,
)
print(f"Access token: {token.access_token}")
Error Handling
from seedr_api.exceptions import NotFoundError, RateLimitError, AuthenticationError
try:
await client.filesystem.get_file(file_id=999)
except NotFoundError:
print("File not found")
except RateLimitError as e:
print(f"Rate limited, retry after {e.retry_after}s")
except AuthenticationError:
print("Invalid credentials or expired token")
License
MIT © 2024
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
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
File details
Details for the file seedr_api_client-0.1.2.tar.gz.
File metadata
- Download URL: seedr_api_client-0.1.2.tar.gz
- Upload date:
- Size: 26.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa8a0e10eb2a10f6489ced01aba7c9155089e14e62ab08e8c6e34600d2cf6d8a
|
|
| MD5 |
313011b4406d607d7153833505701067
|
|
| BLAKE2b-256 |
6e198cc0d1e25491226888ba11d67c4c9acbacb9acb60f643fcbc0d5a9a9f887
|
Provenance
The following attestation bundles were made for seedr_api_client-0.1.2.tar.gz:
Publisher:
publish.yml on Ns-AnoNymouS/seedr-api-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seedr_api_client-0.1.2.tar.gz -
Subject digest:
aa8a0e10eb2a10f6489ced01aba7c9155089e14e62ab08e8c6e34600d2cf6d8a - Sigstore transparency entry: 1374022159
- Sigstore integration time:
-
Permalink:
Ns-AnoNymouS/seedr-api-client@4827cf6b4191980fa4914c28e588d3fbbc7591ef -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Ns-AnoNymouS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4827cf6b4191980fa4914c28e588d3fbbc7591ef -
Trigger Event:
push
-
Statement type:
File details
Details for the file seedr_api_client-0.1.2-py3-none-any.whl.
File metadata
- Download URL: seedr_api_client-0.1.2-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f55a4ac46b86eee485137c11d2c616c8973e4c675d25bf3af9ba00d3a25a4302
|
|
| MD5 |
e4c5d9b91ff6db2ec7ed7ec7b438828f
|
|
| BLAKE2b-256 |
ec1a1b1a587e1467a34669d70ab775acaf5fb0b9a925d9d8a296fe7be96265f7
|
Provenance
The following attestation bundles were made for seedr_api_client-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on Ns-AnoNymouS/seedr-api-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seedr_api_client-0.1.2-py3-none-any.whl -
Subject digest:
f55a4ac46b86eee485137c11d2c616c8973e4c675d25bf3af9ba00d3a25a4302 - Sigstore transparency entry: 1374022293
- Sigstore integration time:
-
Permalink:
Ns-AnoNymouS/seedr-api-client@4827cf6b4191980fa4914c28e588d3fbbc7591ef -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Ns-AnoNymouS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4827cf6b4191980fa4914c28e588d3fbbc7591ef -
Trigger Event:
push
-
Statement type: