Asyncio client for the YNAB API.
This package is generated from the YNAB OpenAPI spec and uses the OpenAPI Generator Python httpx client.
This project is not affiliated with, endorsed by, or officially connected with YNAB.
python -m pip install asyncio-for-ynabFor local development:
python -m pip install -e ".[dev]"import asyncio
from asyncio_for_ynab import ApiClient
from asyncio_for_ynab import Configuration
from asyncio_for_ynab import PlansApi
from asyncio_for_ynab import UserApi
async def main() -> None:
configuration = Configuration(access_token="your-access-token")
async with ApiClient(configuration) as api_client:
user_api = UserApi(api_client)
plans_api = PlansApi(api_client)
user = await user_api.get_user()
plans = await plans_api.get_plans()
print(user)
print(plans)
asyncio.run(main())Create a client once and pass it to any generated API class:
from asyncio_for_ynab import AccountsApi
from asyncio_for_ynab import ApiClient
from asyncio_for_ynab import Configuration
configuration = Configuration(access_token="your-access-token")
async with ApiClient(configuration) as api_client:
accounts_api = AccountsApi(api_client)
accounts = await accounts_api.get_accounts()The package also exports generated models, response objects, and exceptions at the top level:
from asyncio_for_ynab import AccountResponse
from asyncio_for_ynab import ApiException
from asyncio_for_ynab import TransactionResponseRun the repository checks with pre-commit:
pre-commit run --all-filesRun the test suite:
tox -e pyPackage versions mirror the YNAB API spec version.
For example, spec 1.83.0 is published as asyncio-for-ynab==1.83.0.