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.dev24.tar.gz
(15.8 kB
view hashes)
Built Distribution
Close
Hashes for liteindex-0.0.1.dev24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ec533f943a01c0d54cf5b3cde1d3c870388e2ca3c86d31206e4cf5e6b4adeb3 |
|
MD5 | 86a589dc7b2ac37b9e13da0884cb12ec |
|
BLAKE2b-256 | e8f84c92fcc59449427de05525986e5e6ef3fb0cf2ab28e4ce806a7bc6751454 |