Uses releases from theseus-rs/postgresql-binaries and publishes them to pypy, so that you can do:
pip install postgresql-binaries==18.3.0Then to use, eg:
import postgresql_binaries
import subprocess
cmd = [
str(postgresql_binaries.bin() / "initdb"),
*("-D", directory),
*("-U", "postgres"),
*("--auth-host", "trust"),
]
subprocess.check_call(cmd)Packages are around 10MB. On the first call to bin(), the archive baked into the wheel is unpacked in place.
This library is intentionally really dumb, and intended to be built upon. There are mixed opinions on whether (ab)using PyPI to host binary files is a good idea. There are similar packages around, but they don't handle versioning well and include too much other junk.