Metadata-Version: 2.3
Name: manalens
Version: 0.0.1rc1
Summary: A modern Python client for the Scryfall API
Author: Felton Vaughn
Author-email: Felton Vaughn <code@felton.io>
Requires-Dist: httpx2>=2.12.0
Requires-Dist: pydantic>=2.13.4
Requires-Dist: typing-extensions>=4.16.0 ; python_full_version < '3.12'
Requires-Dist: uritemplate>=4.2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# ManaLens

A modern Python client for the [Scryfall API](https://scryfall.com/docs/api)

## Installation
```python
pip install manalens
```

## Usage

### Shared Client

```python
from manalens import Scryfall


with Scryfall() as client:
    # Search for cards
    cards = client.cards.search(
        q="t:dragon c:r",
        order="name",
        page=1,
    )

    card = client.cards.by_id(scryfall_id=UUID("75240bbc-adc7-48ff-9523-c79776d710d3"))

    # Card by Arena ID
    card = client.cards.by_id(arena_id=73347)

    # Card by MTGO ID
    card = client.cards.by_id(mtgo_id=83265)

    # Card by TCGplayer ID
    card = client.cards.by_id(tcgplayer_id=222039)

    # Card by Cardmarket ID
    card = client.cards.by_id(cardmarket_id=495735)

    # Card text
    text = client.cards.text_by_id(scryfall_id=UUID("75240bbc-adc7-48ff-9523-c79776d710d3"))

    # Card image
    image = client.cards.image_by_id(scryfall_id=UUID("75240bbc-adc7-48ff-9523-c79776d710d3"))

    # Specific card face / image version
    image = client.cards.image_by_id(
        scryfall_id=UUID("75240bbc-adc7-48ff-9523-c79776d710d3"),
        face="back",
        version="large",
    )

    # Symbols
    symbols = client.symbols.get_all()

    # Parse a mana cost
    mana = client.symbols.parse_mana("2WW")
```

### Manual Client (good for quick one-off requests)
```python
from manalens import scry

card = scry.cards.by_id(scryfall_id=UUID("75240bbc-adc7-48ff-9523-c79776d710d3"))

cards = scry.cards.search(q="t:goblin c:r")

text = scry.cards.text_by_id(scryfall_id=UUID("75240bbc-adc7-48ff-9523-c79776d710d3"))

image = scry.cards.image_by_id(scryfall_id=UUID("75240bbc-adc7-48ff-9523-c79776d710d3"))
```

> [!WARNING]
> ManaLens is still under active development and hasn't reached it's first release. Request throttling/rate limiting isn't implemented yet. If you're experimenting with this lib, make sure you comply with [ScryFall's API Guidelines](https://scryfall.com/docs/api/rate-limits)

*ManaLens is an independent fan project and is not affiliated with, endorsed by, or sponsored by Scryfall, Wizards of the Coast, or Hasbro. Magic: The Gathering and related names, artwork, and game content belong to their respective owners.*