Skip to main content

Lightweight SQLite toolkit with schema enforcement, lambda queries, and row-level operations

Project description

microdatabase

microdatabase is a lightweight SQLite toolkit with schema enforcement, row-level control, and Pythonic querying using lambda functions.

  • Minimal and dependency-free
  • Typed schema via DatabaseParameter
  • Full row object access, with .edit() and .delete()
  • Python-native query filtering (no SQL required)
  • Stores files under a local _databases/ directory

Installation

pip install dbkit

from dbkit import Database, DatabaseParameter, DatabaseParameterType

db = Database("users", [ DatabaseParameter("username", DatabaseParameterType.STRING), DatabaseParameter("age", DatabaseParameterType.INT), DatabaseParameter("active", DatabaseParameterType.BOOLEAN), ])

db.setup()

Insert data

db.add_row(username="Karl", age=53, active=True) db.add_row(username="Lilly", age=17, active=False)

Query

adults = db.query(lambda r: r.age >= 18 and r.active)

for user in adults: print(user.username, user.age)

# Edit a row
user.edit(age=user.age + 1)

# Delete a row
if user.username == "Karl":
    user.delete()

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

microdatabase-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

microdatabase-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file microdatabase-0.1.0.tar.gz.

File metadata

  • Download URL: microdatabase-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for microdatabase-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cbd1977057589a9f821fcdf047075364e604d7dec407f0e794dbe5a6eb1bd2f6
MD5 8bd4a66507fb90a496eea1ec219d92d1
BLAKE2b-256 591d49de006e84a1a5a3540bc16c764e85125e2a6d33f48dbae0365a21116983

See more details on using hashes here.

File details

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

File metadata

  • Download URL: microdatabase-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for microdatabase-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 522d6858751932795350b9c34c4060f85f6e728ad71c0c54296c695bf1417aff
MD5 353b8bbe0a3381f5f97e0f55ba4b788b
BLAKE2b-256 78551e869e395dc78811ddc9cca57f7e8d3dd6b917ba118f85f66c66a97bb895

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