{"id":24513,"library":"redislite","title":"redislite","description":"redislite embeds a Redis server into a Python package, allowing you to run Redis without a separate server process. Current version 6.2.912183 supports Python >=3.8.0 and is actively maintained. It provides a drop-in replacement for redis-py's StrictRedis and Redis classes.","status":"active","version":"6.2.912183","language":"python","source_language":"en","source_url":"https://github.com/yahoo/redislite","tags":["redis","embedded","testing","development"],"install":[{"cmd":"pip install redislite","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"redislite replaces the standard redis-py client; importing from redis will not use the embedded server.","wrong":"from redis import StrictRedis","symbol":"StrictRedis","correct":"from redislite import StrictRedis"},{"note":"Same as above; always import from redislite to get the embedded server behavior.","wrong":"from redis import Redis","symbol":"Redis","correct":"from redislite import Redis"}],"quickstart":{"code":"from redislite import StrictRedis\n\n# Creates a Redis instance with an embedded server; data stored in a temp file\nr = StrictRedis()\nr.set('foo', 'bar')\nprint(r.get('foo'))  # b'bar'\n\n# Custom path for persistence\nr2 = StrictRedis('mydata.db')\nr2.set('key', 'value')","lang":"python","description":"Create a Redis client with an embedded server. The first argument is an optional path to a database file."},"warnings":[{"fix":"Initialize with parameters directly: `StrictRedis(host='localhost', port=6379)` or use `StrictRedis()` for embedded server.","message":"In redislite, the `from_url` classmethod is not available. Use `StrictRedis.from_url()` does not exist; configure via constructor arguments instead.","severity":"breaking","affected_versions":"all"},{"fix":"Use standard redis-py with a real Redis server if you need Sentinel or Cluster.","message":"redislite does not support Redis Sentinel or Redis Cluster. Trying to use sentinel-related classes will fail or behave unexpectedly.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to Python >=3.8 or pin redislite to <6.0.0.","message":"Python 3.7 and earlier are no longer supported in redislite >=6.0.0.","severity":"deprecated","affected_versions":">=6.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install redislite`.","cause":"redislite is not installed.","error":"ModuleNotFoundError: No module named 'redislite'"},{"fix":"Use `from redislite import Redis`.","cause":"Import error: using `import redislite` and then `redislite.Redis` instead of `from redislite import Redis`.","error":"AttributeError: module 'redislite' has no attribute 'Redis'"},{"fix":"Pass a file path string as the first argument to persist data, or use no argument for a temporary database.","cause":"Passing a Redis database number (e.g., db=0) to the constructor, which is not supported.","error":"ValueError: The 'db' argument is not supported by redislite. Use a file path."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}