Skip to main content

dugout

The Python client for the Barajitas trading-card database API — the dugout is where the team keeps everything within reach.

Part of The Barajitas Project · API contract in the barajitas docs

pip install dugout
import dugout

api = dugout.Dugout(token="your-api-token",
                    base_url="https://your-barajitas-host/api/v1/")

for card_set in api.sets():
    print(card_set["year"], card_set["name"])

# Filters are passed straight through to the API. A name search needs a
# set or checklist scope — the server refuses an unscoped one.
judges = api.cards(set=card_set["id"], name="aaron judge")

# Every id is a UUID that survives a re-import — safe to store.

What it wraps

Method Endpoint
sets() / set(id) /sets/
checklists() / checklist(id) /checklists/
checklist_index(id) /checklists/{id}/index/
cards() / card(id) /cards/
parallels() / parallel(id) /parallels/

List methods return iterators that walk the pagination for you, at the server's maximum page size.

Honest by inheritance

The API refuses to guess, and this client passes that through verbatim: imported: null on a checklist means declared-but-not-loaded, and coverage: "unknown" on a parallel never means "all cards".

Rate limits

Every response's rate-limit state is on api.rate_limit. On a 429 the client sleeps out the server's Retry-After and retries once (wait_on_limit=False to get a RateLimited exception instead — the windows are fixed, not sliding, so hammering only keeps them full).

Status

Early — the endpoints above work; typed models and the collection-sync surface (for vitrina) will follow the server's API.

Download files

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

Source Distribution

dugout-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

dugout-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file dugout-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for dugout-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d101ee19dbadfb19fb597ff89880db27acd34aab1c0142114d3d18afb40c1074
MD5 d12df3f4857a8a25fc97f59bbeb29211
BLAKE2b-256 14f1ad407695f836dcef2399f4ab12f592f8c404fe05d11a846e72af15bafdd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for dugout-0.1.0.tar.gz:

Publisher: publish.yml on Barajitas-Project/dugout

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

File details

Details for the file dugout-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for dugout-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9e56afdbc54b984ad65b91c4cd9c783992bb518b570e54a792ea1e79f772bba
MD5 d95e0449e872dee166a93a8d37db3183
BLAKE2b-256 6f919ed5e3c2b20b6038a0013793ba0515fea3cc73f0c9ab5cb3bcf786f46102

See more details on using hashes here.

Provenance

The following attestation bundles were made for dugout-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Barajitas-Project/dugout

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

Supported by

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