mtgdata 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mtgdata-0.2.2 → mtgdata-0.2.3}/PKG-INFO +1 -1
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtgdata/scryfall.py +13 -5
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtgdata.egg-info/PKG-INFO +1 -1
- {mtgdata-0.2.2 → mtgdata-0.2.3}/.github/ISSUE_TEMPLATE/bug-report.md +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/.github/ISSUE_TEMPLATE/feature-request.md +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/.github/ISSUE_TEMPLATE/question.md +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/.github/workflows/lint.yml +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/.github/workflows/python-publish.yml +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/.github/workflows/python-test.yml +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/.github/workflows/version-bump.yaml +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/.gitignore +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/.pre-commit-config.yaml +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/LICENSE.txt +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/README.md +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtg-vae.png +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtgdata/__init__.py +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtgdata/__main__.py +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtgdata/scryfall_convert.py +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtgdata/util/__init__.py +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtgdata/util/hdf5.py +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtgdata.egg-info/SOURCES.txt +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtgdata.egg-info/dependency_links.txt +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtgdata.egg-info/requires.txt +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/mtgdata.egg-info/top_level.txt +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/pyproject.toml +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/pytest.ini +0 -0
- {mtgdata-0.2.2 → mtgdata-0.2.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: mtgdata
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: MTG image dataset with automatic image scraping and conversion.
|
|
5
5
|
Author-email: Nathan Juraj Michlo <NathanJMichlo@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/nmichlo/mtg-dataset
|
|
@@ -38,8 +38,9 @@ import warnings
|
|
|
38
38
|
from datetime import datetime, timedelta
|
|
39
39
|
from enum import Enum
|
|
40
40
|
from pathlib import Path
|
|
41
|
-
from typing import Any, Callable, Iterator, Literal, TYPE_CHECKING
|
|
41
|
+
from typing import Any, Callable, Iterator, Literal, TYPE_CHECKING, Union
|
|
42
42
|
from typing import Tuple
|
|
43
|
+
from uuid import UUID
|
|
43
44
|
|
|
44
45
|
import duckdb
|
|
45
46
|
import pytz
|
|
@@ -155,8 +156,8 @@ _IMG_TYPE_SIZES_HWC: dict[ScryfallImageType, Tuple[int, int, int] | None] = {
|
|
|
155
156
|
@dataclasses.dataclass(frozen=True)
|
|
156
157
|
class ScryfallCardFace:
|
|
157
158
|
# query
|
|
158
|
-
id: str
|
|
159
|
-
oracle_id: str
|
|
159
|
+
id: Union[str, UUID]
|
|
160
|
+
oracle_id: Union[str, UUID]
|
|
160
161
|
name: str
|
|
161
162
|
set_code: str
|
|
162
163
|
set_name: str
|
|
@@ -175,9 +176,16 @@ class ScryfallCardFace:
|
|
|
175
176
|
def bulk_type(self) -> ScryfallBulkType:
|
|
176
177
|
return ScryfallBulkType(self._bulk_type)
|
|
177
178
|
|
|
179
|
+
@property
|
|
180
|
+
def uuid(self):
|
|
181
|
+
if isinstance(self.id, str):
|
|
182
|
+
return UUID(self.id)
|
|
183
|
+
else:
|
|
184
|
+
return self.id
|
|
185
|
+
|
|
178
186
|
@property
|
|
179
187
|
def img_path(self) -> Path:
|
|
180
|
-
return self._sets_dir / f"{self.set_code}/{self.
|
|
188
|
+
return self._sets_dir / f"{self.set_code}/{self.uuid}.{self.img_type.extension}"
|
|
181
189
|
|
|
182
190
|
@property
|
|
183
191
|
def url_path_pair(self) -> Tuple[str, str]:
|
|
@@ -528,7 +536,7 @@ class ScryfallDataset:
|
|
|
528
536
|
self._ondemand_dl = download_mode == "ondemand"
|
|
529
537
|
self._cards = list(self._ds.yield_all())
|
|
530
538
|
# sort cards
|
|
531
|
-
self._cards.sort(key=lambda x: x.
|
|
539
|
+
self._cards.sort(key=lambda x: x.uuid)
|
|
532
540
|
# init
|
|
533
541
|
self.transform = transform if transform else _noop
|
|
534
542
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: mtgdata
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: MTG image dataset with automatic image scraping and conversion.
|
|
5
5
|
Author-email: Nathan Juraj Michlo <NathanJMichlo@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/nmichlo/mtg-dataset
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|