Skip to main content

nzpy_extended

PyPI version Python versions CI License

A Python driver for IBM Netezza Performance Server (NPS). nzpy_extended is a maintained fork of IBM's nzpy, with asynchronous and synchronous APIs, an optional Rust decoder, connection pools, and utilities for bulk loading and catalog introspection.

The package is published on PyPI. Install it with:

python -m pip install nzpy-extended

Highlights

  • Async and sync APIs. Use nzpy_extended with asyncio, or nzpy_extended.sync for blocking applications.
  • DB-API 2.0-oriented sync interface. Supports standard cursor operations, parameter placeholders, transactions, and the DB-API exception hierarchy. See the compliance notes for deviations.
  • Native result decoding. A Rust extension accelerates decoding Netezza result rows. If it is unavailable, the driver can fall back to the pure-Python decoder.
  • Connection pools. Async and sync reusable pools, plus null-pool variants.
  • Bulk loading. Stream Python iterables or local CSV files using Netezza's external-table protocol.
  • Catalog metadata. Async helpers for tables, columns, views, procedures, distribution keys, and other system catalog information.
  • Timeouts and cancellation. Configure connection and command timeouts and cancel running queries.

Compatibility

Runtime or platform Support
CPython Python 3.11–3.15
Linux x86_64 and aarch64; manylinux and musllinux wheels
macOS arm64 and universal2 wheels
Windows x86_64 and ARM64 wheels

Published wheels use the CPython stable ABI and support Python 3.11 and newer. Free-threaded CPython builds are not covered by these wheels. PyPy is not a tested or supported runtime.

On supported platforms, pip installs a prebuilt wheel. On other platforms, pip may build the native extension from source; this requires a stable Rust toolchain. The pure-Python decoder is available as a runtime fallback, but does not remove the Rust requirement for building a source distribution.

Quick start

The examples read connection settings from environment variables so credentials do not need to be written into source code.

Synchronous

import os
import nzpy_extended.sync as nzpy

conn = nzpy.connect(
    host=os.environ["NZ_HOST"],
    port=int(os.environ.get("NZ_PORT", "5480")),
    database=os.environ["NZ_DATABASE"],
    user=os.environ["NZ_USER"],
    password=os.environ["NZ_PASSWORD"],
)

try:
    with conn.cursor() as cur:
        cur.execute("SELECT 1")
        print(cur.fetchone())
finally:
    conn.close()

Asynchronous

import asyncio
import os
import nzpy_extended as nzpy

async def main():
    async with await nzpy.connect(
        host=os.environ["NZ_HOST"],
        port=int(os.environ.get("NZ_PORT", "5480")),
        database=os.environ["NZ_DATABASE"],
        user=os.environ["NZ_USER"],
        password=os.environ["NZ_PASSWORD"],
    ) as conn:
        cur = conn.cursor()
        await cur.execute("SELECT 1")
        print(await cur.fetchone())

asyncio.run(main())

Use ? placeholders for values rather than interpolating them into SQL:

cur.execute("SELECT id, name FROM users WHERE id = ?", (user_id,))

Parameters are rendered as SQL literals by the client; they are not server-side prepared-statement bindings. Identifiers such as table and column names cannot be supplied as value parameters.

Common operations

Transactions

Autocommit is enabled by default for compatibility with the upstream driver. For explicit synchronous transactions, use conn.transaction() or set conn.autocommit = False and call commit() or rollback().

with conn.transaction():
    with conn.cursor() as cur:
        cur.execute(
            "UPDATE accounts SET status = ? WHERE id = ?",
            ("active", 42),
        )

The async API provides commit() and rollback() on the connection. For transaction semantics and DB-API differences, see the PEP 249 notes.

Bulk loading

Use load_data() for iterable or async-iterable rows, and load_csv() for streaming a local CSV file. Both APIs are available in synchronous and asynchronous forms.

count = conn.load_data(
    "staging_items",
    [(1, "alpha"), (2, "beta")],
    columns=[("id", "INTEGER"), ("name", "VARCHAR(100)")],
)
print(f"Loaded {count} rows")

See the bulk loading guide for schema inference, encoding, validation, streaming behavior, and error handling.

Pools, timeouts, and metadata

Documentation

Guide Contents
Async API Async connection, cursor, SSL, and API limitations
Sync API Synchronous DB-API connection and cursor reference
PEP 249 compliance Supported behavior and known deviations
Connection pools Pool types, configuration, and lifecycle
Timeouts and cancellation Timeout scopes, cancellation, and session behavior
Bulk data loading load_data() API and value/encoding rules
Metadata API Netezza catalog introspection
Benchmarks Measurements, methodology, and reproduction
Changelog Release notes and upgrade-impacting changes

Runnable examples are in examples/. For questions and bug reports, use the issue tracker.

Performance

The Rust decoder can substantially improve row-decoding throughput, but end-to-end performance depends on the query, data types, server, network, and client hardware. See the benchmark results and methodology before comparing measurements; they are workload-specific and are not a throughput guarantee.

To deliberately use the pure-Python decoder:

NZPY_EXTENDED_NO_NATIVE=1 python your_script.py

If the native module cannot be imported, the driver emits a RuntimeWarning and falls back to pure Python. Setting NZPY_EXTENDED_NO_NATIVE=1 explicitly selects that fallback without the warning. The former NZPY_EXTENDED_NO_CEXT setting was removed in version 0.9.

Testing and development

Install the test and lint dependencies, then run the database-free unit tests:

python -m pip install -e ".[test,lint]"
pytest tests -m unit -v --strict-config
NZPY_EXTENDED_NO_NATIVE=1 pytest tests -m unit -v --strict-config
mypy nzpy_extended
pyright nzpy_extended
python tools/verify_native_parity.py

Live integration profiles require a disposable Netezza database and the NZ_DEV_HOST, NZ_DEV_PORT, NZ_DEV_DATABASE, NZ_DEV_USER, and NZ_DEV_PASSWORD environment variables. NZ_DEV_DB is accepted as a legacy alternative to NZ_DEV_DATABASE. Run the profiles with:

pytest tests -m smoke -v
pytest tests -m full -v

Do not run live tests against a production database. See CONTRIBUTING.md for the development workflow and Rust checks.

Upgrading

Version 0.9.0 includes behavior changes that may affect applications: server errors now use more specific DB-API exception classes, binary and geometry values are returned as bytes, invalid parameter counts and NUL characters raise errors, and fetching discarded cursor results raises InterfaceError. It also changes logging defaults and tightens validation of paths used by the external-table protocol.

Review the changelog, especially the 0.9.0 entry, before upgrading from an earlier release. Version 0.9.1 changes packaging and release automation, not driver behavior.

License

Apache License 2.0. See LICENSE.

Metadata

Release files for nzpy-extended 0.9.2

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

Source distribution (sdist)

Source distribution for nzpy-extended 0.9.2
File Size Uploaded Provenance Actions
nzpy_extended-0.9.2.tar.gz 119.0 kB With provenance Details for nzpy_extended-0.9.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for nzpy-extended 0.9.2
File Actions
nzpy_extended-0.9.2-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details for nzpy_extended-0.9.2-cp311-abi3-win_arm64.whl
nzpy_extended-0.9.2-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for nzpy_extended-0.9.2-cp311-abi3-win_amd64.whl
nzpy_extended-0.9.2-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for nzpy_extended-0.9.2-cp311-abi3-musllinux_1_2_x86_64.whl
nzpy_extended-0.9.2-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for nzpy_extended-0.9.2-cp311-abi3-musllinux_1_2_aarch64.whl
nzpy_extended-0.9.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for nzpy_extended-0.9.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
nzpy_extended-0.9.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for nzpy_extended-0.9.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
nzpy_extended-0.9.2-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for nzpy_extended-0.9.2-cp311-abi3-macosx_11_0_arm64.whl
nzpy_extended-0.9.2-cp311-abi3-macosx_10_12_universal2.whl CPython 3.11 abi3 macOS 10.12+ universal2 (ARM64, x86-64) Details for nzpy_extended-0.9.2-cp311-abi3-macosx_10_12_universal2.whl

Total release size: 3.2 MB

Release files / nzpy_extended-0.9.2.tar.gz

Download URL nzpy_extended-0.9.2.tar.gz
Size 119.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e50131a526de9fd3f884327c24e0c355a7857398a8cea93b2221fb44d2515d74
BLAKE2b-256 checksum
How to use checksums
6248a8836b215bdaee1d11a765c5be9fac532bba70b61964f053c8f883448b80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / nzpy_extended-0.9.2-cp311-abi3-win_arm64.whl

Download URL nzpy_extended-0.9.2-cp311-abi3-win_arm64.whl
Size 258.7 kB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
402b4a8d408d2180103ffef4ec6697d8c7bfb217ca624277e3071a96d1c09a4e
BLAKE2b-256 checksum
How to use checksums
4cf3d1761dcdd3a907ffe428919a3360ecdd770e53aec03745a3e287c3ae5a1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / nzpy_extended-0.9.2-cp311-abi3-win_amd64.whl

Download URL nzpy_extended-0.9.2-cp311-abi3-win_amd64.whl
Size 260.9 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
251389b21b5268e81ac667312412fa8b6789454144f0075738c7fc222191ffbe
BLAKE2b-256 checksum
How to use checksums
df3e05c6485607889e95fed80871f8058a4f9e5d6338e4d810acf7a76e9ae489
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / nzpy_extended-0.9.2-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL nzpy_extended-0.9.2-cp311-abi3-musllinux_1_2_x86_64.whl
Size 455.6 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
224cd7db55e86b69b75a299b9393a725684fab4ca804f792082fce1789a8d7a2
BLAKE2b-256 checksum
How to use checksums
76064e53b7267a805e0866e86f95eec16c7f8f8997681fbe1dc14e842ae7a5c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / nzpy_extended-0.9.2-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL nzpy_extended-0.9.2-cp311-abi3-musllinux_1_2_aarch64.whl
Size 439.9 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
5f20c7233e1b57cf009648565ba86d20bb586456ee1782739c65da81eed89f12
BLAKE2b-256 checksum
How to use checksums
acd998843db1d40719b2b98d175fae7fd7f026f419d5df0fbe1d6e4ea119ea4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / nzpy_extended-0.9.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nzpy_extended-0.9.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 375.1 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
f81fa0898ae8861c1ea7fad19b76de8bfa9155674bbaef08304e2c2f36f8f0e2
BLAKE2b-256 checksum
How to use checksums
b86a74cbbf0da34c020381ce35d3ea5e40d0dc2675c03d602ff82f5e661c11e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / nzpy_extended-0.9.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL nzpy_extended-0.9.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 374.4 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
7e84548fd0fa8130854f2751b1ab1a147b155d3830d906d3bc0fa939b247afe1
BLAKE2b-256 checksum
How to use checksums
023904d8282ec8db2e79d735095c073d880fe71f08c0a847b0e8e5a1217dc309
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / nzpy_extended-0.9.2-cp311-abi3-macosx_11_0_arm64.whl

Download URL nzpy_extended-0.9.2-cp311-abi3-macosx_11_0_arm64.whl
Size 350.1 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5fd0a187c2b39cfd83a6d4fa239a9855ead5280424526865ec6457fdaaef1748
BLAKE2b-256 checksum
How to use checksums
f007c9857b51a8f3be0232711b74136c1b01875837df2b3fd44dab9a03de8473
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / nzpy_extended-0.9.2-cp311-abi3-macosx_10_12_universal2.whl

Download URL nzpy_extended-0.9.2-cp311-abi3-macosx_10_12_universal2.whl
Size 584.9 kB
Tags CPython 3.11 abi3 macOS 10.12+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
bd13c8b80d67b1b1c1d91b32352b0a348226c68c7685d61369b0a8c0aa2bc0d8
BLAKE2b-256 checksum
How to use checksums
8807be72db6056025df2bb0f02986c1d42fb39455d3662854fa0919ddb99257f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for nzpy-extended 0.9.2

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.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for nzpy_extended-0.9.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

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.

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