dtrpg-sdk.py
A Python SDK for the DriveThruRPG API.
Requires Python 3.12+.
Provides configuration, the credential-login and application-key auth flows, session
lifecycle management, and a LibraryClient covering order products, download
preparation, and product lists/product list items. For a reference implementation of
the same API surface in another language, see the
Go, Rust,
or Swift SDKs.
Installation
Not yet published to PyPI. Once released:
uv add dtrpg-sdk
Quick Start
from dtrpg_sdk import Config, DriveThruRpgSdk, LibraryItemsParams
from dtrpg_sdk.auth import key_exchange
config = Config(application_key="my-app-key")
sdk = DriveThruRpgSdk.with_config(config)
# Exchange the application key for a session token.
token_response = key_exchange.authenticate("my-app-key", config)
sdk.apply_auth_response(token_response)
# Build an authenticated library client and fetch the user's library.
client = sdk.library_client()
products = client.list_order_products(LibraryItemsParams(page=1, page_size=25))
for item in products.data:
print(item.attributes.name)
Building from source
This repository uses the dtrpg-api repository as a submodule (API/), matching the
pattern used by the Go/Rust/Swift SDKs. Clone with submodules, or initialize them after
cloning:
git clone --recursive https://github.com/pilgrimagesoftware/dtrpg-sdk.py.git
# or, if already cloned:
git submodule update --init --recursive
Development
uv sync --all-extras --dev
uv run ruff check .
uv run ruff format --check .
uv run pyrefly check
uv run pytest
See docs/python.md in the umbrella repo for the full set of conventions this project follows.
Release Process
See RELEASE.md.
License
MIT — see LICENSE.md.
Metadata
Release files for dtrpg-sdk 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dtrpg_sdk-0.3.0.tar.gz | 68.7 kB | Without provenance | Details for dtrpg_sdk-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dtrpg_sdk-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for dtrpg_sdk-0.3.0-py3-none-any.whl |
Total release size: 95.3 kB
Release files / dtrpg_sdk-0.3.0.tar.gz
| Download URL | dtrpg_sdk-0.3.0.tar.gz |
|---|---|
| Size | 68.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59e5b309af223460e522fb964a4456f3d7279c114423239f6f38ecb69ca7b87a
|
|
BLAKE2b-256 checksum How to use checksums |
9a58ee8926bd3be8456b4fb2b8a7c4e70a5ef4710984e4afdce070f6b3243ccf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / dtrpg_sdk-0.3.0-py3-none-any.whl
| Download URL | dtrpg_sdk-0.3.0-py3-none-any.whl |
|---|---|
| Size | 26.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f75089d6b5fe128129045b51837645664fbee9373eb376c8c8cbf8d0a6b2049b
|
|
BLAKE2b-256 checksum How to use checksums |
6fa030a9787c28734994a5ca1b40007993faf7f2c132526d5e457c5fb9ded0f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for dtrpg-sdk 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.