Skip to content

Commit

Permalink
Merge branch 'release/v0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
singulared committed May 12, 2016
2 parents 7c9c134 + 50aa8e4 commit ba95061
Show file tree
Hide file tree
Showing 13 changed files with 710 additions and 69 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.1.0 (2016-05-12)

Add:

- Project documentation

## 0.0.5 (2016-04-25)

Fix:
Expand Down
51 changes: 0 additions & 51 deletions README.md

This file was deleted.

98 changes: 98 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
.. image:: https://travis-ci.org/rambler-digital-solutions/aioriak.svg?branch=master
:target: https://travis-ci.org/rambler-digital-solutions/aioriak
:alt: Build Status

.. image:: https://coveralls.io/repos/github/rambler-digital-solutions/aioriak/badge.svg?branch=master
:target: https://coveralls.io/github/rambler-digital-solutions/aioriak?branch=master
:alt: Coverage Status

.. image:: https://img.shields.io/github/issues/rambler-digital-solutions/aioriak.svg
:target: https://github.com/rambler-digital-solutions/aioriak/issues
:alt: GitHub issues

.. image:: https://badge.fury.io/py/aioriak.svg
:target: https://badge.fury.io/py/aioriak
:alt: PyPI version


Asyncio (:pep:`3156`) Riak client library.
This project is based on official Bash python client library
(https://github.com/basho/riak-python-client).

Features
--------

================================ ==============================
Riak KV operations Yes
Riak Datatypes Yes
Riak BucketTypes Yes
Custom resolver Yes
Node list support No
Custom quorum No
Connections Pool No
Operations timout No
Security No
Riak Search No
MapReduce No
Tested python versions `3.5.0, 3.5.1 <travis_>`_
Tested Riak versions `2.1.3, 2.1.4 <travis_>`_
================================ ==============================

Documentation
-------------
You can read the docs here: `Documentation`_

Installation
------------

The easiest way to install aioriak is by using the package on PyPi::

pip install aioriak

Requirements
------------

- Python >= 3.5
- riak>=2.1.3

Using exampe
------------

.. code-block:: python
client = await RiakClient.create('localhost', loop=loop)
bucket_type = client.bucket_type('default')
bucket = bucket_type.bucket('example')
obj = await bucket.get('key')
print(obj.data)
Testing
-------

Docker based testing
--------------------

You can use docker for running:

.. code-block:: bash
DOCKER_CLUSTER=1 python setup.py test
Contribute
----------

- Issue Tracker: https://github.com/rambler-digital-solutions/aioriak/issues
- Source Code: https://github.com/rambler-digital-solutions/aioriak

Feel free to file an issue or make pull request if you find any bugs or have
some suggestions for library improvement.

License
-------

The aioriak is offered under `MIT license`_.

----

.. _MIT license: https://raw.githubusercontent.com/rambler-digital-solutions/aioriak/master/LICENSE.txt
.. _travis: https://travis-ci.org/rambler-digital-solutions/aioriak
.. _Documentation: http://aioriak.readthedocs.io/
28 changes: 22 additions & 6 deletions aioriak/bucket.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
from aioriak.datatypes import TYPES


def bucket_property(name, doc=None):
def _prop_getter(self):
return self.get_property(name)

def _prop_setter(self, value):
return self.set_property(name, value)

return property(_prop_getter, _prop_setter, doc=doc)


class Bucket:
'''
The ``Bucket`` object allows you to access and change information
Expand Down Expand Up @@ -52,6 +62,12 @@ def _set_resolver(self, value):
bucket. If the resolver is not set, the
client's resolver will be used.''')

allow_mult = bucket_property(
'allow_mult',
doc='''If set to True, then writes with conflicting data will be stored
and returned to the client.
:type bool: boolean''')

def get_decoder(self, content_type):
'''
Get the decoding function for the provided content type for
Expand Down Expand Up @@ -229,10 +245,10 @@ async def delete(self, key, **kwargs):

def __repr__(self):
if self.bucket_type.is_default():
return '<RiakBucket {}>'.format(self.name)
return '<Bucket {}>'.format(self.name)
else:
return '<RiakBucket {}/{}>'.format(self.bucket_type.name,
self.name)
return '<Bucket {}/{}>'.format(self.bucket_type.name,
self.name)


class BucketType:
Expand All @@ -241,7 +257,7 @@ class BucketType:
properties on a Riak bucket type and access buckets within its
namespace.
Async implementation of <riak.bucket.BucketType>
Async implementation of :class:`riak.bucket.BucketType`
'''
def __init__(self, client, name):
'''
Expand Down Expand Up @@ -345,7 +361,7 @@ def bucket(self, name):
:param name: the bucket name
:type name: str
:rtype: :class:`RiakBucket`
:rtype: :class:`Bucket`
'''
return self._client.bucket(name, self)

Expand All @@ -357,7 +373,7 @@ async def get_buckets(self):
.. warning:: Do not use this in production, as it requires
traversing through all keys stored in a cluster.
:rtype: list of :class:`Bucket <riak.bucket.Bucket>`
:rtype: list of :class:`Bucket <aioriak.bucket.Bucket>`
instances
'''
return await self._client.get_buckets(bucket_type=self)
Expand Down
2 changes: 1 addition & 1 deletion aioriak/datatypes/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Map(Mapping, Datatype):
del map[('emails', 'set')]
Convenience accessors exist that partition the map's keys by
datatype and implement the :class:`~collections.Mapping`
datatype and implement the collections.Mapping
behavior as well as supporting deletion::
map.sets['emails']
Expand Down
Loading

0 comments on commit ba95061

Please sign in to comment.