Skip to main content

prdb-sdk (Python)

Python client for the prdb Public API.

Install

pip install prdb-sdk

Requires Python 3.10 or newer. The client is async and uses httpx under the hood, by way of the Kiota bundle.

Usage

import asyncio
from uuid import UUID

from prdb_sdk import create_client


async def main() -> None:
    client = create_client(api_key="...")

    # GET /videos
    page = await client.videos.get()
    for video in page.items or []:
        print(video.title)

    # GET /videos/{id}
    video = await client.videos.by_id(UUID("...")).get()

    # Query parameters are typed, including the closed-set ones.
    from prdb_sdk.generated.videos.videos_request_builder import VideosRequestBuilder

    config = VideosRequestBuilder.VideosRequestBuilderGetRequestConfiguration(
        query_parameters=VideosRequestBuilder.VideosRequestBuilderGetQueryParameters(
            page=2,
            page_size=50,
            search="...",
        )
    )
    page_two = await client.videos.get(request_configuration=config)


asyncio.run(main())

The request builders mirror the API's URL structure, so GET /videos/{id}/filehashes is client.videos.by_id(video_id).filehashes.get().

Authentication

create_client sends the key in the X-Api-Key header, and keeps it on the API host: a redirect to a different origin raises CrossOriginRedirectError rather than handing your credential to whoever answers there. Redirects that stay on the same origin are followed normally.

base_url must use https, so the key is never sent in cleartext.

GET /health is the only endpoint that works without a key; use create_anonymous_client() for health probes. That one has no credential to protect, so it accepts a plain http base URL.

Options

client = create_client(
    api_key="...",
    base_url="https://api.prdb.net",   # override for a staging deployment
    http_client=my_httpx_async_client, # control timeouts, proxies, connection limits
)

The client you pass in is configured with the SDK's middleware in place, so it behaves like the one built for you — same redirect rule, same retry handling.

Generated code

Everything under prdb_sdk/generated/ is produced by Kiota from spec/openapi.json in the repository root and is overwritten on every regeneration. Do not edit it — see the root README.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prdb_sdk-0.1.1.tar.gz (46.8 kB view details)

Uploaded Source

Built Distribution

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

prdb_sdk-0.1.1-py3-none-any.whl (217.1 kB view details)

Uploaded Python 3

File details

Details for the file prdb_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: prdb_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 46.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prdb_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0976b434b68b480b6575b3a2608160b74f362a109ac2195ab5ec8739431de57f
MD5 175ee6e89a4f92e90f58f1a8f88d3302
BLAKE2b-256 6ac496f1d42cdede16a58f856e793b8613752ebc08cade0dd92fa8885bb6a76a

See more details on using hashes here.

Provenance

The following attestation bundles were made for prdb_sdk-0.1.1.tar.gz:

Publisher: release.yml on prdb-net/prdb-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prdb_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: prdb_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 217.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prdb_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc58be21555c4f0e0f291ca201042a5beefbc475252632b4608ba1dc5283f32b
MD5 be49ac96ae8857ec3540448279a321ab
BLAKE2b-256 c2d8c5c10ecc8786decb59854173199d8eb32ef8487908e8ac7f0c9d5362986b

See more details on using hashes here.

Provenance

The following attestation bundles were made for prdb_sdk-0.1.1-py3-none-any.whl:

Publisher: release.yml on prdb-net/prdb-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page