Epochly

raw JSON →
0.5.73 verified Fri May 01 auth: no python

Epochly is a transparent performance optimization library for Python applications that provides automatic caching, memoization, and profiling. Version 0.5.73 supports Python >=3.9 and is actively maintained. Release cadence is weekly with frequent minor updates.

pip install epochly
error AttributeError: module 'epochly' has no attribute 'Epochly'
cause Old import pattern `import epochly` does not expose Epochly directly.
fix
Use from epochly import Epochly.
error TypeError: 'NoneType' object is not callable
cause Using `@Epochly.cache` without instantiating the class first.
fix
Initialize with e = Epochly() then @e.cache.
gotcha The `Epochly` class must be instantiated before using the `@Epochly.cache` decorator or a `TypeError` occurs.
fix Always create an instance: `e = Epochly()`. Then use `@e.cache`.
deprecated The `profile` function is deprecated in version 0.5.70+; use `Epochly.profile` instead.
fix Replace `from epochly import profile` with `from epochly import Epochly` and use `@Epochly.profile`.
gotcha Cached functions are not thread-safe by default. Concurrent calls may corrupt cache state.
fix Use `Epochly(cache_concurrency=True)` for thread-safe caching.

Basic usage: apply caching via decorator.

from epochly import Epochly

# Initialize with a config (optional)
e = Epochly()

@Epochly.cache
def expensive_function(x):
    return x * x

result = expensive_function(4)
print(result)