Skip to content
The Riak client for Python.
Python Erlang Shell Other
Latest commit b5f0bdb Jun 17, 2016 @lukebakken lukebakken Add tests for GH-483
Failed to load latest commit information.
build Remove requirement for publish to be from master branch May 31, 2016
buildbot Add Travis build status, ensure all integration tests are run on buil… Jun 16, 2016
docs Moving code around to separate codecs from transports. Mar 29, 2016
riak Add tests for GH-483 Jun 17, 2016
riak_pb @ d14b2c9 Improve unix timestamp -> datetime conversion, update to riak_pb 2.1.3.0 Apr 29, 2016
tools @ 4dae68d bump submodules Mar 21, 2016
.gitignore Add ignored dir, add contributor May 2, 2016
.gitmodules Begin migrating to the use of riak-client-tools scripts Feb 11, 2016
.hgignore final fixes before pushing to PyPI Jun 15, 2010
.hgtags Added tag riak-python-client-1.1.1 for changeset 6f4f58e0c381 Jun 30, 2010
.travis.yml whitespace Jun 16, 2016
LICENSE add LICENSE and README Apr 8, 2010
MANIFEST.in Improve README generation Mar 29, 2016
Makefile Unexport vars related to encoding, ensure files are opened with utf-8… May 19, 2016
README.md Add Travis build status, ensure all integration tests are run on buil… Jun 16, 2016
RELNOTES.md Clarify release info Jun 9, 2016
commands.py Migrate more stuff to riak-client-tools Feb 13, 2016
make.ps1 Add basic make.ps1 for Windows Apr 27, 2016
setup.cfg added sensible parameters for nosetests Apr 22, 2011
setup.py Unexport vars related to encoding, ensure files are opened with utf-8… May 19, 2016
tox.ini Remove added text May 3, 2016
version.py Unexport vars related to encoding, ensure files are opened with utf-8… May 19, 2016

README.md

Python Client for Riak

Build Status

Build Status

Documentation

Documentation for the Riak Python Client Library is available here.

Documentation for Riak is available here.

Repository Cloning

NOTE: please clone this repository using the --recursive argument to git clone or follow the clone with git submodule update --init. This repository uses two submodules.

Install

The recommended versions of Python for use with this client are Python 2.7.x, 3.3.x, 3.4.x and 3.5.x. The latest version from each series should be preferred.

Riak TS (Timeseries)

You must use version 2.7.11, 3.4.4 or 3.5.1 (or greater within a version series). Otherwise you will be affected by this Python bug.

From Source

python setup.py install

There are additional dependencies on Python packages setuptools and protobuf.

From PyPI

Official packages are signed and published to PyPI.

To install from PyPI directly you can use pip.

pip install riak

Testing

To setup the default test configuration build a test Riak node (from a riak directory)

make rel

See Basic Cluster Setup for more details.

For all of the simple default values, set the RIAK_DIR environment variable to the root of your Riak installation. Then from the riak-python-client directory

make -C buildbot preconfigure

Start your Riak node with riak start from the the Riak directory, then

make -C buildbot configure
make -C buildbot test

That will run the test suite twice: once with security enabled and once without.

Connections to Riak in Tests

If your Riak server isn't running on localhost or you have built a Riak devrel from source, use the environment variables RIAK_TEST_HOST, RIAK_TEST_HTTP_PORT and RIAK_TEST_PB_PORT to specify where to find the Riak server. RIAK_TEST_PROTOCOL to specify which protocol to test. Can be either pbc or http.

Some of the connection tests need port numbers that are NOT in use. If ports 1023 and 1022 are in use on your test system, set the environment variables DUMMY_HTTP_PORT and DUMMY_PB_PORT to unused port numbers.

Testing Search

If you don't have Riak Search enabled, you can set the RUN_SEARCH environment variable to 0 skip those tests.

If you don't have Search 2.0 enabled, you can set the RUN_YZ environment variable to 0 to skip those tests.

Testing Bucket Types (Riak 2+)

To test bucket-types, you must run the create_bucket_types setup command, which will create the bucket-types used in testing, or create them manually yourself. It can be run like so (substituting $RIAK with the root of your Riak install)

./setup.py create_bucket_types --riak-admin=$RIAK/bin/riak-admin

You may alternately add these lines to setup.cfg

[create_bucket_types]
riak-admin=/Users/sean/dev/riak/rel/riak/bin/riak-admin

To skip the bucket-type tests, set the RUN_BTYPES environment variable to 0.

Testing Data Types (Riak 2+)

To test data types, you must set up bucket types (see above.)

To skip the data type tests, set the RUN_DATATYPES environment variable to 0.

Testing Timeseries (Riak 2.1+)

To test timeseries data, you must run the setup_timeseries command, which will create the bucket-types used in testing, or create them manually yourself. It can be run like so (substituting $RIAK with the root of your Riak install)

./setup.py setup_timeseries --riak-admin=$RIAK/bin/riak-admin

You may alternately add these lines to setup.cfg

[setup_timeseries]
riak-admin=/Users/sean/dev/riak/rel/riak/bin/riak-admin

To enable the timeseries tests, set the RUN_TIMESERIES environment variable to 1.

Testing Secondary Indexes

To test Secondary Indexes, the RUN_INDEXES environment variable must be set to 1 (or 0 to skip them.)

Testing Security (Riak 2+)

Ensure that the hostname riak-test resolves to your Riak host (most likely localhost). This is so the SSL host verification can succeed.

By default Security is not enabled on Riak. Once security = on is configured in the riak.conf file it can be enabled with riak-admin.

To run the tests

RUN_SECURITY=1 RIAK_TEST_HTTP_PORT=18098 python setup.py test

Contributors

  • Andrew Thompson
  • Andy Gross
  • Armon Dadgar
  • Brett Hazen
  • Brett Hoerner
  • Brian Roach
  • Bryan Fink
  • Daniel Lindsley
  • Daniel Néri
  • Daniel Reverri
  • Dan Root
  • David Basden
  • David Koblas
  • Dmitry Rozhkov
  • Eric Florenzano
  • Eric Moritz
  • Filip de Waard
  • Gilles Devaux
  • Greg Nelson
  • Gregory Burd
  • Greg Stein
  • Ian Plosker
  • Jayson Baird
  • Jeffrey Massung
  • Jon Meredith
  • Josip Lisec
  • Justin Sheehy
  • Kevin Smith
  • Luke Bakken
  • Mark Erdmann
  • Mark Phillips
  • Mathias Meyer
  • Matt Heitzenroder
  • Matt Lohier
  • Mikhail Sobolev
  • Reid Draper
  • Russell Brown
  • Rusty Klophaus
  • Rusty Klophaus
  • Scott Lystig Fritchie
  • Sean Cribbs
  • Shuhao Wu
  • Silas Sewell
  • Socrates Lee
  • Soren Hansen
  • Sreejith Kesavan
  • Timothée Peignier
  • Vitaly Shestovskiy
  • William Kral
  • Yasser Souri
Something went wrong with that request. Please try again.