Skip to main content

Copyright (c) 2011, Canonical Ltd

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

python-pgbouncer provides a python interface to setup and run a pgbouncer instance.

Dependencies

Testing Dependencies

In addition to the above, the tests also depend on:

Usage

Create a PGBouncerFixture - a context manager with an extended protocol supporting access to logs etc. Customise it with database definitions, user credentials, and then when you enter the context it will create a transient pgbouncer setup in a temporary directory and run it for the duration that the context is open.

For instance:

>>> from pgbouncer import PGBouncerFixture
>>> bouncer = PGBouncerFixture()
>>> bouncer.databases['mydb'] = 'host=hostname dbname=foo'
>>> bouncer.users['user1'] = 'credentials'
>>> with bouncer:
...     # Can now connect to bouncer.host port=bouncer.port user=user1

Any settings required for pgbouncer to work will be given sane defaults.

Installation

Either run setup.py in an environment with all the dependencies available, or add the working directory to your PYTHONPATH.

Development

Upstream development takes place at https://launchpad.net/python-pgbouncer.

To run the tests, run:

$ tox

Release files for pgbouncer 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 pgbouncer 0.2.0
File Size Uploaded
pgbouncer-0.2.0.tar.gz 19.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pgbouncer 0.2.0
File Interpreter ABI Platform
pgbouncer-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.5 kB

Release files / pgbouncer-0.2.0.tar.gz

Download URL pgbouncer-0.2.0.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3548a7d5db3ff6a73d85c3f554e640005dd973ce3fb03fad749589d7318f5fd9
BLAKE2b-256 checksum
How to use checksums
afd16b3ea6f8b89f91f482d3165509a48cf0a927cc1910da3565bd4632b14615
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pgbouncer-0.2.0-py3-none-any.whl

Download URL pgbouncer-0.2.0-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ca2facf45fe743156256b8b76b0b65da28dbd24adad8d373d2c9b409c30ba47
BLAKE2b-256 checksum
How to use checksums
4e297cb2b8269a4f15134810b0b949b303c73e59ad08c3036440054cd4ce3675
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

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