Installation

Requirements

  • Python 3.9 or higher

  • Optional: Redis server for Redis-based backends

Quick Install

To install Nicolas Cache, run this command in your terminal:

$ pip install nicolas

This will install the package with all core dependencies including Redis support.

From Sources

The sources for Nicolas Cache can be downloaded from the Github repo.

Clone the public repository:

$ git clone https://github.com/wickeddoc/nicolas-cache.git
$ cd nicolas-cache
$ pip install -e .

Development Installation

For development with all tools:

$ pip install -e ".[dev]"

This includes pytest, coverage, mypy, ruff, and other development tools.

Backend Requirements

Memory Backend (no additional requirements):

from nicolas.cache import Cache
cache = Cache(backend="memory")

Redis Backend (requires Redis server):

# Install Redis (Ubuntu/Debian)
$ sudo apt-get install redis-server

# Or with Docker
$ docker run -d -p 6379:6379 redis:7-alpine

Redis Sentinel (for high availability):

cache = Cache(
    backend="redis-sentinel",
    sentinels=[("localhost", 26379)],
    service_name="mymaster"
)

Verify Installation

import nicolas
print(f"Version: {nicolas.__version__}")

from nicolas.cache import Cache
cache = Cache(backend="memory")
cache.set("test", "value")
assert cache.get("test") == "value"