SQLite based queryable python indexes for dicts and lists
Project description
LiteIndex
ultra fast, thread and process safe, easily queryable Indexes for Python.
DefinedIndex
from liteindex import DefinedIndex
# Define the schema for the index
schema = {
"name": "",
"age": 0,
"address": {
"street": "",
"city": "",
"country": ""
}
}
# Create a DefinedIndex instance
index = DefinedIndex(name="people", schema=schema) #optional: db_path="path to a file" #auto_key=False or True.
# Insert or update a single item in the index if auto_key=False (default)
index.set(user_name, {
"name": "Alice",
"password": "xxxjjssjsjsjsksk",
"age": 30,
"address": {
"street": "123 Main St",
"city": "New York",
"country": "USA"
}
})
# If auto_key=True
integer_id = index.add({
"name": "Alice",
"password": "xxxjjssjsjsjsksk",
"age": 30,
"address": {
"street": "123 Main St",
"city": "New York",
"country": "USA"
}
})
# Set full or partial value for a key
index.set(key, value)
# Set value for a key
index.set((key, sub_key), value)
# Get value of a key
index.get(key)
# Get value of a sub key
index.get(key, sub_key)
# index.search()
# index.count()
# index.delete()
# index.drop()
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.dev17.tar.gz
(15.4 kB
view hashes)
Built Distribution
Close
Hashes for liteindex-0.0.1.dev17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2081361166ad316d33f6b0f9091fe07f4a3549b85680a7a604498ee83d8a04c8 |
|
MD5 | 11d5b633774baa4502b4382da7c1e676 |
|
BLAKE2b-256 | 05affcc6bb9a9e8be47d7f2a0d129d4a5ff6493f468b4a7fca3fc6dd5f92f811 |