Asynchronous Python client for the Scryfall API
Project description
This is an early work in progress. I am currently in the phase of getting all of the features in place. Once everything is in place, I will clean up the API and add some abstraction layers and documentation on top.
For now, the API is very low level and you will need to read the Scryfall API and the code to figure out how to use it.
You will need Python >= 3.11 (I may change this to support earlier versions in the future) and you will need to use aiohttp.
A minimal use case to get yourself started:
import asyncio
import aiohttp
from aioscryfall.api.cards import UniqueMode
import aioscryfall.client import ScryfallClient
async def get_bolt():
async with aiohttp.ClientSession() as session:
client = ScryfallClient(session)
bolts = [c async for c in client.cards.search("lightning bolt", unique=UniqueMode.PRINTS)]
return bolts
bolts = asyncio.run(get_bolt())
print(len(bolts), bolts[0])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aioscryfall-0.3.0.tar.gz
(24.0 kB
view hashes)
Built Distribution
Close
Hashes for aioscryfall-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f10091b41c1d587b0a237015ddf4cd2048fbc32174cb5d8758d2ec94e4b3b6b0 |
|
MD5 | 922516dbb671c0fc4b00f0ded308d4dc |
|
BLAKE2b-256 | 48d1edccbc407437cf2bbe6d102923f33378a2e25b8ee7941dd15ddb3d6645a6 |