nzpy_extended
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_extendedwithasyncio, ornzpy_extended.syncfor 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
- Connection pools — async and sync pool APIs and lifecycle.
- Timeouts and cancellation — connection and command timeout behavior.
- Catalog metadata — async catalog inspection helpers.
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.
Cross-driver conformance tests
The shared corpus lives in conformance/ at the workspace root and will move
to tests/conformance as a submodule. It provisions its own CONFORMANCE
schema on a live appliance and runs the same case corpus against Python, Node,
C# and Rust.
..\conformance\run-all.ps1 -Profile smoke -Bootstrap
The Python runner is tools/conformance_runner.py. It uses the async API and
emits the canonical JSONL from conformance/runner-contract.md. Host and
credentials come only from NZ_DEV_HOST and the other NZ_DEV_* variables;
tests/conftest.py no longer contains a code password default.
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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nzpy_extended-0.9.3.tar.gz | 123.5 kB | With provenance | Details for nzpy_extended-0.9.3.tar.gz |
Built distributions (wheels)
Total release size: 3.3 MB
Release files / nzpy_extended-0.9.3.tar.gz
| Download URL | nzpy_extended-0.9.3.tar.gz |
|---|---|
| Size | 123.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b08bee86db77496993675130ab57222ab4bb93b31d71fedf8b6ab443c05ed5dd
|
|
BLAKE2b-256 checksum How to use checksums |
7a9cf505d48d49f5b56adb92fa2515f5c1f6b26fa0a24c7d177b3bc60d9e3ce6
|
| 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 11, 2026.
Transparency logRelease files / nzpy_extended-0.9.3-cp311-abi3-win_arm64.whl
| Download URL | nzpy_extended-0.9.3-cp311-abi3-win_arm64.whl |
|---|---|
| Size | 270.6 kB |
| Tags | CPython 3.11 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c3bc58618052a1b11db3d3471fa41be64a99a2f83dc95f75ac21454775a3769f
|
|
BLAKE2b-256 checksum How to use checksums |
2a764a32c740952dbd4cc049d2ca0228471a2758a8aadf8c94affa56dbea5c49
|
| 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 11, 2026.
Transparency logRelease files / nzpy_extended-0.9.3-cp311-abi3-win_amd64.whl
| Download URL | nzpy_extended-0.9.3-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 275.0 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
67c72bd40b2f00e458d3d13cfab315835aea0e2201b64af1d18e27843c5fddd1
|
|
BLAKE2b-256 checksum How to use checksums |
43c101b66b43c3b2083fe7be4223cd9375a98a5eaf0a8ad6eb5af9e0fc67ce45
|
| 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 11, 2026.
Transparency logRelease files / nzpy_extended-0.9.3-cp311-abi3-musllinux_1_2_x86_64.whl
| Download URL | nzpy_extended-0.9.3-cp311-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 470.6 kB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
da6871b950f105b9dd1a1bebe514b998bbb5a8a32c816bdddbc14000dd9ceb3f
|
|
BLAKE2b-256 checksum How to use checksums |
3a31debde0447e81a0993b61addfd8c7cd9faa335a37c316db8f1aec88e41a25
|
| 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 11, 2026.
Transparency logRelease files / nzpy_extended-0.9.3-cp311-abi3-musllinux_1_2_aarch64.whl
| Download URL | nzpy_extended-0.9.3-cp311-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 452.6 kB |
| Tags | CPython 3.11 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
265ba20400def6716898de85a4f22db32719b31b98c9620e204cd6d357827b34
|
|
BLAKE2b-256 checksum How to use checksums |
65489e3554b371da185ff5ee2bb3348e6694c53ea96742a605cc6709ceac24da
|
| 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 11, 2026.
Transparency logRelease files / nzpy_extended-0.9.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nzpy_extended-0.9.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 389.8 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3dd497100be7094be5f6dafe8f9869e382b3bbd720f15780c344756562fc4530
|
|
BLAKE2b-256 checksum How to use checksums |
e831ce38ebbe97ab23e20897d28c75bb6bcc28679015ac06ff746f6166b44cb5
|
| 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 11, 2026.
Transparency logRelease files / nzpy_extended-0.9.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nzpy_extended-0.9.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 386.4 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
3c2d48550a829960b52439482a5c32b774bf160120019439f676a96e224f834c
|
|
BLAKE2b-256 checksum How to use checksums |
a580cffb4dde732e14bbd4703ec4a2ac4fd83177663168e6388bd8d2d32135a4
|
| 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 11, 2026.
Transparency logRelease files / nzpy_extended-0.9.3-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | nzpy_extended-0.9.3-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 362.7 kB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e27c2e53350902f611662ac00de7a378c626a8ceb4d824f39f5328a31e0862d1
|
|
BLAKE2b-256 checksum How to use checksums |
7dd152e1348f4225e061ffd80724f605a38c5552f8554b2927edaa265f78a6fa
|
| 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 11, 2026.
Transparency logRelease files / nzpy_extended-0.9.3-cp311-abi3-macosx_10_12_universal2.whl
| Download URL | nzpy_extended-0.9.3-cp311-abi3-macosx_10_12_universal2.whl |
|---|---|
| Size | 609.1 kB |
| Tags | CPython 3.11 abi3 macOS 10.12+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
33d79176e90bc80b92897f574aba9a50bc2f2601c61ababd32c2f01a6e872f8c
|
|
BLAKE2b-256 checksum How to use checksums |
c8c429dff34f505811e44fdaa0ad512e7bf5dfcfeacc1c01573523145079e985
|
| 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 11, 2026.
Transparency logSecurity for nzpy-extended 0.9.3
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.
Attestation for nzpy_extended-0.9.3.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 11, 2026.
Transparency logA 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.