MTG_Scryfall_Grabber (MSG) is a Python library/repository for scraping and organizing data from the Scryfall Rest-API.
Project description
mtg-scryfall-grabber
MTG-Scryfall-Grabber (MSG) is a Python library and module for scraping and organizing data from the Scryfall Rest-API.
Installation
Please go to Releases for the latest directories.
Additionally, this can be installed from pip using
python3 -m pip install mtg-scryfall-grabber
Usage
After installing via pip using
python3 -m pip install --upgrade mtg-scryfall-grabber
The functions from grab_cards.py
can be invoked using
import grab_cards
At the moment, two functions are currently working.
grab_cards()
and grab_prices()
, these two, respectively, grab card names sorted by collector ID, and card prices, sorted by Collector ID. This is intended to be imported into spreadsheet software such as Microsoft Excel, in order to be sorted by things like Collector Number, Name, or Price.
Quickstart
To get started quickly, one must install Python 3 (version 3.8 or greater).
Once having completed Python 3 installation for your Operating System, running the following command
WINDOWS PowerShell ---
py -m pip install --upgrade mtg-scryfall-grabber
MacOS/UNIX Terminal/bash ---
python3 -m pip install --upgrade mtg-scryfall-grabber
This will install mtg-scryfall-grabber's grab-card
library, to be imported and used in your own Python Module if so desired.
From here, downloading (either from releases, or from cloning this repository) the example/msfg.py
file. Once this is done, the following steps can be taken to 'quickstart' downloading information from the Scryfall API.
- In your commandline (henceforth the CLI), navigate to the directory.
cd $MTG_SCRYFALL_GRABBER_DOWNLOAD_LOCATION/example/
- Run the following command to download the information for "Phyrexia, All Will Be One"
WINDOWS PowerShell
py msfg.py ONE
MacOS/UNIX Terminal/Bash
python3 msfg.py ONE
In ./example/
, this will create a directory named "output", which will contain a .json
file named Phyrexia: All Will Be One_card_name_info.json
TODO
Additional functions need to be implimented, however -- an example implementation of this library is given in ./example/
under msfg.py
. This implementation can also be treated as the "primary" method of using this library, in order to generate JSON to be used inside Excel spreadsheets.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
The license is covered under the file license.md.
In essence, please do not use this software for commercial (for profit) means. This library is provided as is, modifications to the source code are allowed. This is to follow the Wizards of the Coast's Fan Content Policy.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mtg_scryfall_grabber-0.1.2.tar.gz
.
File metadata
- Download URL: mtg_scryfall_grabber-0.1.2.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac7dff9a00b08e6ad0f53e706767668b1568042d53f76ed6a173a38abd98f5f6 |
|
MD5 | b6b568623d8d417a467d5f544670ae25 |
|
BLAKE2b-256 | 8791074760fa7883f3d794630d04b292b002669d4c53718479320c6c07c9c9c0 |
File details
Details for the file mtg_scryfall_grabber-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: mtg_scryfall_grabber-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42380ed090f05266e868b7cbcdd0aaecb1fe8c08e9d50a2bd19e11512bad0e8d |
|
MD5 | 198d8194a6b7ae7a8dba3e5db11d596b |
|
BLAKE2b-256 | 2cfbfcd3ff7b8325df281b52c000562417d360cffe42d5f41200efeea53c045d |