Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Documentation Status Build Status Code Coverage

Pythonic, unified API to multiple key-value stores.

This base package includes:

Support for additional storage system is by packages distributed separately:

  • indicium-git.

  • indicium-ldap.

  • indicium-leveldb (planned, not yet available).

  • indicium-memcache (planned, not yet available).

Usage

Create a Store which saves content on-disk, using JSON for serialization, and store somwthing that resembles an user account:

from indicium.base import Serializer
import json

filestore = Serializer(FSStore("./data", extension=".json"), pickle)
filestore.put("/user/jdoe", { "id": "jdoe", "name": "John Doe",
        "email": "j@doe.org", "password": "supersekrit" })
account = filestore.get("/user/jdoe")
assert account["email"] == "j@doe.org"

The ./data/user/jdoe.json will contain the account data in JSON format. The following adds an in-memory cache to the above store, which holds up to 100 elements, to speed up access to data:

from indicium.cache import LRUCache

cachedstore = LRUCache(filestore, size=100)
account = cachedstore.get("/user/jdoe")
assert account["email"] == "j@doe.org"

Once you have a collection of objects, you can run use queries to retrieve all the elements whose keys match a certain pattern. For example, this obtains the user accounts with an identifier starting with the letter j from the store above:

for key, account cachedstore.query("/user/j*"):
    print(account["id"], account["name"])

Installation

All stable releases are uploaded to PyPI, so you can install them and upgrade using pip:

pip install indicium

Alternatively, you can install the latest development code —at your own risk— directly from the Git repository:

pip install git://github.com/aperezdc/indicium

Development

If you want to contribute, please use the usual GitHub workflow:

  1. Clone the repository.

  2. Hack on your clone.

  3. Send a pull request for review.

If you do not have programming skills, you can still contribute by reporting issues that you may encounter. Contributions to the documentation are very welcome, too!

Inspiration

  • Park

  • datastore (unfortunately, it does not support Python 3.x).

Metadata

Release files for indicium 0.1.0a3

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

Source distribution (sdist)

Source distribution for indicium 0.1.0a3
File Size Uploaded
indicium-0.1.0a3.tar.gz 11.3 kB Details

Release files / indicium-0.1.0a3.tar.gz

Download URL indicium-0.1.0a3.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
294e491e93e853dd4bc1358042be5f863c20b2c1d2c8ed7690095f22256200d0
BLAKE2b-256 checksum
How to use checksums
fdffcb7ed6c19be11d39644af4f9ae2235c3ccef1187ef0d4d80760404fd8be1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
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