Skip to main content

A fast, type-safe Python SDK for the TCGdex API. Query Pokémon Trading Card Game data easily. 🚀

Project description

TCGdex Main Image

Pypi Version Pypi Downloads Github stars Build Status Discord Link

TCGdex Python SDK

A fast, type-safe Python SDK for the TCGdex API. Query Pokémon Trading Card Game data easily. 🚀

from tcgdexsdk import TCGdex

# Fetch a card in one line
card = await TCGdex().card.get("swsh3-136")
card = TCGdex().card.getSync("swsh3-136")
print(f"Found: {card.name} ({card.localId}/{card.set.cardCount.total})")

⚡️ Quick Install

pip install tcgdex-sdk

🚀 Features

  • Type-Safe: Full typing support for better IDE integration
  • Async/Await: Built for modern Python applications and compatible with synchronous operations
  • Zero Config: Works out of the box
  • Multi-Language: Support for English, French, German, Japanese, Chinese, and more
  • Rich Data: Access cards, sets, series, rarities, and more
  • Lightweight: Minimal dependencies (only dacite)

🎯 Quick Examples

Find Cards by Various Criteria

sdk = TCGdex("en")

# Get the cards made by the illustrator
cards = await sdk.illustrator.get("5ban Graphics")
cards = sdk.illustrator.getSync("5ban Graphics")

# Get the data about the Sword & Shield serie by ID
series = await sdk.serie.get("swsh")
series = sdk.serie.getSync("swsh")

# Get all cards with 110 HP
hp_cards = await sdk.hp.get("110")
hp_cards = sdk.hp.getSync("110")

# List all available rarities
rarities = await sdk.rarity.list()
rarities = sdk.rarity.listSync()

# List all cards with the name being "Furret"
rarities = await sdk.card.list(Query().equal("name", "Furret"))
rarities = sdk.card.listSync(Query().equal("name", "Furret"))

Working with Sets and Series

# Get set details
darkness_ablaze = await sdk.set.get("Darkness Ablaze")
# darkness_ablaze = sdk.set.getSync("Darkness Ablaze")
print(f"Set: {darkness_ablaze.name} ({darkness_ablaze.cardCount.total} cards)")

# Get series info
swsh = await sdk.serie.get("swsh")
# swsh = sdk.serie.getSync("swsh")
print(f"Series: {swsh.name} ({len(swsh.sets)} sets)")

🛠 Available Endpoints

Card Data

sdk.card         # Core card data
sdk.rarity       # Card rarities
sdk.hp           # HP values
sdk.illustrator  # Card illustrators

Game Mechanics

sdk.type         # Pokémon types
sdk.energyType   # Energy types
sdk.retreat      # Retreat costs
sdk.stage        # Evolution stages

Card Details

sdk.variant        # Card variants
sdk.suffix         # Card suffixes
sdk.regulationMark # Regulation marks
sdk.dexId         # Pokédex IDs

Collections

sdk.set           # Card sets
sdk.serie         # Card series

🌐 Language Support

from tcgdexsdk import TCGdex, Language

# Using string
sdk = TCGdex("en")  # English
sdk = TCGdex("fr")  # French

# Using enum (type-safe)
sdk = TCGdex(Language.EN)
sdk = TCGdex(Language.FR)

# After creating the instance you can change at any time the language
sdk.setLanguage(Language.FR)
# or
sdk.setLanguage("fr")

full list of languages available here

__

🤝 Contributing

We love contributions! Here's how:

  1. 🍴 Fork it
  2. 🌿 Create your feature branch (git checkout -b feature/amazing)
  3. 🔧 Make your changes
  4. 🚀 Push to the branch (git push origin feature/amazing)
  5. 🎉 Open a PR

📘 Documentation

💬 Community & Support

📜 License

MIT © TCGdex

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

tcgdex_sdk-2.2.1.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

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

tcgdex_sdk-2.2.1-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file tcgdex_sdk-2.2.1.tar.gz.

File metadata

  • Download URL: tcgdex_sdk-2.2.1.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.26.0 CPython/3.13.7 Linux/6.11.0-1018-azure

File hashes

Hashes for tcgdex_sdk-2.2.1.tar.gz
Algorithm Hash digest
SHA256 f2d8df0db07e9457fb778c2700c5b87508a9124002a905e7ad19a76488b23e48
MD5 f95f95c2bd56d41e6b0597bdd0ec3856
BLAKE2b-256 f91bf57ece33e29e73264767b9d698cf2cb51e93bc1f59958b519b6ca0965722

See more details on using hashes here.

File details

Details for the file tcgdex_sdk-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: tcgdex_sdk-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.26.0 CPython/3.13.7 Linux/6.11.0-1018-azure

File hashes

Hashes for tcgdex_sdk-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09f7674bf2cd15c96f092e393d836a75260240cc74de3d5baea01ce9408e1f10
MD5 62315fe9ecd28749795d5d10337f8563
BLAKE2b-256 25017a47a642e09cfeb511af01cd41985a5f38a4a7c25baa5873fbb5ff268308

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