Skip to main content

python object database

Project description

podb

Build Status Maintainability

(p)ython (o)bject (d)ata(b)ase

thread safe, file based, redis style database for python objects

reasons not to use this

  • you want a database cluster
  • you have multiple millions or billions of database entries and limited storage space
  • you need relationships / multiple tables

reasons to use this

functions

  • find
  • find_one
  • find_after
  • find_before
  • find_by_uuid
  • find_contains
  • find_startswith
  • find_endswith
  • insert
  • insert_many
  • update
  • update_many
  • upsert
  • upsert_many
  • size
  • contains
  • columns
  • drop
  • remove / delete
  • remove_by_uuid / delete_by_uuid
  • delete_before
  • all

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


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.47.tar.gz (6.8 kB view details)

Uploaded Source

File details

Details for the file podb-1.47.tar.gz.

File metadata

  • Download URL: podb-1.47.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for podb-1.47.tar.gz
Algorithm Hash digest
SHA256 faeccb02412c637f7a98f9f0bb9dfbdb134e75eb21b4cfb6e45d7d8bc8ed4280
MD5 d7e6907f15541be8a4538eb76700386f
BLAKE2b-256 cad995f44089e1d33ee954b98d26530af974aa67fbe98270e40f4dec8de7ffb1

See more details on using hashes here.

Supported by

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