gwax / mtg_ssm Goto Github PK
View Code? Open in Web Editor NEWMagic: the Gathering Spreadsheet Manager
License: MIT License
Magic: the Gathering Spreadsheet Manager
License: MIT License
First time user, attempted to build a spreadsheet and it failed with an invalid enum in legalities:
Reading data from scryfall
Fetched https://api.scryfall.com/bulk-data
Fetched https://api.scryfall.com/sets
Fetched https://api.scryfall.com/migrations
Fetched https://api.scryfall.com/migrations?page=2
Fetched https://data.scryfall.io/default-cards/default-cards-20230316210924.json
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Python311\Scripts\mtg-ssm.exe\__main__.py", line 7, in <module>
File "C:\Python311\Lib\site-packages\mtg_ssm\ssm.py", line 290, in main
oracle = get_oracle(
^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\mtg_ssm\ssm.py", line 195, in get_oracle
scrydata = fetcher.scryfetch()
^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\mtg_ssm\scryfall\fetcher.py", line 77, in scryfetch
cards_data = msgspec.json.decode(
^^^^^^^^^^^^^^^^^^^^
msgspec.ValidationError: Invalid enum value 'oathbreaker' - at `key` in `$[0].legalities`
Apparently a new format was endorsed by WOTC. Seems to be fixed by adding Oathbreaker to models.py
Hi all,
i get following error during creating a new file:
...
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\lib\concurrent\futures_base.py", line 389, in __get_result
raise self._exception
marshmallow.exceptions.ValidationError: {'legalities': {'gladiator': ['Invalid key: Invalid enum value gladiator'], 'premodern': ['Invalid key: Invalid enum value premodern']}, '_schema': ["ScryCardSchema Unknown fields: ['cardmarket_id']"]}
Any suggestions?
br
When using version 2.6.7 I get the following error:
Looks like scryfall has made another underlying data change...
🟢 ❯ mtg-ssm --separate-promos create collection.xlsx
Reading data from scryfall
Fetched https://api.scryfall.com/bulk-data [CACHED]
Fetched https://api.scryfall.com/sets [CACHED]
Fetched https://api.scryfall.com/migrations [CACHED]
Fetched https://api.scryfall.com/migrations?page=2 [CACHED]
Fetched https://api.scryfall.com/migrations?page=3 [CACHED]
Fetched https://api.scryfall.com/migrations?page=4 [CACHED]
Fetched https://api.scryfall.com/migrations?page=5 [CACHED]
Fetched https://api.scryfall.com/migrations?page=6 [CACHED]
Fetched https://api.scryfall.com/migrations?page=7 [CACHED]
Fetched https://data.scryfall.io/default-cards/default-cards-20240324210707.json [CACHED]
Traceback (most recent call last):
File "/home/tony/.local/bin/mtg-ssm", line 8, in <module>
sys.exit(main())
File "/home/tony/.local/lib/python3.10/site-packages/mtg_ssm/ssm.py", line 284, in main
oracle = get_oracle(
File "/home/tony/.local/lib/python3.10/site-packages/mtg_ssm/ssm.py", line 189, in get_oracle
scrydata = fetcher.scryfetch()
File "/home/tony/.local/lib/python3.10/site-packages/mtg_ssm/scryfall/fetcher.py", line 78, in scryfetch
cards_data = msgspec.json.decode(_fetch_endpoint(cards_endpoint), type=List[ScryCard])
msgspec.ValidationError: Invalid enum value 'promo' - at `$[92501].frame_effects[0]`
🔴 ERROR❯ mtg-ssm --version
2.6.7
Using the option --seperate-promos
has no affect on the error.
Looks like an improvement over flake8
Might be worth looking into
Hello,
I am having an error with merging the input_data.csv with the collection.xlsx. I don't get any error when I merge an empty input_data with the collection.xlsx. Please help!
C:\Users\Name>mtg-ssm merge collection.xlsx input_data.csv
Retrieving https://api.scryfall.com/bulk-data
Reading cache
Retrieving https://api.scryfall.com/bulk-data
Fetching https://api.scryfall.com/bulk-data
Retrieving https://api.scryfall.com/sets
Reading cache
Retrieving https://data.scryfall.io/default-cards/default-cards-20230101220647.json
Reading cache
Retrieving https://api.scryfall.com/bulk-data
Reading cache
Reading counts from collection.xlsx
Merging counts from input_data.csv
Traceback` (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\mtg-ssm.exe\__main__.py", line 7, in <module>
File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mtg_ssm\ssm.py", line 232, in main
args.func(args, oracle)
File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mtg_ssm\ssm.py", line 212, in merge_cmd
collection += input_serializer.read(import_path, oracle)
File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mtg_ssm\serialization\csv.py", line 65, in read
card_counts = counts.aggregate_card_counts(reader, oracle)
File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mtg_ssm\containers\counts.py", line 35, in aggregate_card_counts
scryfall_id = UUID(scryfall_id)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\uuid.py", line 177, in __init__
raise ValueError('badly formed hexadecimal UUID string')
ValueError: badly formed hexadecimal UUID string
```
New installation from pip3, after trying to create a new spreadsheet, it returns the following error:
Reading data from scryfall
Fetched https://api.scryfall.com/bulk-data
Fetched https://api.scryfall.com/sets
Fetched https://api.scryfall.com/migrations
Fetched https://api.scryfall.com/migrations?page=2
Fetched https://data.scryfall.io/default-cards/default-cards-20230509090726.json
Traceback (most recent call last):
File "/Users/valejacobo/Library/Python/3.9/bin/mtg-ssm", line 8, in <module>
sys.exit(main())
File "/Users/valejacobo/Library/Python/3.9/lib/python/site-packages/mtg_ssm/ssm.py", line 290, in main
oracle = get_oracle(
File "/Users/valejacobo/Library/Python/3.9/lib/python/site-packages/mtg_ssm/ssm.py", line 195, in get_oracle
scrydata = fetcher.scryfetch()
File "/Users/valejacobo/Library/Python/3.9/lib/python/site-packages/mtg_ssm/scryfall/fetcher.py", line 77, in scryfetch
cards_data = msgspec.json.decode(
msgspec.ValidationError: Invalid enum value 'thick' - at `$[50022].frame_effects[1]`
Adding the ScryFrameEffect 'thick' should fix it.
Hello, I'm getting a crash after a fresh install when trying to create my spreadsheet.
MacOS 12.6
Deserializing
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/process.py", line 243, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/process.py", line 202, in _process_chunk
return [fn(*args) for args in chunk]
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/process.py", line 202, in <listcomp>
return [fn(*args) for args in chunk]
File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 2 validation errors for ScryCard
produced_mana -> 0
value is not a valid enumeration member; permitted: 'W', 'U', 'B', 'R', 'G', 'C' (type=type_error.enum; enum_values=[<ScryColor.WHITE: 'W'>, <ScryColor.BLUE: 'U'>, <ScryColor.BLACK: 'B'>, <ScryColor.RED: 'R'>, <ScryColor.GREEN: 'G'>, <ScryColor.COLORLESS: 'C'>])
produced_mana -> 0
value is not a valid integer (type=type_error.integer)
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/jared/Library/Python/3.9/bin/./mtg-ssm", line 8, in <module>
sys.exit(main())
File "/Users/jared/Library/Python/3.9/lib/python/site-packages/mtg_ssm/ssm.py", line 231, in main
oracle = get_oracle(args.set_types, args.include_digital)
File "/Users/jared/Library/Python/3.9/lib/python/site-packages/mtg_ssm/ssm.py", line 141, in get_oracle
scrydata = fetcher.scryfetch()
File "/Users/jared/Library/Python/3.9/lib/python/site-packages/mtg_ssm/scryfall/fetcher.py", line 124, in scryfetch
cards_data = _deserialize_cards(cards_json)
File "/Users/jared/Library/Python/3.9/lib/python/site-packages/mtg_ssm/scryfall/fetcher.py", line 80, in _deserialize_cards
cards_data = list(cards_futures)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/process.py", line 559, in _chain_from_iterable_of_lists
for element in iterable:
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 608, in result_iterator
yield fs.pop().result()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 438, in result
return self.__get_result()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
raise self._exception
pydantic.error_wrappers.ValidationError: 2 validation errors for ScryCard
produced_mana -> 0
value is not a valid enumeration member; permitted: 'W', 'U', 'B', 'R', 'G', 'C' (type=type_error.enum; enum_values=[<ScryColor.WHITE: 'W'>, <ScryColor.BLUE: 'U'>, <ScryColor.BLACK: 'B'>, <ScryColor.RED: 'R'>, <ScryColor.GREEN: 'G'>, <ScryColor.COLORLESS: 'C'>])
produced_mana -> 0
value is not a valid integer (type=type_error.integer)
Due to an upstream data issue in mtgjson, the application crashes with:
Traceback (most recent call last):
File "/home/waksman/.pyenv/versions/3.5.1/lib/python3.5/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/home/waksman/.pyenv/versions/3.5.1/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/waksman/git/mtg_ssm/mtg_ssm/manager.py", line 104, in <module>
main()
File "/home/waksman/git/mtg_ssm/mtg_ssm/manager.py", line 100, in main
process_files(args)
File "/home/waksman/git/mtg_ssm/mtg_ssm/manager.py", line 69, in process_files
coll = build_collection(args.data_path, args.include_online_only)
File "/home/waksman/git/mtg_ssm/mtg_ssm/manager.py", line 64, in build_collection
mtgjsondata, include_online_only=include_online_only)
File "/home/waksman/git/mtg_ssm/mtg_ssm/mtg/collection.py", line 46, in __init__
self.load_mtg_json(mtg_json_data, include_online_only)
File "/home/waksman/git/mtg_ssm/mtg_ssm/mtg/collection.py", line 53, in load_mtg_json
card_set = models.CardSet(self, set_data)
File "/home/waksman/git/mtg_ssm/mtg_ssm/mtg/models.py", line 94, in __init__
set_data['releaseDate'], '%Y-%m-%d').date()
Hi,
I am getting the following error when attempting to create a collection. Please help!
C:\Users\OrcMa>mtg-ssm create collection.xlsx Retrieving https://api.scryfall.com/bulk-data Fetching https://api.scryfall.com/bulk-data Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\mtg-ssm.exe\__main__.py", line 7, in <module> File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mtg_ssm\ssm.py", line 231, in main oracle = get_oracle(args.set_types, args.include_digital) File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mtg_ssm\ssm.py", line 141, in get_oracle scrydata = fetcher.scryfetch() File "C:\Users\OrcMa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mtg_ssm\scryfall\fetcher.py", line 118, in scryfetch bulk_list = ScryObjectList[ScryBulkData].parse_obj(bulk_json) File "pydantic\main.py", line 526, in pydantic.main.BaseModel.parse_obj File "pydantic\main.py", line 342, in pydantic.main.BaseModel.__init__ pydantic.error_wrappers.ValidationError: 5 validation errors for ScryObjectList[ScryBulkData] data -> 0 -> compressed_size field required (type=value_error.missing) data -> 1 -> compressed_size field required (type=value_error.missing) data -> 2 -> compressed_size field required (type=value_error.missing) data -> 3 -> compressed_size field required (type=value_error.missing) data -> 4 -> compressed_size field required (type=value_error.missing)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.