Skip to main content

SQLite based queryable python indexes for dicts and lists

Project description

LiteIndex

fast, thread and process safe, easily queryable Indexes for Python.

DefinedIndex

Initialize the DefinedIndex.

  • if db_path defaults to in-memory.
from liteindex import DefinedIndex

# Define the schema for the index
schema = {
    "name": "",
    "age": 0,
    "password": "",
    "verified": False
}

# Create a DefinedIndex instance
index = DefinedIndex(name="people", schema=schema, db_path="./test.liteindex")

Set, Delete

# set can be partial or full, can be an existing key or new key.
index.set("alice", {
    "name": "Alicee",
    "password": "xxxjjssjsjsjsksk",
    "age": 30
})

# Set value for a sub key
index.set(("alice", "name"), "Alice")

# Same as
index.set("alice", {"name": "Alice"})

# Get value of a key
index.get("alice")

# Get value of a sub key
index.get("alice", "name")

# Delete

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

liteindex-0.0.1.dev25.tar.gz (15.8 kB view hashes)

Uploaded Source

Built Distribution

liteindex-0.0.1.dev25-py3-none-any.whl (17.2 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