pynuodb


Namepynuodb JSON
Version 2.6.1 PyPI version JSON
download
home_pagehttps://github.com/nuodb/nuodb-python
SummaryNuoDB Python driver
upload_time2023-09-19 17:00:49
maintainer
docs_urlNone
authorNuoDB
requires_python
licenseBSD License
keywords nuodb scalable cloud database
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ==============
NuoDB - Python
==============

.. image::https://circleci.com/gh/nuodb/nuodb-python.svg?style=svg
    :target: https://circleci.com/gh/nuodb/nuodb-python
    :alt: Test Results
.. image:: https://gitlab.com/cadmin/nuodb-python/badges/master/pipeline.svg
    :target: https://gitlab.com/nuodb-mirror/nuodb-python/-/jobs
    :alt: Dependency Verification

.. contents::

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 -- one of the following:

  - CPython_ >= 2.7

* NuoDB -- one of the following:

  - NuoDB_ >= 2.0.4

If you don't have a NuoDB domain available you can create one using the Docker
image on DockerHub.  See `Quick Start Guides / Docker <https://doc.nuodb.com/nuodb/latest/quick-start-guide/docker/>`_.

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:

.. code:: python

    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 <https://github.com/nuodb/nuodb-python/blob/master/LICENSE>`_.

.. _Documentation: https://doc.nuodb.com/nuodb/latest/introduction-to-nuodb/
.. _NuoDB: https://www.nuodb.com/
.. _CPython: https://www.python.org/
.. _PEP 249: https://www.python.org/dev/peps/pep-0249/
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nuodb/nuodb-python",
    "name": "pynuodb",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "nuodb scalable cloud database",
    "author": "NuoDB",
    "author_email": "drivers@nuodb.com",
    "download_url": "https://files.pythonhosted.org/packages/15/f0/cc02eeb293fed0042165a3f0ee5e4d33a2f5de692b3f62511a096eff4cf2/pynuodb-2.6.1.tar.gz",
    "platform": null,
    "description": "==============\nNuoDB - Python\n==============\n\n.. image::https://circleci.com/gh/nuodb/nuodb-python.svg?style=svg\n    :target: https://circleci.com/gh/nuodb/nuodb-python\n    :alt: Test Results\n.. image:: https://gitlab.com/cadmin/nuodb-python/badges/master/pipeline.svg\n    :target: https://gitlab.com/nuodb-mirror/nuodb-python/-/jobs\n    :alt: Dependency Verification\n\n.. contents::\n\nThis package contains the community driven pure-Python NuoDB_ client library\nthat provides a standard `PEP 249`_ SQL API. This is a community driven driver\nwith limited support and testing from NuoDB.\n\nRequirements\n------------\n\n* Python -- one of the following:\n\n  - CPython_ >= 2.7\n\n* NuoDB -- one of the following:\n\n  - NuoDB_ >= 2.0.4\n\nIf you don't have a NuoDB domain available you can create one using the Docker\nimage on DockerHub.  See `Quick Start Guides / Docker <https://doc.nuodb.com/nuodb/latest/quick-start-guide/docker/>`_.\n\nInstallation\n------------\n\nThe current stable release is available on PyPI and can be installed with\n``pip``::\n\n    $ pip install pynuodb\n\nAlternatively (e.g. if ``pip`` is not available), a tarball can be downloaded\nfrom GitHub and installed with Setuptools::\n\n    $ curl -L https://github.com/nuodb/nuodb-python/archive/master.tar.gz | tar xz\n    $ cd nuodb-python*\n    $ python setup.py install\n    # The folder nuodb-python* can be safely removed now.\n\nExample\n-------\n\nHere is an example using the `PEP 249`_ API that creates some tables, inserts\nsome data, runs a query, and cleans up after itself:\n\n.. code:: python\n\n    import pynuodb\n\n    options = {\"schema\": \"test\"}\n    connect_kw_args = {'database': \"test\", 'host': \"localhost\", 'user': \"dba\", 'password': \"dba\", 'options': options}\n\n    connection = pynuodb.connect(**connect_kw_args)\n    cursor = connection.cursor()\n    try:\n        stmt_drop = \"DROP TABLE IF EXISTS names\"\n        cursor.execute(stmt_drop)\n\n        stmt_create = \"\"\"\n        CREATE TABLE names (\n            id BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY PRIMARY KEY,\n            name VARCHAR(30) DEFAULT '' NOT NULL,\n            age INTEGER DEFAULT 0\n        )\"\"\"\n        cursor.execute(stmt_create)\n\n        names = (('Greg', 17,), ('Marsha', 16,), ('Jan', 14,))\n        stmt_insert = \"INSERT INTO names (name, age) VALUES (?, ?)\"\n        cursor.executemany(stmt_insert, names)\n\n        connection.commit()\n\n        age_limit = 15\n        stmt_select = \"SELECT id, name FROM names where age > ? ORDER BY id\"\n        cursor.execute(stmt_select, (age_limit,))\n        print(\"Results:\")\n        for row in cursor.fetchall():\n            print(\"%d | %s\" % (row[0], row[1]))\n\n    finally:\n        cursor.execute(stmt_drop)\n        cursor.close()\n        connection.close()\n\nFor further information on getting started with NuoDB, please refer to the Documentation_.\n\nResources\n---------\n\nDB-API 2.0: https://www.python.org/dev/peps/pep-0249/\n\nNuoDB Documentation: https://doc.nuodb.com/nuodb/latest/introduction-to-nuodb/\n\nLicense\n-------\n\nPyNuoDB is licensed under a `BSD 3-Clause License <https://github.com/nuodb/nuodb-python/blob/master/LICENSE>`_.\n\n.. _Documentation: https://doc.nuodb.com/nuodb/latest/introduction-to-nuodb/\n.. _NuoDB: https://www.nuodb.com/\n.. _CPython: https://www.python.org/\n.. _PEP 249: https://www.python.org/dev/peps/pep-0249/",
    "bugtrack_url": null,
    "license": "BSD License",
    "summary": "NuoDB Python driver",
    "version": "2.6.1",
    "project_urls": {
        "Homepage": "https://github.com/nuodb/nuodb-python"
    },
    "split_keywords": [
        "nuodb",
        "scalable",
        "cloud",
        "database"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "15f0cc02eeb293fed0042165a3f0ee5e4d33a2f5de692b3f62511a096eff4cf2",
                "md5": "6ab4f77a83cc36cf543817d98e0e9a0b",
                "sha256": "6084990d90b9ab905f9bc6e344bdcfef7bc6d43db68332fce6d8bc54d6c33d52"
            },
            "downloads": -1,
            "filename": "pynuodb-2.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6ab4f77a83cc36cf543817d98e0e9a0b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 40393,
            "upload_time": "2023-09-19T17:00:49",
            "upload_time_iso_8601": "2023-09-19T17:00:49.421534Z",
            "url": "https://files.pythonhosted.org/packages/15/f0/cc02eeb293fed0042165a3f0ee5e4d33a2f5de692b3f62511a096eff4cf2/pynuodb-2.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-19 17:00:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nuodb",
    "github_project": "nuodb-python",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": false,
    "circle": true,
    "requirements": [],
    "test_requirements": [],
    "lcname": "pynuodb"
}
        
Elapsed time: 0.12487s