A fast, type-safe Python SDK for the TCGdex API. Query Pokémon Trading Card Game data easily. 🚀
fromtcgdexsdkimportTCGdex# Fetch a card in one linecard=awaitTCGdex().card.get("swsh3-136")
card=TCGdex().card.getSync("swsh3-136")
print(f"Found: {card.name} ({card.localId}/{card.set.cardCount.total})")pip install tcgdex-sdk- 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)
sdk=TCGdex("en")
# Get the cards made by the illustratorcards=awaitsdk.illustrator.get("5ban Graphics")
cards=sdk.illustrator.getSync("5ban Graphics")
# Get the data about the Sword & Shield serie by IDseries=awaitsdk.serie.get("swsh")
series=sdk.serie.getSync("swsh")
# Get all cards with 110 HPhp_cards=awaitsdk.hp.get("110")
hp_cards=sdk.hp.getSync("110")
# List all available raritiesrarities=awaitsdk.rarity.list()
rarities=sdk.rarity.listSync()
# List all cards with the name being "Furret"rarities=awaitsdk.card.list(Query().equal("name", "Furret"))
rarities=sdk.card.listSync(Query().equal("name", "Furret"))# Get set detailsdarkness_ablaze=awaitsdk.set.get("Darkness Ablaze")
# darkness_ablaze = sdk.set.getSync("Darkness Ablaze")print(f"Set: {darkness_ablaze.name} ({darkness_ablaze.cardCount.total} cards)")
# Get series infoswsh=awaitsdk.serie.get("swsh")
# swsh = sdk.serie.getSync("swsh")print(f"Series: {swsh.name} ({len(swsh.sets)} sets)")sdk.card# Core card datasdk.rarity# Card raritiessdk.hp# HP valuessdk.illustrator# Card illustratorssdk.type# Pokémon typessdk.energyType# Energy typessdk.retreat# Retreat costssdk.stage# Evolution stagessdk.variant# Card variantssdk.suffix# Card suffixessdk.regulationMark# Regulation markssdk.dexId# Pokédex IDssdk.set# Card setssdk.serie# Card seriesfromtcgdexsdkimportTCGdex, Language# Using stringsdk=TCGdex("en") # Englishsdk=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 languagesdk.setLanguage(Language.FR)
# orsdk.setLanguage("fr")full list of languages available here
__
We love contributions! Here's how:
- 🍴 Fork it
- 🌿 Create your feature branch (
git checkout -b feature/amazing) - 🔧 Make your changes
- 🚀 Push to the branch (
git push origin feature/amazing) - 🎉 Open a PR
- Discord Server - Get help and discuss features
- GitHub Issues - Bug reports and feature requests
MIT © TCGdex
