stollen
Stollen is an asynchronous framework designed to streamline the process of building API clients, written in Python 3.9+ using aiohttp and pydantic. With a declarative approach, Stollen allows developers to define API methods, handle responses, and manage errors in a structured way, focusing on clarity and scalability.
Installation
pip install -U stollen
Example
from __future__ import annotations
import asyncio
import logging
from stollen import Stollen, StollenMethod, StollenObject
from stollen.enums import HTTPMethod
from stollen.exceptions import StollenAPIError
class CoingeckoAPIError(StollenAPIError):
pass
class RateLimitError(CoingeckoAPIError):
pass
class Coingecko(Stollen):
def __init__(self) -> None:
super().__init__(
base_url="https://api.coingecko.com/api/v3",
error_message_key=["status", "error_message"],
general_error_class=CoingeckoAPIError,
error_codes={429: RateLimitError},
stringify_detailed_errors=False,
)
async def ping(self) -> GeckoSays:
call: Ping = Ping()
return await self(call)
class GeckoSays(StollenObject[Coingecko]):
gecko_says: str
class Ping(
StollenMethod[GeckoSays, Coingecko],
http_method=HTTPMethod.GET,
api_method="/ping",
returning=GeckoSays,
):
pass
async def main() -> None:
logging.basicConfig(level=logging.DEBUG)
async with Coingecko() as coingecko:
gecko_says: GeckoSays = await coingecko.ping()
logging.info(gecko_says)
if __name__ == "__main__":
asyncio.run(main())
Metadata
Release files for stollen 0.8.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| stollen-0.8.4.tar.gz | 17.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stollen-0.8.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.9 kB
Release files / stollen-0.8.4.tar.gz
| Download URL | stollen-0.8.4.tar.gz |
|---|---|
| Size | 17.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de01ca88498e88acb520917082aeaef42f0093196aa43c82a4d9a01120e0ec8a
|
|
BLAKE2b-256 checksum How to use checksums |
1019c483395147a7aa3df1fb02796910e78bca22bf89a62c74e5e976b7eeb150
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.
Transparency logRelease files / stollen-0.8.4-py3-none-any.whl
| Download URL | stollen-0.8.4-py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b8e3f5416e229d174cd8d6d1fbabc03e50a287a47cace594f99bac1ef9e8948
|
|
BLAKE2b-256 checksum How to use checksums |
de0e87f977137b7cfdd4493367c25c20ebcd665679781fc7ce09f57270f08d8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.
Transparency log