Skip to main content

podb

Build Status Maintainability

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

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

it really just is shelve with a hat on

reasons not to use this

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

reasons to use this

  • pure python
  • cross-platform (Tested: Windows & Linux)
  • fast
    • inserting 200 objects takes
      • ~0.0003 seconds (i7-4702MQ)
      • ~0.0001 seconds (Ryzen 9 3900xt)
    • 8-8.3k inserts per second (Ryzen 7 2700X)
    • 19k inserts per second (Ryzen 9 3900xt)
  • thread safe
  • stores python objects
  • filters, see below
  • ~180 loc

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
  • delete
  • delete_by_uuid
  • delete_before
  • get_all
  • get_random
  • get_random_list

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

Metadata

Release files for podb 1.51

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for podb 1.51
File Size Uploaded
podb-1.51.tar.gz 7.0 kB Details

Release files / podb-1.51.tar.gz

Download URL podb-1.51.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4c1d886cdaf7dc6115fa1a97e2c1d4062721576e030c4ad1ce32a0cb6c93b301
BLAKE2b-256 checksum
How to use checksums
e537074ef58afa175b2af3bdc6723bf2da5cc81c67fe224afa8ecfea2f0332e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

1.51 This release

1 release file

1.50

1 release file

1.49

1 release file

1.48

1 release file

1.47

1 release file

1.46

1 release file

1.45

1 release file

1.44

1 release file

1.42.3

1 release file

1.42.2

1 release file

1.42.1

1 release file

1.42.0

1 release file

1.33.9

1 release file

1.33.8

1 release file

1.33.7

1 release file

1.5

1 release file

0.69

1 release file

0.42

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page