Skip to content

Commit 0b9dca3

Browse files
authored
chore: make README more up to date (#7)
1 parent a621da4 commit 0b9dca3

File tree

2 files changed

+116
-53
lines changed

2 files changed

+116
-53
lines changed

README.md

Lines changed: 113 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<img src="https://img.shields.io/github/stars/tcgdex/python-sdk?style=flat-square" alt="Github stars">
1515
</a>
1616
<a href="https://github.com/tcgdex/python-sdk/actions/workflows/build.yml">
17-
<img src="https://img.shields.io/github/actions/workflow/status/tcgdex/python-sdk/build.yml?style=flat-square" alt="the TCGdex Python SDK is released under the MIT license." />
17+
<img src="https://img.shields.io/github/actions/workflow/status/tcgdex/python-sdk/build.yml?style=flat-square" alt="Build Status" />
1818
</a>
1919
<a href="https://discord.gg/peACSRMZ7V">
2020
<img src="https://img.shields.io/discord/857231041261076491?color=%235865F2&label=Discord&style=flat-square" alt="Discord Link">
@@ -23,86 +23,149 @@
2323

2424
# TCGdex Python SDK
2525

26-
The TCGdex Python SDK provides a convenient access with the Open Source TCGdex API.
26+
A fast, type-safe Python SDK for the TCGdex API. Query Pokémon Trading Card Game data easily. 🚀
2727

28-
_The full API/SDK documentation is available at [API Documentation - TCGdex](https://www.tcgdex.dev)_
29-
30-
### Getting Started
28+
```python
29+
from tcgdexsdk import TCGdex
3130

32-
#### How To install
31+
# Fetch a card in one line
32+
card = await TCGdex().card.get("swsh3-136")
33+
card = await TCGdex().card.getSync("swsh3-136")
34+
print(f"Found: {card.name} ({card.localId}/{card.set.cardCount.total})")
35+
```
3336

34-
run the following command:
37+
## ⚡️ Quick Install
3538

3639
```bash
3740
pip install tcgdex-sdk
3841
```
3942

40-
#### Getting Started
43+
## 🚀 Features
4144

42-
**Example: Fetch a Card**
45+
- **Type-Safe**: Full typing support for better IDE integration
46+
- **Async/Await**: Built for modern Python applications and compatible with synchronous operations
47+
- **Zero Config**: Works out of the box
48+
- **Multi-Language**: Support for English, French, German, Japanese, Chinese, [and more](https://github.com/tcgdex/cards-database/blob/master/interfaces.d.ts#L1-L5)
49+
- **Rich Data**: Access cards, sets, series, rarities, and more
50+
- **Lightweight**: Minimal dependencies (only [dacite](https://github.com/konradhalas/dacite))
51+
52+
## 🎯 Quick Examples
53+
54+
### Find Cards by Various Criteria
4355

4456
```python
45-
from tcgdexsdk import TCGdex
57+
sdk = TCGdex("en")
4658

47-
tcgdex = TCGdex("en") # You can also use `Language.EN` TCGdex(Language.EN)
48-
res = await tcgdex.card.get("swsh1-136")
59+
# Get the cards made by the illustrator
60+
cards = await sdk.illustrator.get("5ban Graphics")
61+
cards = await sdk.illustrator.getSync("5ban Graphics")
62+
63+
# Get the data about the Sword & Shield serie by ID
64+
series = await sdk.serie.get("swsh")
65+
series = await sdk.serie.getSync("swsh")
66+
67+
# Get all cards with 110 HP
68+
hp_cards = await sdk.hp.get("110")
69+
hp_cards = await sdk.hp.getSync("110")
70+
71+
# List all available rarities
72+
rarities = await sdk.rarity.list()
73+
rarities = await sdk.rarity.listSync()
74+
75+
# List all cards with the name being "Furret"
76+
rarities = await sdk.card.list(Query().equal("name", "Furret"))
77+
rarities = await sdk.card.listSync(Query().equal("name", "Furret"))
4978
```
5079

51-
**Other Examples**
80+
### Working with Sets and Series
5281

5382
```python
54-
# fetch a Set using the set's name or ID
55-
await tcgdex.set.get('Darkness Ablaze')
83+
# Get set details
84+
darkness_ablaze = await sdk.set.get("Darkness Ablaze")
85+
# darkness_ablaze = await sdk.set.getSync("Darkness Ablaze")
86+
print(f"Set: {darkness_ablaze.name} ({darkness_ablaze.cardCount.total} cards)")
87+
88+
# Get series info
89+
swsh = await sdk.serie.get("swsh")
90+
# swsh = await sdk.serie.getSync("swsh")
91+
print(f"Series: {swsh.name} ({len(swsh.sets)} sets)")
92+
```
5693

57-
# Fetch a serie using the serie's name or ID
58-
await tcgdex.serie.get('Sword & Shield')
94+
## 🛠 Available Endpoints
5995

60-
# Fetch cards possible pokemon cards HP
61-
await tcgdex.hp.list()
96+
### Card Data
97+
```python
98+
sdk.card # Core card data
99+
sdk.rarity # Card rarities
100+
sdk.hp # HP values
101+
sdk.illustrator # Card illustrators
102+
```
62103

63-
# Fetch Cards with the specific number of HP
64-
await tcgdex.hp.get('110')
104+
### Game Mechanics
105+
```python
106+
sdk.type # Pokémon types
107+
sdk.energyType # Energy types
108+
sdk.retreat # Retreat costs
109+
sdk.stage # Evolution stages
110+
```
65111

66-
# Fetch cards possible illustrators
67-
await tcgdex.illustrator.list()
112+
### Card Details
113+
```python
114+
sdk.variant # Card variants
115+
sdk.suffix # Card suffixes
116+
sdk.regulationMark # Regulation marks
117+
sdk.dexId # Pokédex IDs
118+
```
68119

69-
# Fetch Cards with the specific illustrator
70-
await tcgdex.illustrator.get('tetsuya koizumi')
120+
### Collections
121+
```python
122+
sdk.set # Card sets
123+
sdk.serie # Card series
71124
```
72125

73-
**Other Endpoints**
126+
## 🌐 Language Support
127+
128+
```python
129+
from tcgdexsdk import TCGdex, Language
130+
131+
# Using string
132+
sdk = TCGdex("en") # English
133+
sdk = TCGdex("fr") # French
134+
135+
# Using enum (type-safe)
136+
sdk = TCGdex(Language.EN)
137+
sdk = TCGdex(Language.FR)
138+
139+
# After creating the instance you can change at any time the language
140+
sdk.setLanguage(Language.FR)
141+
# or
142+
sdk.setLanguage("fr")
143+
```
74144

75-
Every endpoints below work just like the ones above
76-
- a function `list` to get the list of elements
77-
- a function `get` to get details on the element
145+
_[full list of languages available here](https://github.com/tcgdex/cards-database/blob/master/interfaces.d.ts#L1-L5)_
78146

79-
- `variant`: fetch by the variants
80-
- `trainerType`: fetch trainer cards types
81-
- `suffix`: fetch differents cards suffixes
82-
- `stage`: fetch differents cards stages
83-
- `regulationMark`: Fetch by the regulation mark (letter at the bottom of the card)
84-
- `energyType`: Fetch different types of energies
85-
- `dexId`: fetch pokemon Global Pokédex IDS
86-
- `type`: fetch the cards using the Pokémon type(s)
87-
- `retreat`: fetch the cards using the retreat count
88-
- `rarity`: fetch the cards rarities
89-
- `illustrator`: fetch all the cards illustrators
90-
- `hp`: fetch the different cards possible HPs
91-
- `category`: the different cards categories
147+
__
92148

149+
## 🤝 Contributing
93150

94-
## Contributing
151+
We love contributions! Here's how:
95152

96-
See [CONTRIBUTING.md](https://github.com/tcgdex/python-sdk/blob/master/CONTRIBUTING.md)
153+
1. 🍴 Fork it
154+
2. 🌿 Create your feature branch (`git checkout -b feature/amazing`)
155+
3. 🔧 Make your changes
156+
4. 🚀 Push to the branch (`git push origin feature/amazing`)
157+
5. 🎉 Open a PR
97158

98-
TL::DR
159+
## 📘 Documentation
99160

100-
- Fork
161+
- [Full API Documentation](https://www.tcgdex.dev)
162+
- [Python SDK Guide](https://www.tcgdex.dev/sdks/python)
101163

102-
- Commit your changes
164+
## 💬 Community & Support
103165

104-
- Pull Request on this Repository
166+
- [Discord Server](https://discord.gg/peACSRMZ7V) - Get help and discuss features
167+
- [GitHub Issues](https://github.com/tcgdex/python-sdk/issues) - Bug reports and feature requests
105168

106-
## License
169+
## 📜 License
107170

108-
This project is licensed under the MIT License. A copy of the license is available at [LICENSE.md](https://github.com/tcgdex/python-sdk/blob/master/LICENSE.md)
171+
MIT © [TCGdex](https://github.com/tcgdex)

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name = "tcgdex-sdk"
44
# version = "0.0.0"
55
dynamic = ["version"]
6-
description = "The TCGdex Python SDK provides a convenient access to the Open Source TCGdex API."
6+
description = "A fast, type-safe Python SDK for the TCGdex API. Query Pokémon Trading Card Game data easily. 🚀"
77
authors = [{ name = "HellLord77" }, { name = "Avior", email = "[email protected]" }]
88
dependencies = ["dacite<2.0.0,>=1.8.1"]
99
requires-python = ">=3.8"
@@ -26,12 +26,12 @@ classifiers = [
2626
]
2727

2828
[project.urls]
29-
homepage = "https://tcgdex.dev"
29+
homepage = "https://tcgdex.dev/sdks/python"
3030
source = "https://github.com/tcgdex/python-sdk"
3131
download = "https://github.com/tcgdex/python-sdk/releases/latest"
3232
changelog = "https://github.com/tcgdex/python-sdk/releases/latest"
3333
releasenotes = "https://github.com/tcgdex/python-sdk/releases/latest"
34-
documentation = "https://tcgdex.dev"
34+
documentation = "https://tcgdex.dev/sdks/python"
3535
issues = "https://github.com/tcgdex/python-sdk/issues"
3636
funding = "https://github.com/sponsors/tcgdex"
3737

0 commit comments

Comments
 (0)