AsyncFigranium mirrors Figranium exactly: the same constructor keyword arguments, the same resource attributes, and the same method names. The only difference is that every network call returns an awaitable coroutine, and stream methods return AsyncIterator instead of Iterator.
Constructor
The async client accepts the same options as the sync client. Thehttp_client argument expects an httpx.AsyncClient instead of httpx.Client.
filename.py
Context manager
Useasync with to ensure the client closes automatically:
filename.py
filename.py
Await every call
All resource methods are async. Await each one:filename.py
filename.py
Async streams
Stream methods returnAsyncIterator[StreamEvent]. Use async for:
filename.py
client.browser.selector_stream():
filename.py
Error handling
Async calls raise the sameFigraniumError as the sync client:
filename.py
Related
Client configuration
All available client options, including
base_url and timeout.Streaming
Consuming SSE events with sync and async iterators.
Tasks resource
Save, run, and manage tasks.