Skip to main content

DBCenter

A real PostgreSQL, embedded in your process. No server to install, no Docker, no connection string to configure - the binaries are fetched once and the database runs as a child process against a directory you choose.

from dbcenter import DBCenter

db = DBCenter(path="./data")
users = db.collection("users")
users.insert_one({"name": "Ada", "age": 36})
print(users.find({"age": {"$gt": 30}}))

Because it is PostgreSQL rather than an imitation of it, the extensions come too. PostGIS and pgvector are downloaded and installed on first use:

db.install_extension("postgis")
db.query("""
    SELECT ST_Distance(
        ST_SetSRID(ST_MakePoint(29.0, 41.0), 4326)::geography,
        ST_SetSRID(ST_MakePoint(32.85, 39.93), 4326)::geography
    ) / 1000 AS km
""")

store = db.vector_store("documents", dimension=1536)
store.add(ids=["a"], embeddings=[[0.1] * 1536])

Fuzzy text search is pg_trgm, which ships with PostgreSQL:

db.collection("cities").fuzzy_search("Istanbu", "name")

What you get

  • A real PostgreSQL. Its planner, its transactions, its types. db.query() takes any SQL, with bound parameters.
  • PostGIS and pgvector, installed on demand. The Linux PostGIS build carries its own GEOS and PROJ, so it works on a machine with nothing installed.
  • A collection API over ordinary relational tables. Columns are added as documents introduce fields.
  • Sync to object storage, optionally: S3, anything S3-compatible, or Google Drive. Tables are written as Parquet, and a lookup reads the row groups it needs rather than the whole file.

Notes

The PostgreSQL distribution is downloaded to ~/.dbcenter on first use, about 60MB, and reused after that. Extension archives are verified against digests pinned in the source, so a substituted one is refused.

PostgreSQL refuses to run as root, so neither can this. In a container that runs as root - which most base images do - create a user first and start the database as them; the error says so if you forget.

Extensions are built per PostgreSQL major version. Asking for one with no published build is an error naming the versions that exist, rather than a download that fails later.

MIT licensed. Source at github.com/heyobi/dbcenter.

Metadata

Release files for dbcenter 0.2.0

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

Built distributions (wheels)

Table of built distributions (wheels) for dbcenter 0.2.0
File Actions
dbcenter-0.2.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for dbcenter-0.2.0-cp38-abi3-win_amd64.whl
dbcenter-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for dbcenter-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
dbcenter-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for dbcenter-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
dbcenter-0.2.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for dbcenter-0.2.0-cp38-abi3-macosx_11_0_arm64.whl
dbcenter-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for dbcenter-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 31.7 MB

Release files / dbcenter-0.2.0-cp38-abi3-win_amd64.whl

Download URL dbcenter-0.2.0-cp38-abi3-win_amd64.whl
Size 6.7 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
fd01271dee0b5d4a81259f59901b90830eb879f8fcc5396c9e0abd93e7e93be3
BLAKE2b-256 checksum
How to use checksums
82c0ff9af6e27ea25b9ea4588f3ee9846d33217b8cd24ec2bb5b4993c363a548
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / dbcenter-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL dbcenter-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.6 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
ad80d2471fa2a7fef8fab879dd472326b560984240e7195ce0a9b96cb7e76e0f
BLAKE2b-256 checksum
How to use checksums
b13673b2fe2d5830ba6a4cbe05895ee494c8ba49ae6686c17955ba92588e6d16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / dbcenter-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL dbcenter-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.2 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
3741097dab48de76518b01a256f27c9df6b947c203dc74901fe20f875ae7a0da
BLAKE2b-256 checksum
How to use checksums
b8c82aab1710e28f47c5208ff27529a2ae47e9e3dc430f692cbc93f777f63035
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / dbcenter-0.2.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL dbcenter-0.2.0-cp38-abi3-macosx_11_0_arm64.whl
Size 5.9 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8d6bf97f5a548d3e41469c92cda83efe9504bbb394f7c2bc1f68bcab74a9c831
BLAKE2b-256 checksum
How to use checksums
9d75212252d8344e2671efb3aaca57bfa5362a4c13009cc5e7201cf5494579e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / dbcenter-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl

Download URL dbcenter-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl
Size 6.4 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
1c50095706a153ef4d9d9c1e909a689a69beff0244830b1a3a5a1683df566374
BLAKE2b-256 checksum
How to use checksums
809f004260c097be3da612f0d2be0bfc2b840e099fe5ce6fd1032162e0a7fb02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Security for dbcenter 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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