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.1.dev2.tar.gz
(304.0 kB
view hashes)
Built Distribution
Close
Hashes for aioscryfall-0.3.1.dev2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1d1ebbd6f0c036cb4cbd80abe0d282e76412b74ff9cdf40ea1c60787668f233 |
|
MD5 | 3c1ead6480ecbacc55ff8dc8486a2b0d |
|
BLAKE2b-256 | 4e887cb259a2b9c126cbcafef2ddbf057a94963e6e4f40d00a8d204f164a4879 |