Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# _"scry a card, planeswalker..."_ 🔮🃏
# scryfall-set

Leveraging [scryfall](https://scryfall.com/docs/api) to get stats for MTG cards
## _"scry a card, planeswalker..."_ 🔮🃏

Overview stats for MTG sets and searches using the [Scryfall](https://scryfall.com/docs/api) API

<p align="center">
<img src="./img/scry-screenshot.png" alt="example screenshot" width="50%">
</p>

## setup
## install

Install via PyPi with `pip install scry-set`

### locally

Clone and install with `pipx install .`
Clone and install with `pipx install .` or `pip install .`

## use

- Request a reference list of set releases with: `scry setlist`
- to see a _full_ list of all releases including bonus boxes and memorabilia: `scry setlist --all`
- Get stats for a specific set:
- `scry set BLB` returns all cards from the _Bloomburrow_ set
- `scry set latest` finds the most recent release.
Expand All @@ -30,3 +37,15 @@ This also may lead to large database files with a lot of sets. To clear your dat

Made with python and sqlite, and requests to the [scryfall](https://scryfall.com/docs/api) API.
This is a personal project to learn more about python packaging, sqlite, pytest, and MTG sets.

## testing

Run tests with `pytest`

## licence

This project is distributed with the [MIT licence](./LICENCE)

## disclaimer

This project is not linked, authorized, endorsed by, or in any way officially connected with Wizards of the Coast.
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[project]
name = "scry"
name = "scryfall-set"
version = "0.1"
description = "Overview stats for MTG sets and searches using the Scryfall API"
dependencies = [
"requests",
"pytest",
Expand All @@ -17,7 +18,7 @@ classifiers = [

# defines the command and script that will be used to run
[project.scripts]
scry = "scry.main:main"
scry = "scryfall_set.main:main"

[project.urls]
repository = "https://github.com/thrly/scry"
Expand All @@ -29,4 +30,4 @@ build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = ["src"]
include = ["scry*"]
include = ["scryfall_set*"]
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/scry/cli.py → src/scryfall_set/cli.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import argparse
from datetime import datetime

from scry.db_queries import get_unique_cards
from scry.loading import Loading
from scry.request import find_current_release, check_date_past, get_set_info
from scryfall_set.db_queries import get_unique_cards
from scryfall_set.loading import Loading
from scryfall_set.request import find_current_release, check_date_past, get_set_info
from . import (
get_random_card,
insert_cards,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_db.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sqlite3
import datetime
from src.scry.db_setup import create_table
from src.scry.db_insert import insert_cards
from src.scryfall_set.db_setup import create_table
from src.scryfall_set.db_insert import insert_cards
from tests.sample_card import sample_card
from pathlib import Path
from contextlib import closing
Expand Down
2 changes: 1 addition & 1 deletion tests/test_random.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from src.scry.request import get_random_card
from src.scryfall_set.request import get_random_card


def test_random_card_request():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_transform.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# test the clean-up/transofrm of card data ready for inserting into

import datetime
from src.scry.db_insert import transform_card
from src.scryfall_set.db_insert import transform_card
from tests.sample_card import sample_card


Expand Down