Skip to main content
https://dl.circleci.com/status-badge/img/gh/nuodb/nuodb-python/tree/master.svg?style=svg

This package contains the community driven pure-Python NuoDB client library that provides a standard PEP 249 SQL API. This is a community driven driver with limited support and testing from NuoDB.

Requirements

  • Python >= 2.7

    • Recommended Python version >= 3.8

    • Tested with CPython 2.7 and 3.6

  • NuoDB >= 6.0.2

If you don’t have a NuoDB domain available you can create one using the Docker image on DockerHub.

Installation

The current stable release is available on PyPI and can be installed with pip:

$ pip install pynuodb

Alternatively (e.g. if pip is not available), a tarball can be downloaded from GitHub and installed with Setuptools:

$ curl -L https://github.com/nuodb/nuodb-python/archive/master.tar.gz | tar xz
$ cd nuodb-python*
$ python setup.py install
# The folder nuodb-python* can be safely removed now.

Example

Here is an example using the PEP 249 API that creates some tables, inserts some data, runs a query, and cleans up after itself:

import pynuodb

options = {"schema": "test"}
connect_kw_args = {'database': "test", 'host': "localhost", 'user': "dba", 'password': "dba", 'options': options}

connection = pynuodb.connect(**connect_kw_args)
cursor = connection.cursor()
try:
    stmt_drop = "DROP TABLE IF EXISTS names"
    cursor.execute(stmt_drop)

    stmt_create = """
    CREATE TABLE names (
        id BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
        name VARCHAR(30) DEFAULT '' NOT NULL,
        age INTEGER DEFAULT 0
    )"""
    cursor.execute(stmt_create)

    names = (('Greg', 17,), ('Marsha', 16,), ('Jan', 14,))
    stmt_insert = "INSERT INTO names (name, age) VALUES (?, ?)"
    cursor.executemany(stmt_insert, names)

    connection.commit()

    age_limit = 15
    stmt_select = "SELECT id, name FROM names where age > ? ORDER BY id"
    cursor.execute(stmt_select, (age_limit,))
    print("Results:")
    for row in cursor.fetchall():
        print("%d | %s" % (row[0], row[1]))

finally:
    cursor.execute(stmt_drop)
    cursor.close()
    connection.close()

For further information on getting started with NuoDB, please refer to the Documentation.

Resources

DB-API 2.0: https://www.python.org/dev/peps/pep-0249/

NuoDB Documentation: https://doc.nuodb.com/nuodb/latest/introduction-to-nuodb/

License

PyNuoDB is licensed under a BSD 3-Clause License.

Release files for pynuodb 4.1.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 pynuodb 4.1.0
File Size Uploaded
pynuodb-4.1.0.tar.gz 39.3 kB Details

Release files / pynuodb-4.1.0.tar.gz

Download URL pynuodb-4.1.0.tar.gz
Size 39.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3c06b41ba81cf4271f5efbb0e971308cd31f0ca47fd25b3cc10c91ac70c95f51
BLAKE2b-256 checksum
How to use checksums
01f27dcf08764403a0b94b661fcd1e2d34855d38f61c1cc340f37cfe3982b555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18

Release history Release notifications | RSS feed

This release

4.1.0 This release

1 release file

4.0.0

1 release file

3.0.0

1 release file

2.6.1

1 release file

2.6.0

1 release file

2.5.2

1 release file

2.5.1

1 release file

2.5.0

1 release file

2.4.1

1 release file

2.4.0

1 release file

2.3.3

1 release file

2.3.2

1 release file

2.3.1

1 release file

2.3

2.2

1 release file

2.1

1 release file

2.0

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

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