Skip to content

Commit 46a239a

Browse files
feat(set): add new abbreviations field with the supported languages (#22)
Co-authored-by: Avior <github@avior.me>
1 parent 27fbae5 commit 46a239a

2 files changed

Lines changed: 48 additions & 5 deletions

File tree

src/tcgdexsdk/models/Set.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from tcgdexsdk.models.CardResume import CardResume
88
from tcgdexsdk.models.Model import Model
99
from tcgdexsdk.models.SerieResume import SerieResume
10-
from tcgdexsdk.models.subs import Booster, Legal, SetCardCountResume
10+
from tcgdexsdk.models.subs import Booster, Legal, SetAbbreviations, SetCardCountResume
1111

1212

1313
@dataclass
@@ -37,6 +37,8 @@ class Set(Model):
3737
"""the cards contained in this set"""
3838
boosters: Optional[List[Booster]]
3939
"""The list of booster the set has"""
40+
abbreviations: Optional[SetAbbreviations]
41+
"""The set abbreviations (official and in other languages if available)"""
4042

4143
def get_logo_url(self, extension: Union[str, Extension]) -> Optional[str]:
4244
"""
@@ -65,9 +67,7 @@ def get_symbol_url(self, extension: Union[str, Extension]) -> Optional[str]:
6567
if self.symbol:
6668
return f"{self.symbol}.{extension}"
6769

68-
def get_symbol(
69-
self, format: Union[str, Extension]
70-
) -> Optional[HTTPResponse]:
70+
def get_symbol(self, format: Union[str, Extension]) -> Optional[HTTPResponse]:
7171
"""
7272
Get the symbol buffer
7373
@param format: the image format

src/tcgdexsdk/models/subs.py

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class SetCardCount:
9393
"""number of cards having an holo version"""
9494
firstEd: Optional[int]
9595
"""Number of possible cards"""
96-
96+
97+
9798
@dataclass
9899
class Booster:
99100
id: str
@@ -111,3 +112,45 @@ class SetCardCountResume:
111112
"""total of number of cards"""
112113
official: int
113114
"""number of cards officialy (on the bottom of each cards)"""
115+
116+
117+
@dataclass
118+
class SetAbbreviations:
119+
"""Set abbreviations"""
120+
121+
official: Optional[str]
122+
"""Official abbreviation acronym used on the cards (English version)"""
123+
fr: Optional[str]
124+
"""French abbreviation acronym used on the cards"""
125+
es: Optional[str]
126+
"""Spanish abbreviation acronym used on the cards"""
127+
es_mx: Optional[str]
128+
"""Spanish (Mexico) abbreviation acronym used on the cards"""
129+
it: Optional[str]
130+
"""Italian abbreviation acronym used on the cards"""
131+
pt: Optional[str]
132+
"""Portuguese abbreviation acronym used on the cards"""
133+
pt_br: Optional[str]
134+
"""Portuguese (Brazil) abbreviation acronym used on the cards"""
135+
pt_pt: Optional[str]
136+
"""Portuguese (Portugal) abbreviation acronym used on the cards"""
137+
de: Optional[str]
138+
"""German abbreviation acronym used on the cards"""
139+
nl: Optional[str]
140+
"""Dutch abbreviation acronym used on the cards"""
141+
pl: Optional[str]
142+
"""Polish abbreviation acronym used on the cards"""
143+
ru: Optional[str]
144+
"""Russian abbreviation acronym used on the cards"""
145+
ja: Optional[str]
146+
"""Japanese abbreviation acronym used on the cards"""
147+
ko: Optional[str]
148+
"""Korean abbreviation acronym used on the cards"""
149+
zh_tw: Optional[str]
150+
"""Chinese (Taiwan) abbreviation acronym used on the cards"""
151+
id: Optional[str]
152+
"""Indonesian abbreviation acronym used on the cards"""
153+
th: Optional[str]
154+
"""Thai abbreviation acronym used on the cards"""
155+
zh_cn: Optional[str]
156+
"""Chinese (China) abbreviation acronym used on the cards"""

0 commit comments

Comments
 (0)