Welcome to Store factory for simplekv’s documentation!

Contents:

Overview

https://travis-ci.org/JDASoftwareGroup/storefact.svg?branch=master https://codecov.io/gh/JDASoftwareGroup/storefact/branch/master/graph/badge.svg Documentation Status

Store factory for simplekv

A factory for simplekv-Store-based storage classes. Takes configuration values and returns a simplekv-Store.

This allows one to easily deploy a blob-based store in production, but test with a filesystem-based store in development. The following simplekv-Stores are supported in storefact:

  • DictStore
  • RedisStore
  • FilesystemStore
  • BotoStore (Amazon S3)
  • AzureBlockBlobStorage

Storefact is released as open source under the 3-clause BSD license.

Installation

pip install storefact

Usage

There are two possibilities to use storefact.

  1. Use a dictionary with configuration data (e.g. loaded from an ini file)
from storefact import get_store

params = {
    'account_name': 'test',
    'account_key': 'XXXsome_azure_account_keyXXX',
    'container': 'my-azure-container',
}
store = get_store('azure', **params)
store.put(u'key', b'value')
assert store.get(u'key') == b'value'
  1. Use an URL to specify the configuration
from storefact import get_store_from_url, get_store

store = get_store_from_url('azure://test:XXXsome_azure_account_keyXXX@my-azure-container')
store.put(u'key', b'value')
assert store.get(u'key') == b'value'

Documentation

The documentation can be found on readthedocs.

Development

To run the all tests run:

tox

Reference

storefact

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

Bug reports

When reporting a bug please include:

  • Your operating system name and version.
  • Any details about your local setup that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.

Documentation improvements

Store factory for simplekv could always use more documentation, whether as part of the official Store factory for simplekv docs, in docstrings, or even on the web in blog posts, articles, and such.

Feature requests and feedback

If you are proposing a feature:

  • Explain in detail how it would work.
  • Keep the scope as narrow as possible, to make it easier to implement.
  • Remember that this is a volunteer-driven project, and that contributions are welcome :)

Development

Pull Request Guidelines

If you need some code review or feedback while you’re developing the code just make the pull request.

For merging, you should:

  1. Include passing tests (run tox).
  2. Update documentation when there’s new API, functionality etc.
  3. Add a note to CHANGELOG.rst about the changes.
  4. Add yourself to AUTHORS.rst.

Tips

To run a subset of tests:

tox -e envname -- py.test -k test_myfeature

To run all the test environments in parallel (you need to pip install detox):

detox

Authors

Release Notes

Indices and tables