Metadata-Version: 2.1
Name: scooze
Version: 1.0.4
Summary: A flexible data layer for applications working with Magic: the Gathering cards, decks, and tournaments.
Author: Alexander Gimmi
Author-email: iambroadband@gmail.com
Requires-Python: >=3.11,<3.12
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: fastapi (>=0.100.0,<1.0.0)
Requires-Dist: frozendict (>=2.3.8,<3.0.0)
Requires-Dist: ijson (>=3.2.3,<4.0.0)
Requires-Dist: motor (>=3.2.0,<4.0.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: uvicorn[standard] (>=0.23.1,<0.24.0)
Project-URL: Bug Tracker, https://github.com/arcavios/scooze/issues
Project-URL: Homepage, https://github.com/arcavios/scooze
Description-Content-Type: text/markdown

# scooze
A flexible data layer for applications working with Magic: the Gathering cards, decks, and tournaments.

## In this README 👇

- [Features](#features)
- [Usage](#usage)
  - [Initial setup](#initial-setup)
- [Contributing](#contributing)
  - [Developer setup](#developer-setup)

## Features

🎛️ CLI to manage a local database of [Scryfall](https://scryfall.com/docs/api/bulk-data) data

📊 Robust data models for representing Magic: the Gathering cards, decks, and tournaments
  - Cards - follows the Scryfall standard
  - Decks - main deck/sideboard/command zone, format legality, average words, and more
  - Tournaments - coming soon!

🐍 Python and REST APIs for interacting with the scooze database
  - Note: v1 is local only

## Usage

### Initial setup

1. Download and install this package from [PyPi](https://pypi.org/project/scooze/).

    ```
    pip install scooze
    ```

2. Download and install [MongoDB](https://www.mongodb.com/docs/manual/installation/).

    Scooze depends on MongoDB to run your local database.

    *You can use scooze without MongoDB if you don't intend to use any of its database-related features.*

3. Run the MongoDB server.

    ```
    mongod --dbpath path/to/db/
    ```

    *Your local database can be stored wherever you want, but make sure you create the directory first. This is commonly stored at `/data/db`*

4. Run the scooze CLI tool (installed with pip install) to add some data to your local database.

    ```
    scooze -h
    scooze load-cards oracle
    scooze run
    ```

5. Use scooze in your application code!

    ```
    from scooze.api import ScoozeApi
    from scooze.catalogs import Color

    with ScoozeApi() as s:
      # get 10 arbitrary green cards
      green_cards = s.get_cards_by("colors", [Color.GREEN], paginated=True, page_size=10)
      # get _all_ green cards
      green_cards = s.get_cards_by("colors", [Color.GREEN])

      # get all cards from a particular set
      woe_cards = s.get_cards_by_set("woe")

      # get a specific card
      black_lotus = s.get_card_by_name("Black Lotus")
      print(black_lotus.total_words())

      # and more!
    ```

## Contributing

If you find a bug 🐛, please open a [bug report](https://github.com/arcavios/scooze/issues/new?assignees=&labels=bug&template=bug_report.md&title=). If you have an idea for an improvement or new feature 🚀, please open a [feature request](https://github.com/arcavios/scooze/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=).

If you find a security vulnerability, please follow the instructions [here](./SECURITY.md).

### Developer setup

1. Install Poetry
	- [Introduction to Poetry](https://python-poetry.org/docs/#installation)
	- Make sure it worked

        ```
        poetry --version
        ```

2. [Fork](https://github.com/arcavios/scooze/fork) and clone the scooze GitHub repo

    *Read more about forking [here](https://docs.github.com/en/get-started/quickstart/fork-a-repo).*

    ```
    git clone https://www.github.com/link/to/fork
    cd ./scooze
    poetry install
    ```

3. You're ready to develop!

4. When you have changes you'd like the team to review, please submit a pull request!

---

![Scavenging Ooze](https://cards.scryfall.io/large/front/4/8/487116ab-b885-406b-aa54-56cb67eb3ca5.jpg?1594737205)

