Skip to main content

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

Release files for tcgdex-sdk 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tcgdex-sdk 2.3.0
File Size Uploaded
tcgdex_sdk-2.3.0.tar.gz 3.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for tcgdex-sdk 2.3.0
File Interpreter ABI Platform
tcgdex_sdk-2.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.6 MB

Release files / tcgdex_sdk-2.3.0.tar.gz

Download URL tcgdex_sdk-2.3.0.tar.gz
Size 3.6 MB
Tags Source
SHA-256 checksum
How to use checksums
fb6b38d40c1851e5b314ac098dc8fc8dc83b1f180a42254f253afa9d174a6034
BLAKE2b-256 checksum
How to use checksums
4f313d4a15620c694b5b24dd525e2978b6d02ddeaf1fc798f009aa2ca062ca9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.26.7 CPython/3.13.12 Linux/6.17.0-1010-azure

Release files / tcgdex_sdk-2.3.0-py3-none-any.whl

Download URL tcgdex_sdk-2.3.0-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee6acea796c112ca68c3323d14a7fa14981e76514423497b30271ca53d4accc3
BLAKE2b-256 checksum
How to use checksums
293d9bdf9c825af4cae502c1a38e9d5c6470a5f9f5e6eb7163ef45d5e84c7ca9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.26.7 CPython/3.13.12 Linux/6.17.0-1010-azure

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

0.2.1

2 release files

0.1.0

2 release 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