Name | aioscryfall JSON |
Version |
0.4.2
JSON |
| download |
home_page | |
Summary | Asynchronous Python client for the Scryfall API |
upload_time | 2023-04-05 07:53:51 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.11 |
license | MIT |
keywords |
magic
mtg
scryfall
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
aioscryfall - Asynchronous Python client for Scryfall API
=========================================================
aioscryfall is a Python client for the Scryfall API. It is primarily designed for asynchronous use with asyncio, but a synchronous client is also provided.
The development is essentially feature complete but the documentation is largely absent, at present. (I need to remind myself how mkdocs works and figure out what I want to say)
As of right now, Python 3.11 is required because I wanted to use a number of typing features that were added in 3.11. I may change this in the future, but it is a lower priority than getting the API to a point where I am happy with it.
Everything is extensively typed and I have tried to make the API as intuitive as possible. I have also tried to make the API as close to the Scryfall API as possible, but I have made some changes to make it more Pythonic (namely converting paginated lists into iterable generators).
A minimal use case to get yourself started:
.. code:: python
import asyncio
import aiohttp
from aioscryfall.api.cards import UniqueMode
from 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])
Or if you prefer not to use async:
.. code:: python
from aioscryfall.api.cards import UniqueMode
from aioscryfall.sync.client import ScryfallSyncClient
client = ScryfallSyncClient()
bolts = list(client.cards.search("lightning bolt", unique=UniqueMode.PRINTS))
print(len(bolts), bolts[0])
Raw data
{
"_id": null,
"home_page": "",
"name": "aioscryfall",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "",
"keywords": "magic,mtg,scryfall",
"author": "",
"author_email": "George Leslie-Waksman <waksman@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/a7/9f/36d26e4aad67b2c962114ecb84a350641dae13794b48b6392fd419165879/aioscryfall-0.4.2.tar.gz",
"platform": null,
"description": "aioscryfall - Asynchronous Python client for Scryfall API\n=========================================================\n\naioscryfall is a Python client for the Scryfall API. It is primarily designed for asynchronous use with asyncio, but a synchronous client is also provided.\n\nThe development is essentially feature complete but the documentation is largely absent, at present. (I need to remind myself how mkdocs works and figure out what I want to say)\n\nAs of right now, Python 3.11 is required because I wanted to use a number of typing features that were added in 3.11. I may change this in the future, but it is a lower priority than getting the API to a point where I am happy with it.\n\nEverything is extensively typed and I have tried to make the API as intuitive as possible. I have also tried to make the API as close to the Scryfall API as possible, but I have made some changes to make it more Pythonic (namely converting paginated lists into iterable generators).\n\nA minimal use case to get yourself started:\n\n.. code:: python\n\n import asyncio\n import aiohttp\n from aioscryfall.api.cards import UniqueMode\n from aioscryfall.client import ScryfallClient\n\n async def get_bolt():\n async with aiohttp.ClientSession() as session:\n client = ScryfallClient(session)\n bolts = [c async for c in client.cards.search(\"lightning bolt\", unique=UniqueMode.PRINTS)]\n return bolts\n\n bolts = asyncio.run(get_bolt())\n print(len(bolts), bolts[0])\n\nOr if you prefer not to use async:\n\n.. code:: python\n\n from aioscryfall.api.cards import UniqueMode\n from aioscryfall.sync.client import ScryfallSyncClient\n\n client = ScryfallSyncClient()\n bolts = list(client.cards.search(\"lightning bolt\", unique=UniqueMode.PRINTS))\n print(len(bolts), bolts[0])\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Asynchronous Python client for the Scryfall API",
"version": "0.4.2",
"split_keywords": [
"magic",
"mtg",
"scryfall"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7ecc5cecbec7b97c849e9044a62cb899a94a780a20553fabf2d15611a91618d0",
"md5": "188f8bc240054ddfe79700b29622b08c",
"sha256": "1cff07fe4e321d89c3da862c64f25d5d35a692a3eff2b4d8c14f6ebef31a15cd"
},
"downloads": -1,
"filename": "aioscryfall-0.4.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "188f8bc240054ddfe79700b29622b08c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 33758,
"upload_time": "2023-04-05T07:53:49",
"upload_time_iso_8601": "2023-04-05T07:53:49.323643Z",
"url": "https://files.pythonhosted.org/packages/7e/cc/5cecbec7b97c849e9044a62cb899a94a780a20553fabf2d15611a91618d0/aioscryfall-0.4.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a79f36d26e4aad67b2c962114ecb84a350641dae13794b48b6392fd419165879",
"md5": "52bf00e26fbbb591d18f6e0d3dc0dea5",
"sha256": "fed6b6ba6aec3162481f3478e5291ab36771b7ac8dfdd891ca63d8066ca91fc5"
},
"downloads": -1,
"filename": "aioscryfall-0.4.2.tar.gz",
"has_sig": false,
"md5_digest": "52bf00e26fbbb591d18f6e0d3dc0dea5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 307988,
"upload_time": "2023-04-05T07:53:51",
"upload_time_iso_8601": "2023-04-05T07:53:51.310638Z",
"url": "https://files.pythonhosted.org/packages/a7/9f/36d26e4aad67b2c962114ecb84a350641dae13794b48b6392fd419165879/aioscryfall-0.4.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-05 07:53:51",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "aioscryfall"
}