Skip to main content

📦 Atikin-Cache

⚡ High-performance in-memory caching library with TTL, LRU eviction, thread-safety, and persistence. Created By: Atikin Verse.

License Python Tests Made by Atikin Verse


🚀 Features

  • ⏳ Time-to-live (TTL): Automatic expiration of cached items
  • 🔄 LRU eviction: Least Recently Used items removed when cache is full
  • 🧵 Thread-safe: Safe for multi-threaded applications
  • 💾 Persistence: Save and load cache data from disk
  • ⚡ High performance: O(1) read/write operations, minimal overhead

📥 Installation

pip install atikin-cache

Or install from source:

git clone https://github.com/atikinverse/atikin-cache.git
cd atikin-cache
pip install .

📖 Usage

🔹 Basic Example

from atikin_cache import AtikinCache

# Create cache with max 1000 items and 5-minute default TTL
cache = AtikinCache(maxsize=1000, default_ttl=300)

# Set a value
cache.set('user:123', {'name': 'John', 'email': 'john@example.com'})

# Get a value
user = cache.get('user:123')
print(user)  # {'name': 'John', 'email': 'john@example.com'}

# Custom TTL
cache.set('temp:data', 'temporary', ttl=10)  # 10 seconds

# Check existence
if cache.exists('user:123'):
    print("User exists in cache")

# Delete key
cache.delete('user:123')

# Clear cache
cache.clear()

🔹 Persistent Cache

# Create cache with persistence
cache = AtikinCache(persist_path='/path/to/cache.dat')

# Store data
cache.set('key', 'value')

# Save to disk
cache.save_to_disk()

# Load from disk
cache.load_from_disk()

🧪 Testing

Run the full test suite:

python -m unittest discover tests

Run the example:

python examples/basic_usage.py

⚡ Performance

  • O(1) for get, set, delete operations
  • Optimized for minimal locking in multi-threaded environments
  • Efficient memory usage with LRU eviction

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🌐 Follow Us

Platform Username
Facebook atikinverse
Instagram atikinverse
LinkedIn atikinverse
Twitter/X atikinverse
Threads atikinverse
Pinterest atikinverse
Quora atikinverse
Reddit atikinverse
Tumblr atikinverse
Snapchat atikinverse
Skype atikinverse
GitHub atikinverse

Made with ❤️ by Atikin Verse 🚀

Metadata

Release files for atikin-cache 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atikin-cache 1.0.0
File Size Uploaded
atikin-cache-1.0.0.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atikin-cache 1.0.0
File Interpreter ABI Platform
atikin_cache-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.2 kB

Release files / atikin-cache-1.0.0.tar.gz

Download URL atikin-cache-1.0.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
82aefca89fdf5769d05643e70e6e1463b8984daf58f77770ece9d896cd11decd
BLAKE2b-256 checksum
How to use checksums
99a0064f5e63dc1a5c256448d5cddc52c12c819239318c52404b5449e1d9d269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.0

Release files / atikin_cache-1.0.0-py3-none-any.whl

Download URL atikin_cache-1.0.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34c0c0764395789dbbf13cf4a957fe2f117602323e66f0862390dc8304dada13
BLAKE2b-256 checksum
How to use checksums
5b9e7dc6fd741f2b83486f4e577658039097081643187b2da020c2bd481eb77b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.0

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page