Skip to main content

ephemeral-postgres

Build Status

ephemeral-postgres is a python package for easily setting up, testing, and finally tearing down postgres instances. It can be easily integrated in most test suites but has been primarily used with pytest.

Installation

pip install ephemeral-postgres

Example

import ephemeral_postgres
import psycopg2

with ephemeral_postgres.postgres() as uri:
    con = psycopg2.connect(uri)
    cur = con.cursor()
    cur.execute('select * from pg_database')
    for row in cur.fetchall():
        print(row)

Alternatively, if you would like to run an external Postgres server, you can override ephemeral_postgres from starting a new instance by setting the environment variable EPHEMERAL_POSTGRES_URI accordingly. For example:

export EPHEMERAL_POSTGRES_URI="postgresql://postgres:postgres@localhost:5432/postgres"
python "import ephemeral_postgres; print(ephemeral_postgres.postgres()[0])"

Developing

pip install -e .[test]

# run unit tests
pytest

Metadata

Release files for ephemeral-postgres 0.2.0

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

Source distribution (sdist)

Source distribution for ephemeral-postgres 0.2.0
File Size Uploaded Provenance Actions
ephemeral-postgres-0.2.0.tar.gz 3.8 kB Without provenance Details for ephemeral-postgres-0.2.0.tar.gz

Release files / ephemeral-postgres-0.2.0.tar.gz

Download URL ephemeral-postgres-0.2.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f58ff8d108b346d63f48b4fceeaa3f6cf834a4afd2c6418077b6d55f125ceefc
BLAKE2b-256 checksum
How to use checksums
b40d206bed161abc97b1fbce9a71f958dcf6dd872adb34f71cc9200ad178915f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.2

Security for ephemeral-postgres 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

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