Skip to main content

Key value caching machanism with backends: disk, Sqlite, Redis, MySQL, PostgreSQL.

Project description

jmstorage

Unit Tests JMStorage on PyPI

Thread safe key:value storage with multiple back-end options.

Install

pip install jmstorage

Storage Options

  1. disk(local file system)
    • Currently, this is the only supported option.
    • This is thread safe as the library acquires a thread lock during write operations.
  2. Redis
    • In Development, will update as it becomes available.
  3. Sqlite
    • In Development, will update as it becomes available.
  4. MySQL
    • In Development, will update as it becomes available.
  5. PostgreSQL
    • In Development, will update as it becomes available.

How to Use

from jmstorage import Cache

c = Cache(namespace="namespace-value", path="./path_to_local_disk_file/")

# Set Value
c.set("my_key", "my_value")

# Read Value
my_val = c.get("my_key")
# > "my_value"

# Pop Value
my_val = c.pop("my_key")
# > "my_value"
c.get("my_key")
# > None


# Delete Value
c.delete("my_key")
c.get("my_key")
# > None

# Truncate Storage
c.truncate()
c.get("my_key")
# > None

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jmstorage-0.0.1.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

jmstorage-0.0.1-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page