Skip to main content

Opengauss driver and tools library.

Project description

This package is based on py-postgresql upgrades to work with openGauss.

Repo: Adapted from: v1.3.0

py-opengauss is a set of Python modules providing interfaces to various parts of openGauss. Primarily, it provides a pure-Python driver with some C optimizations for querying a openGauss database.


  • Prepared Statement driven interfaces.

  • Cluster tools for creating and controlling a cluster.

  • Support for most PostgreSQL types: composites, arrays, numeric, lots more.

  • COPY support.

  • Multiple ip connect support

Sample PG-API Code:

>>> import py_opengauss
>>> db ='pq://user:password@host:port,host:port/database')
>>> db.execute("CREATE TABLE emp (emp_first_name text, emp_last_name text, emp_salary numeric)")
>>> make_emp = db.prepare("INSERT INTO emp VALUES ($1, $2, $3)")
>>> make_emp("John", "Doe", "75,322")
>>> with db.xact():
...  make_emp("Jane", "Doe", "75,322")
...  make_emp("Edward", "Johnson", "82,744")

There is a DB-API 2.0 module as well:


However, PG-API is recommended as it provides greater utility.

Once installed, try out the pg_python console script:

$ python3 -m py_opengauss.bin.pg_python -h localhost -p port -U theuser -d database_name

If a successful connection is made to the remote host, it will provide a Python console with the database connection bound to the db name.

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

py-opengauss-1.3.10.tar.gz (275.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page