Core
make_collection_db(database_path, bulk_data, collection, timestamp)
Makes local collection database where all card price information is stored.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
database_path
|
Path
|
Path to SQL collection database. |
required |
bulk_data
|
DataFrame
|
Dataframe of Scryfall bulk data. |
required |
collection
|
LazyFrame
|
Lazyframe of input collection file. |
required |
timestamp
|
date
|
Timestamp of local bulk data files. |
required |
Source code in src/mtg_pynance/core.py
record_card_entry(bulk_data, collection, cid, timestamp, cursor)
Records a card from the collection csv in the local SQL database. It writes the purchase price and cid of the card to the purchase_price table in the database. It records the card's price and timestamp from the local Scryfall bulk data file to the card's table in the database, making it if it does not exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bulk_data
|
DataFrame
|
Dataframe of Scryfall bulk data. |
required |
collection
|
LazyFrame
|
Lazyframe of input collection file. |
required |
cid
|
int
|
cid of card in collection file. |
required |
timestamp
|
date
|
Timestamp of local bulk data files. |
required |
cursor
|
Cursor
|
Cursor over the local collection database. |
required |
Source code in src/mtg_pynance/core.py
run_mtg_pynance(config)
Main function of mtg_pynance. It creates the workspace, retrieves the bulk data, imports the collection and bulk data files, and records the price information of each card in the collection to the local database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
Config
|
Configuration to run mtg_pynance with. |
required |