Skip to main content

Key-Value interface over SQLite. Supports any datatype, including JSON and BLOB

Project description

Sqlite Kv

Async Key-Value interface over SQLite. Supports any datatype, including JSON and BLOB

Usage

Simplest is to use the SQKliteKV api

  • JSON documents

    from sqlite_kv import SQLiteKV
    
    api = await SQLiteKV.documents(db_path='mydb.sqlite', table='myjsons')
    # or, if you're sure the DB file already exists
    api = SQLiteKV.documents(db_path='mydb.sqlite', table='myjsons', create=False)
    await api.upsert('my-doc', dict(hello='world'))
    await api.read('my-doc') # dict(hello='world')
    
  • BLOBs

    from sqlite_kv import SQLiteKV
    
    api = await SQLiteKV.blobs(db_path='mydb.sqlite', table='myblobs')
    await api.upsert('my-image', b'<super big image>')
    await api.read('my-image') # b'...'
    
  • Any custom datatype (e.g. JSON, but manually)

    import json
    from sqlite_kv import SQLiteKV
    
    api = await SQLiteKV.new(
      db_path='mydb.sqlite', table='my-jsons',
      dtype='JSON', parse=json.loads, dump=json.dumps
    )
    await api.upsert('my-image', dict(hello='world'))
    await api.read('my-image') # dict(hello='world')
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kv-sqlite-sync-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

kv_sqlite_sync-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file kv-sqlite-sync-0.1.0.tar.gz.

File metadata

  • Download URL: kv-sqlite-sync-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for kv-sqlite-sync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b9b43c958ae9cdeba349c71c36ac13d64c053200fbad9a99dc7e3ce9ea1045eb
MD5 0b357b2d65ba4f111fabd45000bb3683
BLAKE2b-256 b7d7ba0ccfaf5b8f49b7e9ed87883dde9266ac5a3b2e48ce2bc51cb1ada887f1

See more details on using hashes here.

File details

Details for the file kv_sqlite_sync-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kv_sqlite_sync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4294205768d8e2de12d940058bd51d4f2a72afa19415042c47e8c573cc0ef22
MD5 d435b0cc825cae78ed373c6321064793
BLAKE2b-256 0c296d6efba60a84d47ca9b697df4fa83f6aa32023e68d63c93569dd49805c8a

See more details on using hashes here.

Supported by

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