3 ms·
Show HN: PomdAPI (Python) – Type safe API client with in-built Tag-Based caching
- jimixxperez 2y agoHey everyone, I’m excited to share PomdAPI, a Python library that simplifies building and caching API calls. If you’ve ever written repetitive “fetch data → parse JSON → cache results” boilerplate, PomdAPI might help you cut down on that overhead! I’m planning to use PomdAPI in my upcoming consulting projects to quickly develop and cache robust APIs. However, the project is still in an early stage, and I’d love community support (feedback, PRs, issue reports) to help finalize and polish it.
- K0IN 2y agowhat is the upside of backend caching instead of using client side caching using for example cache headers?
- jimixxperez 2y agoHi and thanks for the comment :), PomdAPI is client side, but its “Client-Side” is at the Python Layer. PomdAPI should typically be used within a client application—like a microservice, CLI tool, or backend service—that calls external APIs. It’s still “client-side” in the sense that it caches outside the external API, but inside your Python environment. So it’s not “browser caching” or “server-side for the remote API.” Instead, PomdAPI manages caching right where your Python code consumes the API. PomdAPI doesn’t just cache responses. It also handles tag-based invalidation, which helps you precisely drop or refresh cached items when certain data changes. For example, if you store user data under Tag("User", "id123"), and then you update that user, PomdAPI invalidates that tag so you don’t inadvertently serve stale data. If the API you are using provides HTTP cache headers and it would still require each client to re-check or rely on fine grained ETag logic. PomdAPI centralizes and automates this right where the Python calls occur. Hope I could answer your question. The lib was strongly inspired by RTK Query (typescript).