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.dev23.tar.gz
(15.8 kB
view hashes)
Built Distribution
Close
Hashes for liteindex-0.0.1.dev23-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92e29244bd6a50c205de81e9ecb0a0f34bba1165b0b884db5ee41f0149506719 |
|
MD5 | 21fb1813222b812de61fa7c6aeb2d507 |
|
BLAKE2b-256 | ae111a4d27c6c5e3bef2965556389862b0445a9648575ce1e6d8ff31e0867ef8 |