python object database
Project description
thread safe redis style database for python objects
reasons to use this
thread safe
stores python objects
filters, see below
inserting 200 objects takes ~0.0003 seconds (i7-4702MQ)
size of db with 800 objects is ~600kB
functions
find
find_one
find_after
find_before
find_by_uuid
insert
insert_many
update
update_many
upsert
upsert_many
size
contains
requirements
None
example
from podb import DB, DBEntry
class Company(DBEntry):
def __init__(self, name: str):
DBEntry.__init__(self)
self.name = name
class Customer(DBEntry):
def __init__(self, first_name: str, last_name: str, age: int, height: float, companies: list[DBEntry]):
DBEntry.__init__(self)
self.first_name = first_name
self.last_name = last_name
self.age = age
self.height = height
self.companies = companies
db = DB("customers")
c0 = Customer("Jeff", "Bezoz", 42, 1.69,
[Company("Whole Foods"), Company("Zappos"),
Company("Ring"), Company("twitch")])
db.insert(c0)
c0 = db.find_one({
"first_name": "Jeff",
"last_name": "Bezoz"
})
c0.companies.append(Company("Audible"))
db.update(c0)
installation
pip3 install podb
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
podb-1.33.7.tar.gz
(3.2 kB
view details)
File details
Details for the file podb-1.33.7.tar.gz
.
File metadata
- Download URL: podb-1.33.7.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0930b8fa149d94ea28ee615da373f350b1f0d706693f1f0f764356aad83170c2 |
|
MD5 | 8547084ac699ae0ab9d2cee14d693a40 |
|
BLAKE2b-256 | e6ceb6a2fdd91d45a90541894fc319fb1f8547782692e5a37a3d9c3eb0f93115 |