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
or
from odeta import localbase
Initializing the Database and create a table in it.
db = database("my_database.db")
# or db = localbase("my_database.db")
users = db("users")
Fetching Data
Fetch all records from the table:
# Fetch records by ID
print(users.get("this_is_the_id"))
# Fetch all records
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
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
odeta-0.1.36.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odeta-0.1.36.tar.gz.
File metadata
- Download URL: odeta-0.1.36.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebb6b48f8b11b93fa7c0fc291239d62ea27a505951ec137fb8005d4d7472fd60
|
|
| MD5 |
6bb87d0d4da6299d6c03a4fe46a7862a
|
|
| BLAKE2b-256 |
17c9beb116c5b772f9cf081ecbca815363f9404901fcb3aeea88f8cd09da1b43
|
File details
Details for the file odeta-0.1.36-py3-none-any.whl.
File metadata
- Download URL: odeta-0.1.36-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a1b31d8dbd4044d3724990818e94e551c2e0bb529e0467661053311cfb8e06f
|
|
| MD5 |
b7458475a41467ad9115c3ed6f76f13b
|
|
| BLAKE2b-256 |
255ce596b960dbe2ee7976abe4c7a1abb6682634f30160bdd378e58b1887061b
|