spells-mtg 0.0.3__tar.gz → 0.1.0__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.
Potentially problematic release.
This version of spells-mtg might be problematic. Click here for more details.
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/PKG-INFO +8 -6
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/README.md +7 -5
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/pyproject.toml +1 -1
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/spells/cache.py +1 -3
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/spells/cards.py +3 -1
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/spells/external.py +3 -1
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/LICENSE +0 -0
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/spells/__init__.py +0 -0
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/spells/columns.py +0 -0
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/spells/draft_data.py +0 -0
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/spells/enums.py +0 -0
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/spells/filter.py +0 -0
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/spells/manifest.py +0 -0
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/spells/schema.py +0 -0
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/tests/__init__.py +0 -0
- {spells_mtg-0.0.3 → spells_mtg-0.1.0}/tests/filter_test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: spells-mtg
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: analaysis of 17Lands.com public datasets
|
|
5
5
|
Author-Email: Joel Barnes <oelarnes@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -69,7 +69,7 @@ Spells is not affiliated with 17Lands. Please review the Usage Guidelines for 17
|
|
|
69
69
|
## spells
|
|
70
70
|
|
|
71
71
|
- Uses [Polars](https://docs.pola.rs/) for high-performance, multi-threaded aggregations of large datasets
|
|
72
|
-
- Uses Polars to power an expressive query language for specifying custom extensions
|
|
72
|
+
- Uses Polars to power an expressive query language for specifying custom extensions
|
|
73
73
|
- Converts csv datasets to parquet for 10x faster calculations and 20x smaller file sizes
|
|
74
74
|
- Supports calculating the standard aggregations and measures out of the box with no arguments (ALSA, GIH WR, etc)
|
|
75
75
|
- Caches aggregate DataFrames in the local file system automatically for instantaneous reproduction of previous analysis
|
|
@@ -78,10 +78,11 @@ Spells is not affiliated with 17Lands. Please review the Usage Guidelines for 17
|
|
|
78
78
|
- Supports "Deck Color Data" aggregations with built-in column definitions.
|
|
79
79
|
- Provides a CLI tool `spells [add|refresh|clean|remove|info] [SET]` to download and manage external files
|
|
80
80
|
- Downloads and manages public datasets from 17Lands
|
|
81
|
-
-
|
|
81
|
+
- Retrieves and models booster configuration and card data from [MTGJSON](https://mtgjson.com/)
|
|
82
82
|
- Is fully typed, linted, and statically analyzed for support of advanced IDE features
|
|
83
83
|
- Provides optional enums for all base columns and built-in extensions, as well as for custom extension parameters
|
|
84
84
|
- Uses Polars expressions to support second-stage aggregations and beyond like game-weighted z-scores with one call to summon
|
|
85
|
+
- Tested on MacOS, Linux, and Windows
|
|
85
86
|
|
|
86
87
|
## summon
|
|
87
88
|
|
|
@@ -208,7 +209,7 @@ Spells provides several features out of the box to optimize performance to the d
|
|
|
208
209
|
|
|
209
210
|
### Parquet Transformation
|
|
210
211
|
|
|
211
|
-
The most significant optimization used by Spells is the simplest: the csv files are scanned and streamed to Parquet files by Polars. This allows 10x faster compute times with 20x less storage space and lower memory usage compared to csv. Yes,
|
|
212
|
+
The most significant optimization used by Spells is the simplest: the csv files are scanned and streamed to Parquet files by Polars. This allows 10x faster compute times with 20x less storage space and lower memory usage compared to csv. Yes, it's twenty times smaller and ten times faster!
|
|
212
213
|
|
|
213
214
|
### Query Optimization
|
|
214
215
|
|
|
@@ -249,7 +250,7 @@ So that's it, that's what Spells does from a high level. `summon` will hand off
|
|
|
249
250
|
|
|
250
251
|
Spells includes a command-line interface `spells` to manage your external data files and local cache. Spells will download files to an appropriate file location on your system,
|
|
251
252
|
typically `~/.local/share/spells` on Unix-like platforms and `C:\Users\{Username}\AppData\Local\Spells` on Windows.
|
|
252
|
-
To use `spells`, make sure Spells in installed in your environment using pip or a package manager, and type `spells help` into your shell, or dive in with `spells add DSK` or your favorite set.
|
|
253
|
+
To use `spells`, make sure Spells in installed in your environment using pip or a package manager, and type `spells help` into your shell, or dive in with `spells add DSK` or your favorite set. If Spells is installed globally using pipx, any local version of Spells will be able to read the managed files.
|
|
253
254
|
|
|
254
255
|
## API
|
|
255
256
|
|
|
@@ -268,7 +269,7 @@ summon(
|
|
|
268
269
|
|
|
269
270
|
#### parameters
|
|
270
271
|
|
|
271
|
-
- columns: a list of string or `ColName` values to select as non-grouped columns. Valid `ColTypes` are `PICK_SUM`, `NAME_SUM`, `GAME_SUM`, `CARD_ATTR`,
|
|
272
|
+
- columns: a list of string or `ColName` values to select as non-grouped columns. Valid `ColTypes` are `PICK_SUM`, `NAME_SUM`, `GAME_SUM`, `CARD_ATTR`, and `AGG`. Min/Max/Unique
|
|
272
273
|
aggregations of non-numeric (or numeric) data types are not supported. If `None`, use a set of columns modeled on the commonly used values on 17Lands.com/card_data.
|
|
273
274
|
|
|
274
275
|
- group_by: a list of string or `ColName` values to display as grouped columns. Valid `ColTypes` are `GROUP_BY` and `CARD_ATTR`. By default, group by "name" (card name).
|
|
@@ -452,6 +453,7 @@ A table of all included columns. Columns can be referenced by enum or by string
|
|
|
452
453
|
# Roadmap to 1.0
|
|
453
454
|
|
|
454
455
|
- [ ] Support Traditional and Premier datasets (currently only Premier is supported)
|
|
456
|
+
- [ ] Group by all
|
|
455
457
|
- [ ] Enable configuration using $XDG_CONFIG_HOME/cfg.toml
|
|
456
458
|
- [ ] Support min and max aggregations over base views
|
|
457
459
|
- [ ] Enhanced profiling
|
|
@@ -58,7 +58,7 @@ Spells is not affiliated with 17Lands. Please review the Usage Guidelines for 17
|
|
|
58
58
|
## spells
|
|
59
59
|
|
|
60
60
|
- Uses [Polars](https://docs.pola.rs/) for high-performance, multi-threaded aggregations of large datasets
|
|
61
|
-
- Uses Polars to power an expressive query language for specifying custom extensions
|
|
61
|
+
- Uses Polars to power an expressive query language for specifying custom extensions
|
|
62
62
|
- Converts csv datasets to parquet for 10x faster calculations and 20x smaller file sizes
|
|
63
63
|
- Supports calculating the standard aggregations and measures out of the box with no arguments (ALSA, GIH WR, etc)
|
|
64
64
|
- Caches aggregate DataFrames in the local file system automatically for instantaneous reproduction of previous analysis
|
|
@@ -67,10 +67,11 @@ Spells is not affiliated with 17Lands. Please review the Usage Guidelines for 17
|
|
|
67
67
|
- Supports "Deck Color Data" aggregations with built-in column definitions.
|
|
68
68
|
- Provides a CLI tool `spells [add|refresh|clean|remove|info] [SET]` to download and manage external files
|
|
69
69
|
- Downloads and manages public datasets from 17Lands
|
|
70
|
-
-
|
|
70
|
+
- Retrieves and models booster configuration and card data from [MTGJSON](https://mtgjson.com/)
|
|
71
71
|
- Is fully typed, linted, and statically analyzed for support of advanced IDE features
|
|
72
72
|
- Provides optional enums for all base columns and built-in extensions, as well as for custom extension parameters
|
|
73
73
|
- Uses Polars expressions to support second-stage aggregations and beyond like game-weighted z-scores with one call to summon
|
|
74
|
+
- Tested on MacOS, Linux, and Windows
|
|
74
75
|
|
|
75
76
|
## summon
|
|
76
77
|
|
|
@@ -197,7 +198,7 @@ Spells provides several features out of the box to optimize performance to the d
|
|
|
197
198
|
|
|
198
199
|
### Parquet Transformation
|
|
199
200
|
|
|
200
|
-
The most significant optimization used by Spells is the simplest: the csv files are scanned and streamed to Parquet files by Polars. This allows 10x faster compute times with 20x less storage space and lower memory usage compared to csv. Yes,
|
|
201
|
+
The most significant optimization used by Spells is the simplest: the csv files are scanned and streamed to Parquet files by Polars. This allows 10x faster compute times with 20x less storage space and lower memory usage compared to csv. Yes, it's twenty times smaller and ten times faster!
|
|
201
202
|
|
|
202
203
|
### Query Optimization
|
|
203
204
|
|
|
@@ -238,7 +239,7 @@ So that's it, that's what Spells does from a high level. `summon` will hand off
|
|
|
238
239
|
|
|
239
240
|
Spells includes a command-line interface `spells` to manage your external data files and local cache. Spells will download files to an appropriate file location on your system,
|
|
240
241
|
typically `~/.local/share/spells` on Unix-like platforms and `C:\Users\{Username}\AppData\Local\Spells` on Windows.
|
|
241
|
-
To use `spells`, make sure Spells in installed in your environment using pip or a package manager, and type `spells help` into your shell, or dive in with `spells add DSK` or your favorite set.
|
|
242
|
+
To use `spells`, make sure Spells in installed in your environment using pip or a package manager, and type `spells help` into your shell, or dive in with `spells add DSK` or your favorite set. If Spells is installed globally using pipx, any local version of Spells will be able to read the managed files.
|
|
242
243
|
|
|
243
244
|
## API
|
|
244
245
|
|
|
@@ -257,7 +258,7 @@ summon(
|
|
|
257
258
|
|
|
258
259
|
#### parameters
|
|
259
260
|
|
|
260
|
-
- columns: a list of string or `ColName` values to select as non-grouped columns. Valid `ColTypes` are `PICK_SUM`, `NAME_SUM`, `GAME_SUM`, `CARD_ATTR`,
|
|
261
|
+
- columns: a list of string or `ColName` values to select as non-grouped columns. Valid `ColTypes` are `PICK_SUM`, `NAME_SUM`, `GAME_SUM`, `CARD_ATTR`, and `AGG`. Min/Max/Unique
|
|
261
262
|
aggregations of non-numeric (or numeric) data types are not supported. If `None`, use a set of columns modeled on the commonly used values on 17Lands.com/card_data.
|
|
262
263
|
|
|
263
264
|
- group_by: a list of string or `ColName` values to display as grouped columns. Valid `ColTypes` are `GROUP_BY` and `CARD_ATTR`. By default, group by "name" (card name).
|
|
@@ -441,6 +442,7 @@ A table of all included columns. Columns can be referenced by enum or by string
|
|
|
441
442
|
# Roadmap to 1.0
|
|
442
443
|
|
|
443
444
|
- [ ] Support Traditional and Premier datasets (currently only Premier is supported)
|
|
445
|
+
- [ ] Group by all
|
|
444
446
|
- [ ] Enable configuration using $XDG_CONFIG_HOME/cfg.toml
|
|
445
447
|
- [ ] Support min and max aggregations over base views
|
|
446
448
|
- [ ] Enhanced profiling
|
|
@@ -30,9 +30,7 @@ def data_home() -> str:
|
|
|
30
30
|
"SPELLS_DATA_HOME",
|
|
31
31
|
os.environ.get(
|
|
32
32
|
"XDG_DATA_HOME",
|
|
33
|
-
r"
|
|
34
|
-
if is_win
|
|
35
|
-
else "~/.local/share/spells/",
|
|
33
|
+
r"~\AppData\Local\Spells" if is_win else "~/.local/share/spells/",
|
|
36
34
|
),
|
|
37
35
|
)
|
|
38
36
|
)
|
|
@@ -88,7 +88,9 @@ def card_df(draft_set_code: str, names: list[str]) -> pl.DataFrame:
|
|
|
88
88
|
return pl.DataFrame(
|
|
89
89
|
[
|
|
90
90
|
{
|
|
91
|
-
field: _extract_value(
|
|
91
|
+
field: _extract_value(
|
|
92
|
+
draft_set_code, name, card_data_map.get(name, {}), field
|
|
93
|
+
)
|
|
92
94
|
for field in CardAttr
|
|
93
95
|
}
|
|
94
96
|
for name in names
|
|
@@ -264,7 +264,9 @@ def download_data_set(
|
|
|
264
264
|
)
|
|
265
265
|
print()
|
|
266
266
|
|
|
267
|
-
cache.spells_print(
|
|
267
|
+
cache.spells_print(
|
|
268
|
+
mode, "Unzipping and transforming to parquet (this might take a few minutes)..."
|
|
269
|
+
)
|
|
268
270
|
_process_zipped_file(dataset_path, target_path)
|
|
269
271
|
cache.spells_print(mode, f"File {target_path} written")
|
|
270
272
|
if clear_set_cache:
|
|
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
|