AsyncClient¶
AsyncClient
¶
Asynchronous client for interacting with the Bloomy API.
This client provides async access to all Bloomy API operations including users, meetings, todos, goals, headlines, issues, and scorecards.
Parameters:
-
api_key
(str | None
, default:None
) –The API key for authentication. If not provided, it will be loaded from environment variables or configuration files.
-
base_url
(str
, default:'https://app.bloomgrowth.com/api/v1'
) –The base URL for the API. Defaults to the production API URL.
Example
Using the async client with context manager:
import asyncio
from bloomy import AsyncClient
async def main():
async with AsyncClient(api_key="your-api-key") as client:
user = await client.user.details()
print(user.name)
asyncio.run(main())
Without context manager:
Initialize the async Bloomy client.
Parameters:
-
api_key
(str | None
, default:None
) –The API key for authentication.
-
base_url
(str
, default:'https://app.bloomgrowth.com/api/v1'
) –The base URL for the API.
Methods:
-
__aenter__
–Enter the async context manager.
-
__aexit__
–Exit the async context manager.
-
close
–Close the HTTP client.
Source code in src/bloomy/async_client.py
Functions¶
__aenter__
async
¶
__aenter__() -> AsyncClient
__aexit__
async
¶
__aexit__(exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None) -> None
Exit the async context manager.