Skip to main content

PostgreSQL Server compiled into a Python Wheel.

Project description

postgresql-wheel

A Python wheel for Linux containing a complete, self-contained, locally installable PostgreSQL database server.

All servers run as the Python process user in a local path, so this wheel does not require root or sudo privledges. Databases can be initialized in any directory.

Servers can be setup and torn down in test fixtures with no additional outside dependencies.

Currently this wheel only works for most flavors of Linux.

Postgres is compiled in the same "manylinux" environments provided by the cibuildwheel tool using Github Actions and directly archived into the wheel's "package_data".

The wheel can be installed with pip:

$ pip install postgresql-wheel

Postgres binaries in the package can be found in the directory pointed to by the postgresql.pg_bin global variable. Function wrappers around all of the postgres binary programs, like initdb and pg_ctl functions are provided for convenience:

>>> from postgresql import initdb, pg_ctl
>>> initdb('-D testdatabase')
>>> pg_ctl('-D testdatabase -o "-p 5678" -l testdatabase.log start')

>>> import psycopg2
>>> c = psycopg2.connect("postgres://localhost:5678/postgres") # connect with local client
>>> with c.cursor() as q:
>>>     q.execute("select version()")
>>>     print(q.fetchall())
...
[('PostgreSQL 13.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3), 64-bit',)]
>>> pg_ctl('-D testdatabase stop')

For the purposes of testing, convenience functions are provided for setting up and tearing down databases:

>>> pgdata, con_str = postgresql.setup()
>>> postgresql.psql(f'-h {con_str} -c "select version()"')
>>> postgresql.teardown(pgdata)

There is also a pytest fixture called tmp_postgres that returns a new connection string to a temporary database local domain socket, and can be used in a pytest:

>>> from postgresql import tmp_postgres
>>> def test_foo(tmp_postgres):
...    postgresql.psql(f'-h {tmp_postgres} -c "select version()"')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

postgresql_wheel-14.1.2-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.9 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

postgresql_wheel-14.1.2-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (16.8 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

postgresql_wheel-14.1.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.7 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

postgresql_wheel-14.1.2-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (16.6 kB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

postgresql_wheel-14.1.2-cp39-cp39-musllinux_1_1_x86_64.whl (16.7 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

postgresql_wheel-14.1.2-cp39-cp39-musllinux_1_1_i686.whl (16.8 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

postgresql_wheel-14.1.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

postgresql_wheel-14.1.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (14.5 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

postgresql_wheel-14.1.2-cp38-cp38-musllinux_1_1_x86_64.whl (17.1 kB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

postgresql_wheel-14.1.2-cp38-cp38-musllinux_1_1_i686.whl (17.2 kB view details)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

postgresql_wheel-14.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

postgresql_wheel-14.1.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (14.6 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

postgresql_wheel-14.1.2-cp37-cp37m-musllinux_1_1_x86_64.whl (16.7 kB view details)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

postgresql_wheel-14.1.2-cp37-cp37m-musllinux_1_1_i686.whl (16.8 kB view details)

Uploaded CPython 3.7m musllinux: musl 1.1+ i686

postgresql_wheel-14.1.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.5 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

postgresql_wheel-14.1.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (14.4 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

File details

Details for the file postgresql_wheel-14.1.2-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for postgresql_wheel-14.1.2-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35183a3e8a01b0efe11018efe283c9877c0599813949e7a784db07e37961d6de
MD5 374cfe7d2658dd0e1cc23d7266ae61f2
BLAKE2b-256 3f5dd71c7662ae6d93c2e58f964ca3111fb9454663b34aaa155bf80be3d50d08

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for postgresql_wheel-14.1.2-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 f54826490b27528d8f63f8b124323e4d07d7071a2253027cc3d379276c8fc490
MD5 ac550289189ccabb27d4c1aa5883f9c9
BLAKE2b-256 4839609512ca6885f6f3f85bb3f95e15f18df76de80226db0ad201f65056eed9

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for postgresql_wheel-14.1.2-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fb1822be9eca6226eb1bc67842303ef88d35cac58d4995d908af7804f8962943
MD5 a4d9eb0fb607d2078e07204b48eb6272
BLAKE2b-256 99cd1aab62a469773165d7bd525f1c754ceaf0c8b95c7180791b882100ad2845

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for postgresql_wheel-14.1.2-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b95b030a67603f415ccb0116229b76e7df094e5aa3e2eff03449ef0e1389e942
MD5 822148f7b03abe72e58f4e2c751f2178
BLAKE2b-256 ba5fbac4207576f13617c944c357846cca2b07386bae226daf715131c04511c6

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

  • Download URL: postgresql_wheel-14.1.2-cp39-cp39-musllinux_1_1_x86_64.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: CPython 3.9, musllinux: musl 1.1+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for postgresql_wheel-14.1.2-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 91ae68f67c40f6fa1b7d9ab65df5b8461737f98a3a5d078b36bd9ac6d1505914
MD5 79f68eec4210c08896c819fbe7b70272
BLAKE2b-256 7df8ea57c5e82af39433d37ceffee4a61b681ab5853647637c418c2db5221f00

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp39-cp39-musllinux_1_1_i686.whl.

File metadata

  • Download URL: postgresql_wheel-14.1.2-cp39-cp39-musllinux_1_1_i686.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: CPython 3.9, musllinux: musl 1.1+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for postgresql_wheel-14.1.2-cp39-cp39-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 3b2b560449594fad3ea5df4e75919a6f21f8e241269de2bec06cdb9f17f7532e
MD5 270b4b743b5c9e56788f2a538bc8acb9
BLAKE2b-256 3752bacb3646cd2fc1297758dfa59c44cba46b49fb9614fc9a750dd336b0af0f

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for postgresql_wheel-14.1.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 50b9158acf1c6237344cb1ab5e9689361a543b92d23b4dcd0becf3ad76f79afc
MD5 e294415a5c96475fc2fc9c035abf73d3
BLAKE2b-256 bbb4ef65e6cf81211ee2b39a09998a3a0929e9edd5ba46cbb034182f84115c0e

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for postgresql_wheel-14.1.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 73735b37e955dc6a55c7f7776e2b6b553362e5d5a27f18bfcaf224ff01c1bafc
MD5 b8f3d71fe139d02e311b19df8a78190d
BLAKE2b-256 e553cdd131a5bf32b5e40cfddc4297eeaf3b54ccfc964f113efaef3a26e74f28

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp38-cp38-musllinux_1_1_x86_64.whl.

File metadata

  • Download URL: postgresql_wheel-14.1.2-cp38-cp38-musllinux_1_1_x86_64.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: CPython 3.8, musllinux: musl 1.1+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for postgresql_wheel-14.1.2-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 a9ad8330176ef61a3fe02f1f24885039bc1882298b7a3ac4978e69a431463be8
MD5 d83fab3c500b09c37e9beec4f5e28f7a
BLAKE2b-256 24b3e9ddf48536037a798121f7d7e7998fec3b2819a068b88e6394c7da5c5e07

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp38-cp38-musllinux_1_1_i686.whl.

File metadata

  • Download URL: postgresql_wheel-14.1.2-cp38-cp38-musllinux_1_1_i686.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: CPython 3.8, musllinux: musl 1.1+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for postgresql_wheel-14.1.2-cp38-cp38-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 7d2874ad9303961f74110002f9e6b5cd3d142e8d0b1e54c00174556c79644817
MD5 8b5f13b0a623e2ae073e06d2eb12bb99
BLAKE2b-256 11829ff689a2ba13d87c610da6ea3d678a755b07d724c2bd818348e0eaa02dcc

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for postgresql_wheel-14.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3cd0e0fe41d20cb388be7d3dc2269e3b50fd80caf01e1d24d103aa6c920f466c
MD5 59e92df5e4a149abab8c34bb00a2d570
BLAKE2b-256 d6ffe61e0450d5d2a686d5598944e6b0fc89d4ac60bd658211be21d1ea9a8b23

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for postgresql_wheel-14.1.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a46eeb6e34e67690ff5e0d23ced983839fb29297264bb2e1124be9306cd3e171
MD5 dc41970e755d29ddf26bbf52c9a8e9ac
BLAKE2b-256 866988858ac4da78449fa07a2acbfc517f0361a17741ac3266ac14bb385949ba

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp37-cp37m-musllinux_1_1_x86_64.whl.

File metadata

  • Download URL: postgresql_wheel-14.1.2-cp37-cp37m-musllinux_1_1_x86_64.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: CPython 3.7m, musllinux: musl 1.1+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for postgresql_wheel-14.1.2-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 a628bc9768e73754283574eec59e250f84864ed1d43c6b64af87c6460cd6628b
MD5 58c77f43a9184059b9f9d44903e66080
BLAKE2b-256 a5fd8e8caae4b66623bb09ec505d44beb0f02ff656378e09a86612a2971308f9

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp37-cp37m-musllinux_1_1_i686.whl.

File metadata

  • Download URL: postgresql_wheel-14.1.2-cp37-cp37m-musllinux_1_1_i686.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: CPython 3.7m, musllinux: musl 1.1+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for postgresql_wheel-14.1.2-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 efd2fc72ea09a3248618ace0359285e67c9257c8f9b8cd65507568acf6407a70
MD5 2b5579aabd1073ae1702b6488f4d46f6
BLAKE2b-256 4a2fd3747fb86a08e42612ef102cc11a927b66a7071abadd6c4847960e31b987

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for postgresql_wheel-14.1.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f2d365e9f4f4646846d933c3cf4127e134f23c2f4b52c9eef1e9bb05c19c4094
MD5 27749ecb89e6afb13387731ddd91810e
BLAKE2b-256 f5f4c0b1183bb244f6781e33a961b5f5000c72967a3a15dfec105c122a85c1e1

See more details on using hashes here.

File details

Details for the file postgresql_wheel-14.1.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for postgresql_wheel-14.1.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 67c766070ecc192a9e04ada23bd2396908899c5399acabdc728917fc44a7f4d4
MD5 2e016636aa75c0b7d482bf05cad9cbcd
BLAKE2b-256 e786b2080f730342734142eca517f1de7fb752c46662572bf90e974fc2265711

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