Skip to main content

Python Version Postrgres Version Linux Supported macOS Supported Windows Supported

PyPI - Downloads

pgserver: pip-installable, embedded postgres server + pgvector extension for your python app

pgserver lets you build Postgres-backed python apps with the same convenience afforded by an embedded database (ie, alternatives such as sqlite). If you build your app with pgserver, your app remains wholly pip-installable, saving your users from needing to understand how to setup a postgres server (they simply pip install your app, and postgres is brought in through dependencies), and letting you get started developing quickly: just pip install pgserver and pgserver.get_server(...), as shown in this notebook: Open In Colab

To achieve this, you need two things which pgserver provides

  • python binary wheels for multiple-plaforms with postgres binaries
  • convenience python methods that handle db initialization and server process management, that deals with things that would normally prevent you from running your python app seamlessly on environments like docker containers, a machine you have no root access in, machines with other running postgres servers, google colab, etc. One main goal of the project is robustness around this.

Additionally, this package includes the pgvector postgres extension, useful for storing associated vector data and for vector similarity queries.

Basic summary:

  • Pip installable binaries: built and tested on Manylinux, MacOS and Windows.
  • No sudo or admin rights needed: Does not require root privileges or sudo.
  • but... can handle root: in some environments your python app runs as root, eg docker, google colab, pgserver handles this case.
  • Simpler initialization: pgserver.get_server(MY_DATA_DIR) method to initialize data and server if needed, so you don't need to understand initdb, pg_ctl, port conflicts.
  • Convenient cleanup: server process cleanup is done for you: when the process using pgserver ends, the server is shutdown, including when multiple independent processes call pgserver.get_server(MY_DATA_DIR) on the same dir (wait for last one). You can blow away your PGDATA dir and start again.
  • For lower-level control, wrappers to all binaries, such as initdb, pg_ctl, psql, pg_config. Includes header files in case you wish to build some other extension and use it against these binaries.
# Example 1: postgres backed application
import pgserver

db = pgserver.get_server(MYPGDATA)
# server ready for connection.

print(db.psql('create extension vector'))
db_uri = db.get_uri()
# use uri with sqlalchemy / psycopg, etc, see colab.

# if no other process is using this server, it will be shutdown at exit,
# if other process use same pgadata, server process will be shutdown when all stop.
# Example 2: Testing
import tempfile
import pytest
@pytest.fixture
def tmp_postgres():
    tmp_pg_data = tempfile.mkdtemp()
    pg = pgserver.get_server(tmp_pg_data, cleanup_mode='stop')
    yield pg
    pg.cleanup()

Postgres binaries in the package can be found in the directory pointed to by the pgserver.POSTGRES_BIN_PATH to be used directly.

This project was originally based on , which provides a linux wheel. But adds the following differences:

  1. binary wheels for multiple platforms (ubuntu x86, MacOS apple silicon, MacOS x86, Windows)
  2. postgres python management: cross-platfurm startup and cleanup including many edge cases, runs on colab etc.
  3. includes pgvector extension but currently excludes postGIS

Metadata

Release files for pgserver 0.1.4

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 pgserver 0.1.4
File
pgserver-0.1.4-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pgserver-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
pgserver-0.1.4-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pgserver-0.1.4-cp312-cp312-macosx_10_9_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.9+ x86-64 Details
pgserver-0.1.4-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pgserver-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
pgserver-0.1.4-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
pgserver-0.1.4-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
pgserver-0.1.4-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pgserver-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
pgserver-0.1.4-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
pgserver-0.1.4-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
pgserver-0.1.4-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
pgserver-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
pgserver-0.1.4-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
pgserver-0.1.4-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details

Total release size: 177.1 MB

Release files / pgserver-0.1.4-cp312-cp312-win_amd64.whl

Download URL pgserver-0.1.4-cp312-cp312-win_amd64.whl
Size 12.8 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
406e9355334e40754160a33d93f18a848720a38cd0b68da50be2ea272c89ed2d
BLAKE2b-256 checksum
How to use checksums
8580f6304274c1740c283bc7317ababceb3c23c8275ce4995f7379e17b49bc6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pgserver-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 11.3 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1a5d07c61d51f2abfef4ef61e2ef5cd014b994f7e09de8d3c140d2cf370e84a8
BLAKE2b-256 checksum
How to use checksums
cff1c9d717f66d2e4a27801577e1ae233c25aa88db875c586ac3ebe7d73b6b75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp312-cp312-macosx_11_0_arm64.whl

Download URL pgserver-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Size 9.8 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
780fa89f26a960cca0215caf471e70848dd8597bd8ceaeba7faf42170278980c
BLAKE2b-256 checksum
How to use checksums
235794b5f05a23d0fa683c01bfc2d785224057a9eaf0eb00cbfd6da19547012f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp312-cp312-macosx_10_9_x86_64.whl

Download URL pgserver-0.1.4-cp312-cp312-macosx_10_9_x86_64.whl
Size 10.4 MB
Tags CPython 3.12 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
dc34f88561b18bc08edd98a84528f99a3720fe713a4e39a4a6210a4d009fe465
BLAKE2b-256 checksum
How to use checksums
92e39f8eea535ab4f2906a9924eccc5fb3a7bcff3e02222fbe338d9c24639750
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp311-cp311-win_amd64.whl

Download URL pgserver-0.1.4-cp311-cp311-win_amd64.whl
Size 12.8 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
fb755fe493c479fcad1a1e9923fcc1f09d15cd2fb168e563c003b29f14a80545
BLAKE2b-256 checksum
How to use checksums
ffdf284875cff70317a628c87c1555a1c9342316baaadce23741be38a85b39eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pgserver-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 11.3 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
d595789b47624a3d963aa9aa6359da9be31beb7e61f1a45541953242068b8813
BLAKE2b-256 checksum
How to use checksums
913f3d628b09d379c368a589ca2f417e318bed7615e5df175c17d570e623b2f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp311-cp311-macosx_11_0_arm64.whl

Download URL pgserver-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Size 9.8 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0cc5a64f40749c0e9752cd63784e63dfcf1f3e5ecd2279b6b59f7c64fb520fb4
BLAKE2b-256 checksum
How to use checksums
501d527e42e5cf66cfa224fbec2d031aba9fc17514bab5de3f14b1d7e9c5c3e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp311-cp311-macosx_10_9_x86_64.whl

Download URL pgserver-0.1.4-cp311-cp311-macosx_10_9_x86_64.whl
Size 10.4 MB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
854fa9394d495b3a332c954b63d4356b56d29220530e6d2aae146821bf87e05a
BLAKE2b-256 checksum
How to use checksums
35f1475d079b823c26deaf8a2cc3d7358a8f5cfa481bd5a8f878666b08450ed9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp310-cp310-win_amd64.whl

Download URL pgserver-0.1.4-cp310-cp310-win_amd64.whl
Size 12.8 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
7be9cd117184aea1eaf9118b4c052c318dc13bb93d3cd9336329ad5b8d1729b1
BLAKE2b-256 checksum
How to use checksums
95540bc5eb3e62f3ccb394dc92825f7162fe555d4b8f9a8198c424f1afbf7422
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pgserver-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 11.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cb0e711e257dbfa2681d78c0bd789dd81753bc28c207889dcefa8f80706f3fed
BLAKE2b-256 checksum
How to use checksums
44d9fc1a093be71cb141b2f01bfa921f3853e45e1c4567b240108cd9d90a3f28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp310-cp310-macosx_11_0_arm64.whl

Download URL pgserver-0.1.4-cp310-cp310-macosx_11_0_arm64.whl
Size 9.8 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2aa7897ab2894a460cfc430959f9640e27659fc8b8802f82b3f58632ae181218
BLAKE2b-256 checksum
How to use checksums
d42a180c5d445a0d05596120b51be47d98420b8f1529bb4141421c4b6fe43b64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp310-cp310-macosx_10_9_x86_64.whl

Download URL pgserver-0.1.4-cp310-cp310-macosx_10_9_x86_64.whl
Size 10.4 MB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
79041d91d4d28e3a6a75dd472ee395e2da036ffd7f77cd826052697532291646
BLAKE2b-256 checksum
How to use checksums
89ae476532eda309ecee1c6ebe7f99665b35f7082c841f9d9d144d42294d40a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp39-cp39-win_amd64.whl

Download URL pgserver-0.1.4-cp39-cp39-win_amd64.whl
Size 12.8 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
a515926064743131f76c9cd2268b5d69f160371b89e7d9cc377102aa4087ae2d
BLAKE2b-256 checksum
How to use checksums
26190b977b75c69f27d41703bc64a38dac290285a06cec6e73d347d271cc6246
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pgserver-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 11.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
d9b7cf6f1611506654a7e948d99f8fb20895321474187401587d3fee1067e298
BLAKE2b-256 checksum
How to use checksums
3b13becb1d566bf3edfc5c96c2bc7de9cf65205b229ad6453ec1c8f4b1f901f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp39-cp39-macosx_11_0_arm64.whl

Download URL pgserver-0.1.4-cp39-cp39-macosx_11_0_arm64.whl
Size 9.8 MB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2b902adff9dbfa65eac0405b914bd16a9d0b04e7710a02e4a172997b436135f4
BLAKE2b-256 checksum
How to use checksums
6ee32fd2429e84ecf974d7fb678abb3c2b3faddabc39ebb0d178a1dafcad76ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pgserver-0.1.4-cp39-cp39-macosx_10_9_x86_64.whl

Download URL pgserver-0.1.4-cp39-cp39-macosx_10_9_x86_64.whl
Size 10.4 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
206e58be4f01db433df882c6d781ea1058d604f9c23acfc6ce3401ba717bc6ad
BLAKE2b-256 checksum
How to use checksums
1fb7dc48e23459e75fcc0795c62a13fdcf33c41adc3640d8d5cc8422a8dd8f0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.4 This release

16 release files

0.1.3

16 release files

0.1.2

16 release files

0.1.1

16 release files

0.1.0

16 release files

0.0.7

9 release files

0.0.6

9 release files

0.0.5

15 release files

0.0.4

15 release files

0.0.3

15 release files

0.0.2

15 release files

0.0.1

7 release files

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