atikin-cache


Nameatikin-cache JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/atikinverse/atikin-cache
SummaryHigh-performance in-memory caching library with TTL, LRU eviction, and persistence.
upload_time2025-08-29 06:35:04
maintainerNone
docs_urlNone
authorAtikin Verse
requires_python>=3.7
licenseNone
keywords cache caching memory ttl lru performance atikin cache
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ๐Ÿ“ฆ Atikin-Cache

> โšก High-performance in-memory caching library with **TTL**, **LRU eviction**, **thread-safety**, and **persistence**. Created By: Atikin Verse.

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Python](https://img.shields.io/badge/python-3.7+-brightgreen.svg)]()
[![Tests](https://img.shields.io/badge/tests-passing-brightgreen.svg)]()
[![Made by Atikin Verse](https://img.shields.io/badge/made%20by-Atikin%20Verse-ff69b4.svg)](https://github.com/atikinverse)

---

## ๐Ÿš€ 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

```bash
pip install atikin-cache
```

Or install from source:

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

---

## ๐Ÿ“– Usage

### ๐Ÿ”น Basic Example

```python
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

```python
# 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:

```bash
python -m unittest discover tests
```

Run the example:

```bash
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](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 |

---

<div align="center">  
Made with โค๏ธ by <b>Atikin Verse</b> ๐Ÿš€  
</div>  

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/atikinverse/atikin-cache",
    "name": "atikin-cache",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "cache caching memory ttl lru performance atikin cache",
    "author": "Atikin Verse",
    "author_email": "atikinverse@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/99/a0/064f5e63dc1a5c256448d5cddc52c12c819239318c52404b5449e1d9d269/atikin-cache-1.0.0.tar.gz",
    "platform": null,
    "description": "# \ud83d\udce6 Atikin-Cache\r\n\r\n> \u26a1 High-performance in-memory caching library with **TTL**, **LRU eviction**, **thread-safety**, and **persistence**. Created By: Atikin Verse.\r\n\r\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\r\n[![Python](https://img.shields.io/badge/python-3.7+-brightgreen.svg)]()\r\n[![Tests](https://img.shields.io/badge/tests-passing-brightgreen.svg)]()\r\n[![Made by Atikin Verse](https://img.shields.io/badge/made%20by-Atikin%20Verse-ff69b4.svg)](https://github.com/atikinverse)\r\n\r\n---\r\n\r\n## \ud83d\ude80 Features\r\n\r\n* \u23f3 **Time-to-live (TTL):** Automatic expiration of cached items\r\n* \ud83d\udd04 **LRU eviction:** Least Recently Used items removed when cache is full\r\n* \ud83e\uddf5 **Thread-safe:** Safe for multi-threaded applications\r\n* \ud83d\udcbe **Persistence:** Save and load cache data from disk\r\n* \u26a1 **High performance:** O(1) read/write operations, minimal overhead\r\n\r\n---\r\n\r\n## \ud83d\udce5 Installation\r\n\r\n```bash\r\npip install atikin-cache\r\n```\r\n\r\nOr install from source:\r\n\r\n```bash\r\ngit clone https://github.com/atikinverse/atikin-cache.git\r\ncd atikin-cache\r\npip install .\r\n```\r\n\r\n---\r\n\r\n## \ud83d\udcd6 Usage\r\n\r\n### \ud83d\udd39 Basic Example\r\n\r\n```python\r\nfrom atikin_cache import AtikinCache\r\n\r\n# Create cache with max 1000 items and 5-minute default TTL\r\ncache = AtikinCache(maxsize=1000, default_ttl=300)\r\n\r\n# Set a value\r\ncache.set('user:123', {'name': 'John', 'email': 'john@example.com'})\r\n\r\n# Get a value\r\nuser = cache.get('user:123')\r\nprint(user)  # {'name': 'John', 'email': 'john@example.com'}\r\n\r\n# Custom TTL\r\ncache.set('temp:data', 'temporary', ttl=10)  # 10 seconds\r\n\r\n# Check existence\r\nif cache.exists('user:123'):\r\n    print(\"User exists in cache\")\r\n\r\n# Delete key\r\ncache.delete('user:123')\r\n\r\n# Clear cache\r\ncache.clear()\r\n```\r\n\r\n---\r\n\r\n### \ud83d\udd39 Persistent Cache\r\n\r\n```python\r\n# Create cache with persistence\r\ncache = AtikinCache(persist_path='/path/to/cache.dat')\r\n\r\n# Store data\r\ncache.set('key', 'value')\r\n\r\n# Save to disk\r\ncache.save_to_disk()\r\n\r\n# Load from disk\r\ncache.load_from_disk()\r\n```\r\n\r\n---\r\n\r\n## \ud83e\uddea Testing\r\n\r\nRun the full test suite:\r\n\r\n```bash\r\npython -m unittest discover tests\r\n```\r\n\r\nRun the example:\r\n\r\n```bash\r\npython examples/basic_usage.py\r\n```\r\n\r\n---\r\n\r\n## \u26a1 Performance\r\n\r\n* **O(1)** for get, set, delete operations\r\n* Optimized for minimal locking in multi-threaded environments\r\n* Efficient memory usage with **LRU eviction**\r\n\r\n---\r\n\r\n## \ud83d\udcc4 License\r\n\r\nThis project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.\r\n\r\n---\r\n\r\n## \ud83c\udf10 Follow Us\r\n\r\n| Platform  | Username    |\r\n| --------- | ----------- |\r\n| Facebook  | atikinverse |\r\n| Instagram | atikinverse |\r\n| LinkedIn  | atikinverse |\r\n| Twitter/X | atikinverse |\r\n| Threads   | atikinverse |\r\n| Pinterest | atikinverse |\r\n| Quora     | atikinverse |\r\n| Reddit    | atikinverse |\r\n| Tumblr    | atikinverse |\r\n| Snapchat  | atikinverse |\r\n| Skype     | atikinverse |\r\n| GitHub    | atikinverse |\r\n\r\n---\r\n\r\n<div align=\"center\">  \r\nMade with \u2764\ufe0f by <b>Atikin Verse</b> \ud83d\ude80  \r\n</div>  \r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "High-performance in-memory caching library with TTL, LRU eviction, and persistence.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/atikinverse/atikin-cache"
    },
    "split_keywords": [
        "cache",
        "caching",
        "memory",
        "ttl",
        "lru",
        "performance",
        "atikin",
        "cache"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5b9e7dc6fd741f2b83486f4e577658039097081643187b2da020c2bd481eb77b",
                "md5": "2e1d1c474da90aae246e30bd16a72d28",
                "sha256": "34c0c0764395789dbbf13cf4a957fe2f117602323e66f0862390dc8304dada13"
            },
            "downloads": -1,
            "filename": "atikin_cache-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2e1d1c474da90aae246e30bd16a72d28",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8245,
            "upload_time": "2025-08-29T06:35:02",
            "upload_time_iso_8601": "2025-08-29T06:35:02.772168Z",
            "url": "https://files.pythonhosted.org/packages/5b/9e/7dc6fd741f2b83486f4e577658039097081643187b2da020c2bd481eb77b/atikin_cache-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "99a0064f5e63dc1a5c256448d5cddc52c12c819239318c52404b5449e1d9d269",
                "md5": "d58f047ac3676779d4ec02bd556c38a2",
                "sha256": "82aefca89fdf5769d05643e70e6e1463b8984daf58f77770ece9d896cd11decd"
            },
            "downloads": -1,
            "filename": "atikin-cache-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d58f047ac3676779d4ec02bd556c38a2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6942,
            "upload_time": "2025-08-29T06:35:04",
            "upload_time_iso_8601": "2025-08-29T06:35:04.072676Z",
            "url": "https://files.pythonhosted.org/packages/99/a0/064f5e63dc1a5c256448d5cddc52c12c819239318c52404b5449e1d9d269/atikin-cache-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-29 06:35:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "atikinverse",
    "github_project": "atikin-cache",
    "github_not_found": true,
    "lcname": "atikin-cache"
}
        
Elapsed time: 1.47025s