Skip to main content

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)

# Insert or update a single item in the index
index.set("1", {
    "name": "Alice",
    "age": 30,
    "address": {
        "street": "123 Main St",
        "city": "New York",
        "country": "USA"
    }
})

# Query the index to retrieve items based on certain conditions
# (e.g., age >= 25, city = "New York")
query = {
    "age": (">=", 25),
    "address": {
        "city": "New York"
    }
}
results = index.search(query)

for result in results:
    print(f"ID: {result['id']}, Name: {result['name']}, Age: {result['age']}, Address: {result['address']}")

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.dev7.tar.gz (11.9 kB view hashes)

Uploaded Source

Built Distribution

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