Skip to main content

wrapper for PostgreSQL queries with transaction and connection pooling support

Project description

elephant_parsel

wrapper for PostgreSQL queries with transaction and connection pooling support

This project is about making psycopg2 easier to use.

supported versions

Debian >=10, psycopg2 >=2.7, python >=3.7

installation

install using pipenv:

pipenv install elephant_parsel

basic usage

from elephant_parsel.postgres_db import PostgresDB, PostgresDBException
import logging
db = PostgresDB(connection_config=dict(
    host='db.example.com',
    port=5432,
    dbname='the_database_name',
    user='the_username',
    password='****',
    minconn=1,
    maxconn=4
  ), logger=logging.getLogger(), connect=True, register_hstore=False)

server_version_string = db.query_one('select version()', None, column='version')

The connection_config is used as kwargs for the psycopg2.ThreadedConnectionPool, so it should support all libpq connection variables: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS

API docs: https://elephant-parsel.readthedocs.io/en/latest/

Project details


Download files

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

Source Distribution

elephant_parsel-1.2.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

elephant_parsel-1.2.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file elephant_parsel-1.2.1.tar.gz.

File metadata

  • Download URL: elephant_parsel-1.2.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for elephant_parsel-1.2.1.tar.gz
Algorithm Hash digest
SHA256 466f8f767e4f933523f7178971b169326fae9a7a42ee0048ad86472806c30699
MD5 520ce315d658b5fade62c5e604c8a7e8
BLAKE2b-256 f62a92906f1942d26b5f29943f3fecce6fb93a2d963fed1b3b4519289d332d87

See more details on using hashes here.

File details

Details for the file elephant_parsel-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for elephant_parsel-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 41ebebd554af5d47f345c900dae7f4c96388d864081a3a283584c0748a4e9b85
MD5 5f1a3a81806999085e0046000d8bd6dc
BLAKE2b-256 dd9f63861d40469d0b4711ae85a9602a8db9957a3638fa0c1b7b636da1b2e122

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