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)
Built Distribution
Close
Hashes for liteindex-0.0.1.dev25-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00024eecbda2753a39616a45c6ea8959cc3effe09206b30460a8ccb5cacc9156 |
|
MD5 | 10c7ef9b490711412464179232b55bf3 |
|
BLAKE2b-256 | a7962a22521837903ee83ba35a2d6503729c7d42f6564e79f561c848a361c505 |