An asynchronous DynamoDB client and mixin for Tornado applications
Go to file
Gavin M. Roy 932195301a Change pins to support tornado-aws 2 2019-11-17 12:38:21 -05:00
docs Change pins to support tornado-aws 2 2019-11-17 12:38:21 -05:00
examples Support Python 3.7, drop support for Python 2 2019-02-11 14:10:51 -05:00
requires Change pins to support tornado-aws 2 2019-11-17 12:38:21 -05:00
sprockets_dynamodb Change pins to support tornado-aws 2 2019-11-17 12:38:21 -05:00
tests test empty bytes 2019-06-07 11:26:54 -04:00
.editorconfig Initial commit 2016-09-26 16:46:55 -04:00
.gitignore Support Python 3.7, drop support for Python 2 2019-02-11 14:10:51 -05:00
.travis.yml Support Python 3.7, drop support for Python 2 2019-02-11 14:10:51 -05:00
LICENSE Initial commit 2016-09-26 16:46:55 -04:00
MANIFEST.in Initial commit 2016-09-26 16:46:55 -04:00
README.rst Remove download count badge 2018-04-06 21:52:58 -04:00
bootstrap Add AWS env vars to bootstrap env file creation 2019-05-01 19:44:29 -04:00
docker-compose.yml Initial commit 2016-09-26 16:46:55 -04:00
setup.cfg Fix tests, implement more methods 2016-10-14 17:49:25 -04:00
setup.py Support Python 3.7, drop support for Python 2 2019-02-11 14:10:51 -05:00

README.rst

Sprockets DynamoDB
==================
An asynchronous DynamoDB client and mixin for Tornado applications

|Version| |Status| |Coverage| |License|

Installation
------------
``sprockets-dynamodb`` is available on the Python package index and is installable via pip:

.. code:: bash

    pip install sprockets-dynamodb

Documentation
-------------
Documentation is available at `sprockets-dynamodb.readthedocs.io <https://sprockets-dynamodb.readthedocs.io>`_.

Configuration
-------------
The following table details the environment variable configuration options.

+----------------------------------+--------------------------------------------------------------------------+---------+
| Variable                         | Definition                                                               | Default |
+==================================+==========================================================================+=========+
| ``DYNAMODB_ENDPOINT``            | Override the default DynamoDB HTTP endpoint                              |         |
+----------------------------------+--------------------------------------------------------------------------+---------+
| ``DYNAMODB_MAX_CLIENTS``         | Maximum number of concurrent DynamoDB clients/requests per process       | ``100`` |
+----------------------------------+--------------------------------------------------------------------------+---------+
| ``DYNAMODB_MAX_RETRIES``         | Maximum number retries for transient errors                              | ``3``   |
+----------------------------------+--------------------------------------------------------------------------+---------+
| ``DYANMODB_NO_CREDS_RATE_LIMIT`` | If set to ``true``, a ``sprockets_dynamodb.NoCredentialsException`` will |         |
|                                  | return a 429 response when using ``sprockets_dynamodb.DynamoDBMixin``    |         |
+----------------------------------+--------------------------------------------------------------------------+---------+

Mixin Configuration
^^^^^^^^^^^^^^^^^^^
The ``sprockets_dynamodb.DynamoDBMixin`` class will automatically raise ``HTTPError``
responses for different classes of errors coming from DynamoDB. In addition it will attempt to
work with the `Sprockets InfluxDB <https://github.com/sprockets/sprockets-influxdb>`_ client
to instrument all DynamoDB requests, submitting per request measurements to InfluxDB. It will
attempt to automatically tag measurements with the application/service name if the ``SERVICE``
environment variable is set. It will also tag the measurement if the ``ENVIRONMENT`` environment
variable is set with the environment that the application is running in. Finally, if you are
using the `Sprockets Correlation Mixin <https://github.com/sprockets/sprockets.mixins.correlation>`_,
measurements will automatically be tagged with the correlation ID for a request.

Requirements
------------
-  `Tornado <https://tornadoweb.org>`_
-  `tornado-aws <https://pypi.python.org/pypi/tornado-aws>`_

Version History
---------------
Available at https://sprockets-dynamodb.readthedocs.org/en/latest/history.html

.. |Version| image:: https://img.shields.io/pypi/v/sprockets-dynamodb.svg?
   :target: https://pypi.python.org/pypi/sprockets-dynamodb

.. |Status| image:: https://img.shields.io/travis/sprockets/sprockets-dynamodb.svg?
   :target: https://travis-ci.org/sprockets/sprockets-dynamodb

.. |Coverage| image:: https://img.shields.io/codecov/c/github/sprockets/sprockets-dynamodb.svg?
   :target: https://codecov.io/github/sprockets/sprockets-dynamodb?branch=master

.. |License| image:: https://img.shields.io/pypi/l/sprockets-dynamodb.svg?
   :target: https://sprockets-dynamodb.readthedocs.org