Skip to main content

minipg

Yet another Python PostgreSQL database driver.

Requirements

  • PostgreSQL 9.6+

  • Python 3.9+

Installation

use pip

$ pip install minipg

or

copy a module file.

$ cd $(SOMEWHERE_PYTHON_PATH)
$ wget https://github.com/nakagami/minipg/raw/master/minipg.py

Example

import minipg
conn = minipg.connect(host='localhost',
                    user='postgres',
                    password='secret',
                    database='database_name')
cur = conn.cursor()
cur.execute('select foo, bar from baz')
for r in cur.fetchall():
   print(r[0], r[1])
conn.close()

SSL Connection

You can make an SSL connection with an instance of SSLContext. Below is an example of an ssl connection without certificate validation.

import ssl
import minipg
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
conn = minipg.connect(host='localhost',
                    user='postgres',
                    password='secret',
                    database='database_name',
                    ssl_context=ssl_context)

Asyncio example

Please refer to the test code.

https://github.com/nakagami/minipg/blob/master/test_async.py

Restrictions and Unsupported Features

  • Supported Authentication METHOD are only ‘trust’, ‘md5’ and ‘scram-sha-256’.

  • Not full support for array data types.

For MicroPython

See https://github.com/nakagami/micropg . It’s a minipg subset driver.

Metadata

Release files for minipg 0.11.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 minipg 0.11.0
File Size Uploaded Provenance Actions
minipg-0.11.0.tar.gz 14.3 kB Without provenance Details for minipg-0.11.0.tar.gz

Release files / minipg-0.11.0.tar.gz

Download URL minipg-0.11.0.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
255dbfbfcfc8fb6b58430257d779999d50bf12a453a7f22d683dde5f920f00e5
BLAKE2b-256 checksum
How to use checksums
8b384e55e3fcf5cfe19096b93e0921647a1ae0d29e9db9f4003b7f3f237c485e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for minipg 0.11.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.11.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