Skip to main content

A native Python client for the Vertica database.

Project description

# vertica-python

vertica-python is a native Python adapter for the Vertica (http://www.vertica.com) database.

This package is a Python port of the excellent Vertica Ruby gem (https://github.com/sprsquish/vertica).

vertica-python is currently in a alpha stage; it has been tested for functionality, but does not have a test suite. Please use with caution, and feel free to submit issues and/or pull requests.

vertica-python has been tested with Vertica 6.1.2 and Python 2.7.5. Please let me know if it's working on other versions.


## Installation

pip install vertica-python

Source code for vertica-python can be found at:

http://github.com/uber/vertica-python

## Usage


**Buffered** (in-memory) results:

```
from vertica_python import connect

connection = connect({
'host': '127.0.0.1',
'port': 5433,
'user': 'some_user',
'password': 'some_password',
'database': 'a_database'

})

result = connection.query("SELECT * FROM a_table LIMIT 2")
connection.close()

print result.rows()
# [{'id': 1, 'value': 'something'}, {'id': 2, 'value': 'something_else'}]

```

**Unbuffered** (streaming) results:

```
from vertica_python import connect

connection = connect({
'host': '127.0.0.1',
'port': 5433,
'user': 'some_user',
'password': 'some_password',
'database': 'a_database'

})

def magical_row_handler(row):
print row

result = connection.query("SELECT * FROM a_table LIMIT 2", options={}, handler=magical_row_jhandler)
# {'id': 1, 'value': 'something'}
# {'id': 2, 'value': 'something_else'}

connection.close()

```

## License

MIT License, please see `LICENSE` for details.


## Acknowledgements

Many thanks go to the contributors to the Ruby Vertica gem, since they did all of the wrestling with Vertica's protocol and have kept the gem updated. They are:

* [Matt Bauer](http://github.com/mattbauer)
* [Jeff Smick](http://github.com/sprsquish)
* [Willem van Bergen](http://github.com/wvanbergen)
* [Camilo Lopez](http://github.com/camilo)

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vertica-python-0.1.4.tar.gz (13.8 kB view details)

Uploaded Source

File details

Details for the file vertica-python-0.1.4.tar.gz.

File metadata

File hashes

Hashes for vertica-python-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9f2b32bc09e9de8c70f0ca173365d8afa8d877b1c1fb849ee4f2936e816e5666
MD5 e24dfeacc30e23a5a5f369c075211d51
BLAKE2b-256 9acf447b30a8f6e7d69ee9296e5771d4958758d39260edd9322ec9f37b765c33

See more details on using hashes here.

Provenance

Supported by

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