Skip to main content

IBM Netezza python driver - extended fork

Project description

nzpy_extended: High-performance IBM Netezza driver for Python

nzpy_extended is a hard fork of IBM nzpy — enriched with new features, major performance improvements via a C extension, and expanded platform support.

Key differences from upstream nzpy

Feature nzpy (IBM) nzpy_extended
Row parsing performance ~13 000 rows/s (pure Python) ~50 000 rows/s (optimized Python) → ~200 000 rows/s (+ C ext, exceeds ODBC ~160 k)
Supported Python 3.5+ 3.12, 3.13, 3.14
Platform wheels ❌ None ✅ Linux x64, macOS ARM, Windows x64 (pre-built)
Async support ✅ Fully async API

A large portion of the speedup comes from avoiding unnecessary object allocations in pure Python (~13 k → ~50 k rows/s). When the C extension is available (_HAVE_C_EXT = True), parsing of integers, floats, decimals, dates, times, timestamps, booleans, and strings all happen in native C — avoiding Python object allocations per field and struct.unpack overhead — boosting throughput to ~200 k rows/s.

If the compiled extension is not available (unsupported platform or Python version), the driver gracefully falls back to pure Python with identical semantics.

Installation

pip install nzpy_extended

Pre-built wheels are provided for:

Platform Architecture Python
Linux x86_64 (manylinux) 3.12 / 3.13 / 3.14
macOS ARM64 (Apple Silicon) 3.12 / 3.13 / 3.14
Windows x86_64 3.12 / 3.13 / 3.14

For other platforms or Python versions, pip install will compile the C extension from source (requires a C compiler: GCC, Clang, or MSVC). On systems without a compiler the install will fail — use a supported platform or version.

Quick start

import nzpy_extended as nzpy

conn = nzpy.connect(
    user="admin", password="password",
    host="localhost", port=5480, database="db1",
    securityLevel=1,
)

with conn.cursor() as cursor:
    cursor.execute("CREATE TABLE IF NOT EXISTS test (id INT, name VARCHAR(50))")
    cursor.execute("INSERT INTO test VALUES (?, ?)", (1, "Alice"))
    cursor.execute("SELECT * FROM test")
    rows = cursor.fetchall()
    for row in rows:
        print(row)

Requirements

  • Python ≥ 3.12
  • CPython (PyPy not supported for C extension, pure-Python fallback only)

Documentation

Testing

Running the test suite

Tests require a running Netezza instance. Set the connection environment variables:

export NZ_DEV_HOST=your_netezza_host
export NZ_DEV_PORT=5480
export NZ_DEV_DB=JUST_DATA
export NZ_DEV_USER=admin
export NZ_DEV_PASSWORD=password

Run all tests:

pytest tests/ -v

C Extension / Pure Python parity

The C extension and pure-Python fallback must produce identical results for all data types. Parity tests verify this in two ways:

Unit tests (tests/test_c_python_parity_unit.py) — compare individual C parser functions against Python reference implementations byte-by-byte. No database required.

pytest tests/test_c_python_parity_unit.py -v

Integration tests (tests/test_c_python_parity_integration.py) — run real SQL queries through both code paths and verify results match. Requires a database.

pytest tests/test_c_python_parity_integration.py -v

Verification script — runs both test suites in C-extension and pure-Python modes side-by-side:

python tools/verify_c_python_parity.py

Disabling C extension at runtime:

Set the environment variable NZPY_EXTENDED_NO_CEXT=1 to force pure-Python mode even when the compiled extension is available. Useful for debugging or verifying fallback correctness.

NZPY_EXTENDED_NO_CEXT=1 pip install nzpy_extended
# or at runtime:
NZPY_EXTENDED_NO_CEXT=1 python -c "import nzpy_extended.core; print(nzpy_extended.core._HAVE_C_EXT)"  # False

License

Apache License 2.0 — see LICENSE.

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

nzpy_extended-0.0.1.tar.gz (102.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nzpy_extended-0.0.1-cp314-cp314-win_amd64.whl (74.9 kB view details)

Uploaded CPython 3.14Windows x86-64

nzpy_extended-0.0.1-cp314-cp314-manylinux1_x86_64.manylinux_2_5_x86_64.whl (106.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.5+ x86-64

nzpy_extended-0.0.1-cp314-cp314-macosx_10_15_universal2.whl (81.6 kB view details)

Uploaded CPython 3.14macOS 10.15+ universal2 (ARM64, x86-64)

nzpy_extended-0.0.1-cp313-cp313-win_amd64.whl (74.7 kB view details)

Uploaded CPython 3.13Windows x86-64

nzpy_extended-0.0.1-cp313-cp313-manylinux1_x86_64.manylinux_2_5_x86_64.whl (107.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.5+ x86-64

nzpy_extended-0.0.1-cp313-cp313-macosx_10_13_universal2.whl (80.8 kB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

nzpy_extended-0.0.1-cp312-cp312-win_amd64.whl (74.7 kB view details)

Uploaded CPython 3.12Windows x86-64

nzpy_extended-0.0.1-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl (107.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.5+ x86-64

nzpy_extended-0.0.1-cp312-cp312-macosx_10_13_universal2.whl (80.8 kB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

File details

Details for the file nzpy_extended-0.0.1.tar.gz.

File metadata

  • Download URL: nzpy_extended-0.0.1.tar.gz
  • Upload date:
  • Size: 102.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nzpy_extended-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f6a816aa8995a28dc2b2afd91bab2d02f1728eaa896a3e8ffc94949bb629c26f
MD5 b1083728f8ae773222e86910016ebb37
BLAKE2b-256 9eb019feb93b0cc0f2a1e156686a21067b758bd175dda027231b4d31e04e0e55

See more details on using hashes here.

Provenance

The following attestation bundles were made for nzpy_extended-0.0.1.tar.gz:

Publisher: publish.yaml on KrzysztofDusko/nzpy_extended

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nzpy_extended-0.0.1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for nzpy_extended-0.0.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a1e38345fbaada2d0bfcefe5ddc2d5d1c7408e17fe1b54e526feb7e1249acf95
MD5 a6ebf08ac4f13ac7bb41f9587fe74520
BLAKE2b-256 26b094c7cfa06188b22a7b3a723f43eaea48cfd11bd02fdcdb568dd63774a76e

See more details on using hashes here.

Provenance

The following attestation bundles were made for nzpy_extended-0.0.1-cp314-cp314-win_amd64.whl:

Publisher: publish.yaml on KrzysztofDusko/nzpy_extended

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nzpy_extended-0.0.1-cp314-cp314-manylinux1_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for nzpy_extended-0.0.1-cp314-cp314-manylinux1_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 da2f4ac2d0af5f26f5895cea51f95cd845f916b9c5f7706bf94d2e3272929b08
MD5 67a3f12f38c2adee6f8bd3fd87f9d4f6
BLAKE2b-256 492d219c5dc3e6ceb9bf16f2914b63bdb0cb7ffc489db5380efdde279509e5f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for nzpy_extended-0.0.1-cp314-cp314-manylinux1_x86_64.manylinux_2_5_x86_64.whl:

Publisher: publish.yaml on KrzysztofDusko/nzpy_extended

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nzpy_extended-0.0.1-cp314-cp314-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for nzpy_extended-0.0.1-cp314-cp314-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 bb18ae05aedd8291c97b2c1ede5165c4d493a8ea0a2bb76e6c6bb635d485e64c
MD5 b599ce85928c46214cd56ce8f0b485b6
BLAKE2b-256 c843bc4f1a15affcfdec02062346c2d8caa2b75699ecaf2767e127bdc55d260f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nzpy_extended-0.0.1-cp314-cp314-macosx_10_15_universal2.whl:

Publisher: publish.yaml on KrzysztofDusko/nzpy_extended

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nzpy_extended-0.0.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for nzpy_extended-0.0.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 59f3b5eef9264a1dc2b49571bc0295ac29848b5e997f147470fa727e0cb367b9
MD5 cbea4b35f261cc45d6923e1cfc153368
BLAKE2b-256 dbdf39f85ba0a12edc6ed647255bbe56012f06ab1878f4102f899261b326a63a

See more details on using hashes here.

Provenance

The following attestation bundles were made for nzpy_extended-0.0.1-cp313-cp313-win_amd64.whl:

Publisher: publish.yaml on KrzysztofDusko/nzpy_extended

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nzpy_extended-0.0.1-cp313-cp313-manylinux1_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for nzpy_extended-0.0.1-cp313-cp313-manylinux1_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a9a65891001252d3e2aa922d690da52438ca1de2756048d0a37be9c2c82a9110
MD5 6f71eeda139856ec119d1bfa022bdee4
BLAKE2b-256 98b4224de6a07dce6dc7218608471ac0d6883217b1843131f3b578b9506a68c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for nzpy_extended-0.0.1-cp313-cp313-manylinux1_x86_64.manylinux_2_5_x86_64.whl:

Publisher: publish.yaml on KrzysztofDusko/nzpy_extended

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nzpy_extended-0.0.1-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for nzpy_extended-0.0.1-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 45189694192af951aa702f5625ab9dac8331028acf15d3179b953235f9759472
MD5 0d9b157adbfa618e73a820f00ed55c0b
BLAKE2b-256 1867921429153faf1228069800d6f720e824762dfcc795d75f73dcd4d1e959ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for nzpy_extended-0.0.1-cp313-cp313-macosx_10_13_universal2.whl:

Publisher: publish.yaml on KrzysztofDusko/nzpy_extended

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nzpy_extended-0.0.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for nzpy_extended-0.0.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0bdce70b5e2477db413b00d1678b1618b4188e3e64dac6f3ae1a72c12b717392
MD5 2310ba781ac6929370b2f50d96d698d4
BLAKE2b-256 b69c9ef972d3868bc403a3016a6bdab1c93f79ff47d36c400a107c5df5e19ca0

See more details on using hashes here.

Provenance

The following attestation bundles were made for nzpy_extended-0.0.1-cp312-cp312-win_amd64.whl:

Publisher: publish.yaml on KrzysztofDusko/nzpy_extended

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nzpy_extended-0.0.1-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for nzpy_extended-0.0.1-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 1da1a249db509c0729660cb972f9479e2c72ffafb04f884b7dc8d476d9e14767
MD5 458985ddc4fc8f2c73696dab31300aa8
BLAKE2b-256 bfa9c36c1972074c41e382f369ea919172c8320cc7c2d20dd88afd5d9bc4abeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for nzpy_extended-0.0.1-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl:

Publisher: publish.yaml on KrzysztofDusko/nzpy_extended

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nzpy_extended-0.0.1-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for nzpy_extended-0.0.1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 c7e8ad941e10051314ab6ed115f441023fed8b3e57e011810dcbe28ecbbad68f
MD5 fee794a2dc4908ea4840be3f8d74e1ae
BLAKE2b-256 c38353b035bc114e7a3c58e25f81859804c8f06c54336d73ec7cd9b0349219d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for nzpy_extended-0.0.1-cp312-cp312-macosx_10_13_universal2.whl:

Publisher: publish.yaml on KrzysztofDusko/nzpy_extended

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page