Skip to main content

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

Project description

scooze

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

In this README 👇

Features

🎛️ CLI to manage a local database of Scryfall 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.

    pip install scooze
    
  2. Download and install MongoDB.

    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. If you have an idea for an improvement or new feature 🚀, please open a feature request.

If you find a security vulnerability, please follow the instructions here.

Developer setup

  1. Install Poetry

  2. Fork and clone the scooze GitHub repo

    Read more about forking here.

    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

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

scooze-1.0.3.tar.gz (39.1 kB view hashes)

Uploaded Source

Built Distribution

scooze-1.0.3-py3-none-any.whl (48.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page