mtg-ssm 2.6.8.dev4__tar.gz → 2.6.9__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.
Files changed (67) hide show
  1. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/.github/workflows/run-tests.yml +2 -2
  2. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/PKG-INFO +18 -2
  3. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/README.rst +17 -1
  4. mtg_ssm-2.6.9/TODO.md +8 -0
  5. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/_version.py +2 -2
  6. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/containers/indexes.py +4 -6
  7. mtg_ssm-2.6.9/mtg_ssm/mtg/util.py +26 -0
  8. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/scryfall/models.py +1 -0
  9. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm.egg-info/PKG-INFO +18 -2
  10. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/containers/test_indexes.py +9 -0
  11. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/data/bulk_data.json +2 -2
  12. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/data/cards.json +1267 -633
  13. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/data/sets.json +59 -42
  14. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/data/sets1.json +21 -21
  15. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/data/sets2.json +38 -21
  16. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/gen_testdata.py +5 -4
  17. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/mtg/test_util.py +15 -21
  18. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/scryfall/test_fetcher.py +1 -1
  19. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/serialization/__snapshots__/test_xlsx.ambr +42 -42
  20. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/serialization/test_csv.py +2 -2
  21. mtg_ssm-2.6.8.dev4/TODO.md +0 -11
  22. mtg_ssm-2.6.8.dev4/mtg_ssm/mtg/util.py +0 -34
  23. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/.editorconfig +0 -0
  24. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/.github/dependabot.yml +0 -0
  25. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/.github/workflows/integration.yml +0 -0
  26. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/.github/workflows/pre-commit.yml +0 -0
  27. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/.github/workflows/publish.yml +0 -0
  28. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/.gitignore +0 -0
  29. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/.pre-commit-config.yaml +0 -0
  30. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/LICENSE.txt +0 -0
  31. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/__init__.py +0 -0
  32. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/containers/__init__.py +0 -0
  33. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/containers/bundles.py +0 -0
  34. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/containers/collection.py +0 -0
  35. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/containers/counts.py +0 -0
  36. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/containers/legacy.py +0 -0
  37. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/mtg/__init__.py +0 -0
  38. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/py.typed +0 -0
  39. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/scryfall/__init__.py +0 -0
  40. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/scryfall/fetcher.py +0 -0
  41. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/serialization/__init__.py +0 -0
  42. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/serialization/csv.py +0 -0
  43. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/serialization/interface.py +0 -0
  44. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/serialization/xlsx.py +0 -0
  45. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm/ssm.py +0 -0
  46. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm.egg-info/SOURCES.txt +0 -0
  47. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm.egg-info/dependency_links.txt +0 -0
  48. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm.egg-info/entry_points.txt +0 -0
  49. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm.egg-info/requires.txt +0 -0
  50. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/mtg_ssm.egg-info/top_level.txt +0 -0
  51. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/pyproject.toml +0 -0
  52. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/setup.cfg +0 -0
  53. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/__init__.py +0 -0
  54. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/conftest.py +0 -0
  55. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/containers/__init__.py +0 -0
  56. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/containers/test_bundles.py +0 -0
  57. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/containers/test_counts.py +0 -0
  58. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/containers/test_legacy.py +0 -0
  59. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/data/LICENSE.txt +0 -0
  60. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/data/migrations.json +0 -0
  61. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/mtg/__init__.py +0 -0
  62. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/scryfall/__init__.py +0 -0
  63. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/serialization/__init__.py +0 -0
  64. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/serialization/__snapshots__/test_csv.ambr +0 -0
  65. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/serialization/test_interface.py +0 -0
  66. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/serialization/test_xlsx.py +0 -0
  67. {mtg_ssm-2.6.8.dev4 → mtg_ssm-2.6.9}/tests/test_ssm.py +0 -0
@@ -71,7 +71,7 @@ jobs:
71
71
  run: coverage lcov
72
72
 
73
73
  - name: Coveralls Parallel
74
- uses: coverallsapp/github-action@v2.2.3
74
+ uses: coverallsapp/github-action@v2.3.0
75
75
  with:
76
76
  github-token: ${{ secrets.github_token }}
77
77
  flag-name: python-${{ matrix.python-version }}
@@ -84,7 +84,7 @@ jobs:
84
84
  runs-on: ubuntu-latest
85
85
  steps:
86
86
  - name: Coveralls Finished
87
- uses: coverallsapp/github-action@v2.2.3
87
+ uses: coverallsapp/github-action@v2.3.0
88
88
  with:
89
89
  github-token: ${{ secrets.github_token }}
90
90
  path-to-lcov: coverage.lcov
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mtg_ssm
3
- Version: 2.6.8.dev4
3
+ Version: 2.6.9
4
4
  Summary: A tool to manage Magic: the Gathering collection spreadsheets
5
5
  Author-email: George Leslie-Waksman <waksman@gmail.com>
6
6
  License: MIT
@@ -91,6 +91,14 @@ As a matter of convenience, you can store the created spreadsheet in
91
91
  Dropbox, Google Drive, or the like and access your collection from
92
92
  anywhere.
93
93
 
94
+ Mana Pool
95
+ =========
96
+
97
+ Please also check out my other major Magic: the Gathering project,
98
+ `Mana Pool`_; buying your cards there helps support my morale.
99
+
100
+ .. _Mana Pool: https://manapool.com
101
+
94
102
  Installation
95
103
  ============
96
104
 
@@ -200,7 +208,10 @@ Then configure the format to Excel A1:
200
208
  Contributions
201
209
  =============
202
210
 
203
- Pull requests are welcome and contributions are greatly appreciated.
211
+ Pull requests are welcome and contributions are greatly appreciated. If you
212
+ would like to contribute, please be sure that all tests and lint checks
213
+ pass. Also consider running `python -m tests.gen_testdata` to ensure that
214
+ everything is up to date and works.
204
215
 
205
216
  Issues can be reported via GitHub.
206
217
 
@@ -229,6 +240,11 @@ Development
229
240
 
230
241
  - ...
231
242
 
243
+ 2.6.9
244
+ -----
245
+
246
+ - Fix sorting of cards with collector number prefixes (primarily PLST).
247
+
232
248
  2.6.1
233
249
  -----
234
250
 
@@ -30,6 +30,14 @@ As a matter of convenience, you can store the created spreadsheet in
30
30
  Dropbox, Google Drive, or the like and access your collection from
31
31
  anywhere.
32
32
 
33
+ Mana Pool
34
+ =========
35
+
36
+ Please also check out my other major Magic: the Gathering project,
37
+ `Mana Pool`_; buying your cards there helps support my morale.
38
+
39
+ .. _Mana Pool: https://manapool.com
40
+
33
41
  Installation
34
42
  ============
35
43
 
@@ -139,7 +147,10 @@ Then configure the format to Excel A1:
139
147
  Contributions
140
148
  =============
141
149
 
142
- Pull requests are welcome and contributions are greatly appreciated.
150
+ Pull requests are welcome and contributions are greatly appreciated. If you
151
+ would like to contribute, please be sure that all tests and lint checks
152
+ pass. Also consider running `python -m tests.gen_testdata` to ensure that
153
+ everything is up to date and works.
143
154
 
144
155
  Issues can be reported via GitHub.
145
156
 
@@ -168,6 +179,11 @@ Development
168
179
 
169
180
  - ...
170
181
 
182
+ 2.6.9
183
+ -----
184
+
185
+ - Fix sorting of cards with collector number prefixes (primarily PLST).
186
+
171
187
  2.6.1
172
188
  -----
173
189
 
mtg_ssm-2.6.9/TODO.md ADDED
@@ -0,0 +1,8 @@
1
+ # TODO
2
+
3
+ - Add an xlsx dialect that only creates tabs for sets with cards present in the collection?
4
+ - Group sets by parent set is xlsx output?
5
+ - Block? probably not
6
+ - diffs to stdout
7
+ - Update card_count for sets when processing bundle filters
8
+ - Switch to hatchling as our build system?
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '2.6.8.dev4'
16
- __version_tuple__ = version_tuple = (2, 6, 8, 'dev4')
15
+ __version__ = version = '2.6.9'
16
+ __version_tuple__ = version_tuple = (2, 6, 9)
@@ -10,16 +10,14 @@ from mtg_ssm.mtg import util
10
10
  from mtg_ssm.scryfall.models import ScryCard, ScryMigrationStrategy, ScrySet
11
11
 
12
12
 
13
- def name_card_sort_key(card: ScryCard) -> Tuple[str, int, str]:
13
+ def name_card_sort_key(card: ScryCard) -> Tuple[str, str, int, str]:
14
14
  """Key function for sorting cards in a by-name list."""
15
- card_num, card_var = util.collector_int_var(card)
16
- return (card.set, card_num or 0, card_var or "") # TODO: sort by set release date
15
+ return (card.set, *util.collector_number_parts(card.collector_number))
17
16
 
18
17
 
19
- def set_card_sort_key(card: ScryCard) -> Tuple[int, str]:
18
+ def set_card_sort_key(card: ScryCard) -> Tuple[str, int, str]:
20
19
  """Key function for sorting cards in a by-set list."""
21
- card_num, card_var = util.collector_int_var(card)
22
- return (card_num or 0, card_var or "")
20
+ return util.collector_number_parts(card.collector_number)
23
21
 
24
22
 
25
23
  def build_snnmas(
@@ -0,0 +1,26 @@
1
+ """Utility functions for working with card data."""
2
+
3
+ import functools
4
+ import re
5
+ from typing import Tuple
6
+
7
+ STRICT_BASICS = frozenset({"Plains", "Island", "Swamp", "Mountain", "Forest"})
8
+
9
+ COLLECTOR_NUMBER_RE = re.compile(r"(?P<prefix>.*-|\D+)?(?P<number>\d+)?(?P<suffix>\D.*)?")
10
+
11
+
12
+ @functools.lru_cache(maxsize=None)
13
+ def collector_number_parts(collector_number: str) -> Tuple[str, int, str]:
14
+ """Split a collector number into its parts."""
15
+ match = COLLECTOR_NUMBER_RE.match(collector_number)
16
+ if not match:
17
+ return ("", 0, "")
18
+ prefix: str = match.group("prefix") or ""
19
+ number: int = int(match.group("number")) if match.group("number") else 0
20
+ suffix: str = match.group("suffix") or ""
21
+ return (prefix, number, suffix)
22
+
23
+
24
+ def is_strict_basic(card_name: str) -> bool:
25
+ """Is the card on of the five basic lands (not Snow or Wastes)."""
26
+ return card_name in STRICT_BASICS
@@ -122,6 +122,7 @@ class ScryFrameEffect(str, Enum):
122
122
  SHATTEREDGLASS = "shatteredglass"
123
123
  SHOWCASE = "showcase"
124
124
  SNOW = "snow"
125
+ SPREE = "spree"
125
126
  STAMPED = "stamped"
126
127
  SUNMOONDFC = "sunmoondfc"
127
128
  TEXTLESS = "textless"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mtg_ssm
3
- Version: 2.6.8.dev4
3
+ Version: 2.6.9
4
4
  Summary: A tool to manage Magic: the Gathering collection spreadsheets
5
5
  Author-email: George Leslie-Waksman <waksman@gmail.com>
6
6
  License: MIT
@@ -91,6 +91,14 @@ As a matter of convenience, you can store the created spreadsheet in
91
91
  Dropbox, Google Drive, or the like and access your collection from
92
92
  anywhere.
93
93
 
94
+ Mana Pool
95
+ =========
96
+
97
+ Please also check out my other major Magic: the Gathering project,
98
+ `Mana Pool`_; buying your cards there helps support my morale.
99
+
100
+ .. _Mana Pool: https://manapool.com
101
+
94
102
  Installation
95
103
  ============
96
104
 
@@ -200,7 +208,10 @@ Then configure the format to Excel A1:
200
208
  Contributions
201
209
  =============
202
210
 
203
- Pull requests are welcome and contributions are greatly appreciated.
211
+ Pull requests are welcome and contributions are greatly appreciated. If you
212
+ would like to contribute, please be sure that all tests and lint checks
213
+ pass. Also consider running `python -m tests.gen_testdata` to ensure that
214
+ everything is up to date and works.
204
215
 
205
216
  Issues can be reported via GitHub.
206
217
 
@@ -229,6 +240,11 @@ Development
229
240
 
230
241
  - ...
231
242
 
243
+ 2.6.9
244
+ -----
245
+
246
+ - Fix sorting of cards with collector number prefixes (primarily PLST).
247
+
232
248
  2.6.1
233
249
  -----
234
250
 
@@ -67,6 +67,15 @@ def test_setcode_to_cards(scryfall_data: ScryfallDataSet) -> None:
67
67
  "74d",
68
68
  ]
69
69
 
70
+ # The List Sorting
71
+ assert [(c.collector_number, c.name) for c in index.setcode_to_cards["plst"]] == [
72
+ ("10E-20", "High Ground"),
73
+ ("10E-182", "Terror"),
74
+ ("AKH-2", "Anointed Procession"),
75
+ ("AKH-3", "Anointer Priest"),
76
+ ("ARB-1", "Ardent Plea"),
77
+ ]
78
+
70
79
 
71
80
  def test_id_to_setindex(scryfall_data: ScryfallDataSet) -> None:
72
81
  index = ScryfallDataIndex()
@@ -8,8 +8,8 @@
8
8
  "type": "default_cards",
9
9
  "name": "Default Cards",
10
10
  "description": "A JSON file containing every card object on Scryfall in English or the printed language if the card is only available in one language.",
11
- "download_uri": "https://data.scryfall.io/default-cards/default-cards-20240221100428.json",
12
- "updated_at": "2024-02-21T10:04:28.932000Z",
11
+ "download_uri": "https://data.scryfall.io/default-cards/default-cards-20240826212052.json",
12
+ "updated_at": "2024-08-26T21:20:52.469000Z",
13
13
  "content_type": "application/json",
14
14
  "content_encoding": "gzip"
15
15
  }