Skip to main content

A simple NoSQL-like interface for SQLite

Project description

Odeta

A simple NoSQL-like interface for SQLite.

Installation

pip install odeta

Usages

Importing the Library

from odeta import database

Initializing the Database and create a table in it.

db = database("my_database.db")
users = db("users")

Fetching Data

Fetch all records from the table:

print(users.fetch())

Fetch records that match a specific query:

print(users.fetch({"name": "Bob Johnson"}))

print(users.fetch({"name?contains": "Bob"}))

# for all the records with OR condition
print(users.fetchall({"name?contains": "Bob", "age" : 30}))

# for all the records with AND condition
print(users.fetch({"name?contains": "Bob", "age" : 30}))

Inserting Data

Insert a new record into the table:

new_user_id = users.put({"name": "Alice Smith", "age": 30})
print(new_user_id)

Updating Data

Update an existing record in the table:

users.update({"name": "Alice Johnson", "age": 31}, new_user_id)

Deleting Data

Delete a record from the table:

users.delete(new_user_id)

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

odeta-0.1.33.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.

odeta-0.1.33-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file odeta-0.1.33.tar.gz.

File metadata

  • Download URL: odeta-0.1.33.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.2

File hashes

Hashes for odeta-0.1.33.tar.gz
Algorithm Hash digest
SHA256 80e63a257748af587d8f1ba08eb0444dffd634aca599f5e193242a509cbbe585
MD5 560410beb6cf22ddbc6c1f3398cdb876
BLAKE2b-256 0584c1ce2632879fa5e9dec586b6c21cf8b9840e5e4cc682df235d99a591b204

See more details on using hashes here.

File details

Details for the file odeta-0.1.33-py3-none-any.whl.

File metadata

  • Download URL: odeta-0.1.33-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.2

File hashes

Hashes for odeta-0.1.33-py3-none-any.whl
Algorithm Hash digest
SHA256 89779ab3a45e793f2c494ec6e6e9930dad51f6cf55ccbfa648b3ea46d88fc9e4
MD5 88a82abb4d58f8b0f249b494a1969994
BLAKE2b-256 054a332d35ba4f99148cf746426f25c09de771b5a3a933f58b64c948e89c50e7

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