add main_expansion field

main
beiyanpiki 1 year ago
parent 126ce4a9e1
commit 7971ea708b

@ -4,6 +4,7 @@
"symbol": "CSM1aC",
"release_date": "2022-10-28",
"series": "Sun & Moon",
"main_expansion": true,
"cards": [
{
"name": "\u98de\u5929\u87b3\u8782",
@ -9495,6 +9496,7 @@
"symbol": "CSM1bC",
"release_date": "2022-10-28",
"series": "Sun & Moon",
"main_expansion": true,
"cards": [
{
"name": "\u8d70\u8def\u8349",
@ -18551,6 +18553,7 @@
"symbol": "CSM1cC",
"release_date": "2022-10-28",
"series": "Sun & Moon",
"main_expansion": true,
"cards": [
{
"name": "\u963f\u7f57\u62c9 \u7a7f\u5c71\u9f20",
@ -27953,6 +27956,7 @@
"symbol": "CSM1DC",
"release_date": "2022-10-28",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u5999\u86d9\u79cd\u5b50",
@ -41971,6 +41975,7 @@
"symbol": "CSMLC",
"release_date": "2022-11-11",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u79d1\u65af\u83ab\u53e4",
@ -42201,6 +42206,7 @@
"symbol": "CSM1.5C",
"release_date": "2022-12-16",
"series": "Sun & Moon",
"main_expansion": true,
"cards": [
{
"name": "\u706b\u6591\u55b5",
@ -45744,6 +45750,7 @@
"symbol": "CSMYC",
"release_date": "2023-01-06",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u53f6\u4f0a\u5e03GX",
@ -46220,6 +46227,7 @@
"symbol": "CSM2DC",
"release_date": "2023-01-18",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u65f6\u62c9\u6bd4&\u5999\u86d9\u82b1GX",
@ -60869,6 +60877,7 @@
"symbol": "CSM2aC",
"release_date": "2023-01-18",
"series": "Sun & Moon",
"main_expansion": true,
"cards": [
{
"name": "\u76d6\u76d6\u866b",
@ -69746,6 +69755,7 @@
"symbol": "CSM2bC",
"release_date": "2023-01-18",
"series": "Sun & Moon",
"main_expansion": true,
"cards": [
{
"name": "\u65f6\u62c9\u6bd4&\u5999\u86d9\u82b1GX",
@ -78388,6 +78398,7 @@
"symbol": "CSM2cC",
"release_date": "2023-01-18",
"series": "Sun & Moon",
"main_expansion": true,
"cards": [
{
"name": "\u83b1\u5e0c\u62c9\u59c6&\u55b7\u706b\u9f99GX",
@ -87115,6 +87126,7 @@
"symbol": "CSMJC",
"release_date": "2023-03-17",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u95ea\u8000\u65f6\u62c9\u6bd4",
@ -87912,6 +87924,7 @@
"symbol": "CSM2.5C",
"release_date": "2023-03-17",
"series": "Sun & Moon",
"main_expansion": true,
"cards": [
{
"name": "\u5999\u86d9\u82b1&\u85e4\u85e4\u86c7GX",
@ -92219,6 +92232,7 @@
"symbol": "CSMAC",
"release_date": "2023-03-17",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u963f\u5c14\u5b99\u65af&\u5e1d\u7259\u5362\u5361&\u5e15\u8def\u5947\u4e9aGX",
@ -92845,6 +92859,7 @@
"symbol": "CSMPiC",
"release_date": "2023-04-15",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u53f6\u4f0a\u5e03GX",
@ -94627,6 +94642,7 @@
"symbol": "CSMPhC",
"release_date": "2023-04-15",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u5927\u5ca9\u86c7",
@ -95428,6 +95444,7 @@
"symbol": "CSMPgC",
"release_date": "2023-04-15",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u5e7c\u57fa\u62c9\u65af",
@ -96159,6 +96176,7 @@
"symbol": "CSMPfC",
"release_date": "2023-04-15",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u70c8\u54ac\u9646\u9ca8",
@ -96873,6 +96891,7 @@
"symbol": "CSMPeC",
"release_date": "2023-04-15",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u74e6\u65af\u5f39",
@ -97575,6 +97594,7 @@
"symbol": "CSMPdC",
"release_date": "2023-04-15",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u76ae\u5361\u4e18",
@ -98227,6 +98247,7 @@
"symbol": "CSMPcC",
"release_date": "2023-04-15",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u6c34\u7bad\u9f9f&\u6ce2\u52a0\u66fcGX",
@ -99040,6 +99061,7 @@
"symbol": "CSMPbC",
"release_date": "2023-04-15",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u55b7\u706b\u9f99&\u957f\u5c3e\u706b\u72d0GX",
@ -99828,6 +99850,7 @@
"symbol": "CSMPaC",
"release_date": "2023-04-15",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u5999\u86d9\u82b1&\u85e4\u85e4\u86c7GX",
@ -100577,6 +100600,7 @@
"symbol": "CSAC",
"release_date": "2023-05-19",
"series": "Sword & Shield",
"main_expansion": false,
"cards": [
{
"name": "\u8f70\u64c2\u91d1\u521a\u7329V",
@ -101521,6 +101545,7 @@
"symbol": "CS1DC",
"release_date": "2023-05-19",
"series": "Sword & Shield",
"main_expansion": false,
"cards": [
{
"name": "\u5999\u86d9\u82b1V",
@ -111281,6 +111306,7 @@
"symbol": "CS1bC",
"release_date": "2023-05-19",
"series": "Sword & Shield",
"main_expansion": true,
"cards": [
{
"name": "\u7eff\u6bdb\u866b",
@ -120399,6 +120425,7 @@
"symbol": "CS1aC",
"release_date": "2023-05-19",
"series": "Sword & Shield",
"main_expansion": true,
"cards": [
{
"name": "\u5f3a\u989a\u9e21\u6bcd\u866b",
@ -130290,6 +130317,7 @@
"symbol": "PROMO",
"release_date": "2023-06-18",
"series": "Sword & Shield",
"main_expansion": false,
"cards": [
{
"name": "\u739b\u4fd0",
@ -130336,6 +130364,7 @@
"symbol": "CS1.5C",
"release_date": "2023-06-28",
"series": "Sword & Shield",
"main_expansion": true,
"cards": [
{
"name": "\u7834\u7834\u8235\u8f6eV",
@ -134300,6 +134329,7 @@
"symbol": "CS2bC",
"release_date": "2023-08-18",
"series": "Sword & Shield",
"main_expansion": true,
"cards": [
{
"name": "\u4f3d\u52d2\u5c14 \u8fbe\u6469\u72d2\u72d2",
@ -140763,6 +140793,7 @@
"symbol": "CS2aC",
"release_date": "2023-08-18",
"series": "Sword & Shield",
"main_expansion": true,
"cards": [
{
"name": "\u72ec\u89d2\u866b",
@ -147380,6 +147411,7 @@
"symbol": "PROMO",
"release_date": "2023-08-18",
"series": "Sword & Shield",
"main_expansion": false,
"cards": [
{
"name": "\u55b7\u706b\u9f99VMAX",
@ -147444,6 +147476,7 @@
"symbol": "PROMO",
"release_date": "2023-08-18",
"series": "Sword & Shield",
"main_expansion": false,
"cards": [
{
"name": "\u55b7\u706b\u9f99VMAX",
@ -147508,6 +147541,7 @@
"symbol": "CSM2.1C",
"release_date": "2023-09-09",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u6c34\u8865\u4e01",
@ -148904,6 +148938,7 @@
"symbol": "SMP",
"release_date": "2022-10-27",
"series": "Sun & Moon",
"main_expansion": false,
"cards": [
{
"name": "\u8c22\u7c73",
@ -151698,6 +151733,7 @@
"symbol": "SVP",
"release_date": "2023-05-19",
"series": "Sword & Shield",
"main_expansion": false,
"cards": [
{
"name": "\u6bd2\u8537\u8587",

File diff suppressed because one or more lines are too long

@ -3,216 +3,252 @@
"name": "\u8865\u5145\u5305 \u6a2a\u7a7a\u51fa\u4e16 \u8d6b",
"symbol": "CSM1aC",
"release_date": "2022-10-28",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": true
},
{
"name": "\u8865\u5145\u5305 \u6a2a\u7a7a\u51fa\u4e16 \u82cd",
"symbol": "CSM1bC",
"release_date": "2022-10-28",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": true
},
{
"name": "\u8865\u5145\u5305 \u6a2a\u7a7a\u51fa\u4e16 \u6cfd",
"symbol": "CSM1cC",
"release_date": "2022-10-28",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": true
},
{
"name": "\u8d77\u59cb\u5361\u7ec4 \u6a2a\u7a7a\u51fa\u4e16GX",
"symbol": "CSM1DC",
"release_date": "2022-10-28",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u8389\u8389\u827e\u7684\u58f0\u63f4\u4e13\u5c5e\u793c\u76d2",
"symbol": "CSMLC",
"release_date": "2022-11-11",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5f3a\u5316\u5305 \u5bf9\u6218\u7cbe\u82f1",
"symbol": "CSM1.5C",
"release_date": "2022-12-16",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": true
},
{
"name": "\u4f0a\u5e03GX\u5957\u88c5\u793c\u76d2",
"symbol": "CSMYC",
"release_date": "2023-01-06",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u8d77\u59cb\u5361\u7ec4 \u4ea4\u76f8\u8f89\u6620GX",
"symbol": "CSM2DC",
"release_date": "2023-01-18",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u8865\u5145\u5305 \u4ea4\u76f8\u8f89\u6620 \u6c90",
"symbol": "CSM2aC",
"release_date": "2023-01-18",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": true
},
{
"name": "\u8865\u5145\u5305 \u4ea4\u76f8\u8f89\u6620 \u9b41",
"symbol": "CSM2bC",
"release_date": "2023-01-18",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": true
},
{
"name": "\u8865\u5145\u5305 \u4ea4\u76f8\u8f89\u6620 \u5524",
"symbol": "CSM2cC",
"release_date": "2023-01-18",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": true
},
{
"name": "\u7cbe\u7075\u7403\u793c\u76d2\uff1a\u95ea\u8000\u5b9d\u53ef\u68a6",
"symbol": "CSMJC",
"release_date": "2023-03-17",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5f3a\u5316\u5305 \u70ab\u5947\u4e89\u80dc",
"symbol": "CSM2.5C",
"release_date": "2023-03-17",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": true
},
{
"name": "\u963f\u5c14\u5b99\u65af&\u5e1d\u7259\u5362\u5361&\u5e15\u8def\u5947\u4e9aGX \u5361\u7ec4\u6784\u7b51\u8fdb\u9636\u793c\u76d2",
"symbol": "CSMAC",
"release_date": "2023-03-17",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5bf9\u6218\u6d3e\u5bf9\u7ec4\u5408 \u5956\u8d4f\u5305",
"symbol": "CSMPiC",
"release_date": "2023-04-15",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5bf9\u6218\u6d3e\u5bf9\u7ec4\u5408 \u94a2",
"symbol": "CSMPhC",
"release_date": "2023-04-15",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5bf9\u6218\u6d3e\u5bf9\u7ec4\u5408 \u6076",
"symbol": "CSMPgC",
"release_date": "2023-04-15",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5bf9\u6218\u6d3e\u5bf9\u7ec4\u5408 \u6597",
"symbol": "CSMPfC",
"release_date": "2023-04-15",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5bf9\u6218\u6d3e\u5bf9\u7ec4\u5408 \u8d85",
"symbol": "CSMPeC",
"release_date": "2023-04-15",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5bf9\u6218\u6d3e\u5bf9\u7ec4\u5408 \u96f7",
"symbol": "CSMPdC",
"release_date": "2023-04-15",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5bf9\u6218\u6d3e\u5bf9\u7ec4\u5408 \u6c34",
"symbol": "CSMPcC",
"release_date": "2023-04-15",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5bf9\u6218\u6d3e\u5bf9\u7ec4\u5408 \u706b",
"symbol": "CSMPbC",
"release_date": "2023-04-15",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5bf9\u6218\u6d3e\u5bf9\u7ec4\u5408 \u8349",
"symbol": "CSMPaC",
"release_date": "2023-04-15",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u6781\u5de8\u4e89\u950b \u5361\u7ec4\u6784\u7b51\u793c\u76d2",
"symbol": "CSAC",
"release_date": "2023-05-19",
"series": "Sword & Shield"
"series": "Sword & Shield",
"main_expansion": false
},
{
"name": "\u8d77\u59cb\u5361\u7ec4 \u6781\u5de8\u4e89\u950bV",
"symbol": "CS1DC",
"release_date": "2023-05-19",
"series": "Sword & Shield"
"series": "Sword & Shield",
"main_expansion": false
},
{
"name": "\u8865\u5145\u5305 \u6781\u5de8\u4e89\u950b \u7130",
"symbol": "CS1bC",
"release_date": "2023-05-19",
"series": "Sword & Shield"
"series": "Sword & Shield",
"main_expansion": true
},
{
"name": "\u8865\u5145\u5305 \u6781\u5de8\u4e89\u950b \u96f7",
"symbol": "CS1aC",
"release_date": "2023-05-19",
"series": "Sword & Shield"
"series": "Sword & Shield",
"main_expansion": true
},
{
"name": "\u739b\u4fd0\u7684\u51b3\u5fc3\u4e13\u5c5e\u793c\u76d2",
"symbol": "PROMO",
"release_date": "2023-06-18",
"series": "Sword & Shield"
"series": "Sword & Shield",
"main_expansion": false
},
{
"name": "\u5f3a\u5316\u5305 \u6781\u5de8\u653b\u9632",
"symbol": "CS1.5C",
"release_date": "2023-06-28",
"series": "Sword & Shield"
"series": "Sword & Shield",
"main_expansion": true
},
{
"name": "\u8865\u5145\u5305 \u6d53\u58a8\u91cd\u5f69 \u975b",
"symbol": "CS2bC",
"release_date": "2023-08-18",
"series": "Sword & Shield"
"series": "Sword & Shield",
"main_expansion": true
},
{
"name": "\u8865\u5145\u5305 \u6d53\u58a8\u91cd\u5f69 \u9ece",
"symbol": "CS2aC",
"release_date": "2023-08-18",
"series": "Sword & Shield"
"series": "Sword & Shield",
"main_expansion": true
},
{
"name": "\u55b7\u706b\u9f99VMAX\u5bf9\u6218\u5957\u88c5\u793c\u76d2",
"symbol": "PROMO",
"release_date": "2023-08-18",
"series": "Sword & Shield"
"series": "Sword & Shield",
"main_expansion": false
},
{
"name": "\u55b7\u706b\u9f99VMAX\u6536\u85cf\u5957\u88c5\u793c\u76d2",
"symbol": "PROMO",
"release_date": "2023-08-18",
"series": "Sword & Shield"
"series": "Sword & Shield",
"main_expansion": false
},
{
"name": "\u8f89\u91d1\u80fd\u91cf\u793c\u76d2&\u8f89\u91d1\u80fd\u91cf\u8fdb\u9636\u793c\u76d2",
"symbol": "CSM2.1C",
"release_date": "2023-09-09",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u592a\u9633&\u6708\u4eae \u7279\u5178\u5361",
"symbol": "SMP",
"release_date": "2022-10-27",
"series": "Sun & Moon"
"series": "Sun & Moon",
"main_expansion": false
},
{
"name": "\u5251&\u76fe \u7279\u5178\u5361",
"symbol": "SVP",
"release_date": "2023-05-19",
"series": "Sword & Shield"
"series": "Sword & Shield",
"main_expansion": false
}
]

File diff suppressed because one or more lines are too long

@ -10,8 +10,8 @@ class Series(Enum):
class SetType(Enum):
MainExpansion = '0'
SideProduct = '1'
MainExpansion = 0
SideProduct = 1
class CardType(Enum):
@ -322,6 +322,7 @@ class PSet:
release_date: Optional[str]
series: Series
cards: List[Card]
set_type: SetType
def __init__(self, name: str, symbol: str, release_date: Optional[str],
series_id: Series) -> None:
@ -331,12 +332,23 @@ class PSet:
self.series = series_id
self.cards = []
if symbol in [
# SM
'CSM1aC', 'CSM1bC', 'CSM1cC', 'CSM1.5C', 'CSM2aC', 'CSM2bC', 'CSM2cC', 'CSM2.5C',
# SS
'CS1aC', 'CS1bC', 'CS1.5C', 'CS2aC', 'CS2bC'
]:
self.set_type = SetType.MainExpansion
else:
self.set_type = SetType.SideProduct
def __json__(self):
data = {
'name': self.name,
'symbol': self.symbol,
'release_date': self.release_date,
'series': self.series.value,
'main_expansion': self.set_type == SetType.MainExpansion,
'cards': [card.__json__() for card in self.cards]
}
if len(data['cards']) == 0:

Loading…
Cancel
Save