$npx skillfedfor your agent

onecache

Python cache for sync and async code

Worth itPyPI Software DevelopmentReleased Feb 2026725.7K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — onecache-0.8.1-py3-none-any.whl
v0.8.1 · released 2026-02-20 · Python >=3.8

Yes. OneCache is a solid choice for lightweight, decorator-based caching in Python applications. It has zero runtime dependencies, is actively maintained, supports modern Python versions (3.8–3.14), carries no security vulnerabilities, and works seamlessly with both sync and async code. Install it if you need simple LRU caching with optional TTL and don't want to manage an external cache service.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.8 or later; max_mem_size parameter is ignored on PyPy due to JIT compilation.
  • Low install friction with no runtime dependencies.
  • Actively maintained as of 2026-02-20, tested across CPython 3.8–3.14 and PyPy 3.9 on Linux, macOS, and Windows.

License · maintenance · safety

MIT (permissive) — MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.

last release 2026-02-20 (175 days)

0 known vulnerabilities (OSV.dev, 2026-08-14) · 725,663 downloads/mo, #5,220 on PyPI

Verify before relying

from onecache import CacheDecorator, AsyncCacheDecorator

@CacheDecorator(maxsize=512, ttl=None)
def my_function(x):
    return x * 2

@AsyncCacheDecorator(maxsize=512)
async def my_async_function(x):
    return x * 2
  • Performance characteristics and overhead compared to functools.lru_cache or other caching libraries.
  • Thread safety guarantees when thread_safe=True is enabled.
  • Behavior of refresh_ttl flag and its interaction with concurrent access patterns.
Same gist for agents: .md · .json

What it is and what it does

OneCache is a lightweight in-memory caching library that wraps functions with LRU (Least Recently Used) eviction and optional time-to-live expiration. It provides two decorator classes—CacheDecorator for sync functions and AsyncCacheDecorator for async coroutines—allowing you to cache function results without modifying function signatures. The cache automatically evicts the oldest entry when it reaches maxsize, and can optionally expire entries after a specified TTL in milliseconds. You can also set memory size limits and enable thread-safe locking for concurrent access.

The library is designed for straightforward use: decorate a function, configure cache size and TTL, and results are automatically cached and reused on subsequent calls with identical arguments. It supports skipping arguments from the cache key, refreshing TTL on each access, and choosing alternative cache implementations via the cache_class parameter.

Use it for

  • Cache expensive database queries or API calls in web applications to reduce latency and load.
  • Memoize computationally intensive calculations in data processing pipelines with automatic expiration.
  • Speed up async coroutines by caching results across multiple concurrent requests with TTL-based invalidation.
  • Reduce redundant function calls in long-running services where results are valid for a limited time window.
  • Implement request-level or session-level caching in frameworks without external cache infrastructure.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

OneCache is a solid choice for lightweight, decorator-based caching in Python applications. It has zero runtime dependencies, is actively maintained, supports modern Python versions (3.8–3.14), carries no security vulnerabilities, and works seamlessly with both sync and async code. Install it if you need simple LRU caching with optional TTL and don't want to manage an external cache service.

Install

onecache on PyPI

Before you install

Low install friction with no runtime dependencies. Actively maintained as of 2026-02-20, tested across CPython 3.8–3.14 and PyPy 3.9 on Linux, macOS, and Windows.

Requires Python 3.8 or later; max_mem_size parameter is ignored on PyPy due to JIT compilation.

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

from onecache import CacheDecorator, AsyncCacheDecorator

@CacheDecorator(maxsize=512, ttl=None)
def my_function(x):
    return x * 2

@AsyncCacheDecorator(maxsize=512)
async def my_async_function(x):
    return x * 2

Verify before relying

  • Performance characteristics and overhead compared to functools.lru_cache or other caching libraries.
  • Thread safety guarantees when thread_safe=True is enabled.
  • Behavior of refresh_ttl flag and its interaction with concurrent access patterns.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 175 days since the last release
First released
Downloads725,663 / month, #5,220 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPy

Evidence: onecache-0.8.1-py3-none-any.whl

Tags

Capabilities
python function caching decoratorlru cache async syncttl cache with expirationin-memory cache librarydecorator-based caching
Topics
cachinglru-cacheasync-support

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “lru cache async sync”

  • onecacheOneCache provides LRU-based caching decorators for both synchronous…
  • async-lruAn LRU cache decorator for async functions that deduplicates…
  • cachetools-asyncProvides async-aware memoization decorators for Python asyncio…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also async-lru · cachettl · cachetools-async · cacheout · cachetools · asyncache · cache-to-disk · expiring-dict · cachebox · pytest-antilru