Skip to main content

SQLite based queryable python indexes for dicts and lists

Project description

LiteIndex

in-process, thread and process safe, easy to use, query-able object storage implenetation for Python

Some use cases, benchmarks and examples:

  • cache for a python function
  • store and query large number of records without using up memory
  • ultra-fast, query-able file storage (faster than creating files on disk and way better for querying)
  • exchange data between threads or processes easily
  • store application data locally in easy to query and stable format
  • Trigger threads/ processes with your custom functions on any specific updates or deletes (combined with gevent or ray, this allows for a extremely easy to use and deploy sqs + lambda like pipeline)
  • easily import from csv, tsv, jsonl, any iterable and run queries
pip install --upgrade liteindex

DefinedIndex

  • Documentation
  • schema has to be specified when creating a new DefinedIndex
  • Any python object can be stored in DefinedIndex
  • Query language is copy of mongodb queries. All queries are documented.
  • Querying can be done on string, number, boolean, json, datetime fields.
  • Math can be done on number fields
  • blob values can be queried for equality (same file), size.
  • other values can only be set, deleted, updated. Cannot be queried upon.
  • Insertion order is preserved
from liteindex import DefinedIndex

user_details_schema = {
    "name": "string",
    "age": "number",
    "password": "string",
    "verified": "boolean",
    "address_details": "json",
    "profile_picture": "blob",
    "tag_line": "string",
    "tag_line_embedding": "other",
    "birth_day": "datetime"
}

# db path defaults to memory
index = DefinedIndex(
            name="user_details",
            schema=schema,
            db_path="./test_db.liteindex"
        )

AnyIndex (In development)

  • Like mongodb, any python dict can be inserted at run time
  • Doesn't need pre-defined structure unlike DefinedIndex

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.2.dev11.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

liteindex-0.0.2.dev11-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file liteindex-0.0.2.dev11.tar.gz.

File metadata

  • Download URL: liteindex-0.0.2.dev11.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for liteindex-0.0.2.dev11.tar.gz
Algorithm Hash digest
SHA256 f4b97f91d349809c2b7b0f54af6b146b87aff7b1f01995bf080ce8da130be244
MD5 cb37ea56ac6d0955e8533844aa752c11
BLAKE2b-256 509ad9e420c9df32d6a53b0557506aaf37c7d2f0613884c343966a39f6edf9e4

See more details on using hashes here.

File details

Details for the file liteindex-0.0.2.dev11-py3-none-any.whl.

File metadata

File hashes

Hashes for liteindex-0.0.2.dev11-py3-none-any.whl
Algorithm Hash digest
SHA256 2895473df832c6db9fc86ce4020ea48e9824638dee519dbfa932cac49c85de66
MD5 67ea641a1a34c00585e8033865855e90
BLAKE2b-256 c8a8f23d776571fa26350e8dfd38ae3a91bf37da46f290e6af4904575e6ddcd2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page