janjagusch / storefact

A factory for simplekv-Store-based storage classes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image

image

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)
  1. Use an URL to specify the configuration

URL and store types:

  • In memory: memory:// and hmemory://.
  • Redis: redis://[[password@]host[:port]][/db] and hredis://[[password@]host[:port]][/db]
  • Filesystem: fs:// and hfs://
  • Amazon S3: s3://access_key:secret_key@endpoint/bucket[?create_if_missing=true] and hs3://access_key:secret_key@endpoint/bucket[?create_if_missing=true]
  • Azure Blob Storage (azure:// and hazure://):
    • with storage account key: azure://account_name:account_key@container[?create_if_missing=true][?max_connections=2]
    • with SAS token: azure://account_name:shared_access_signature@container?use_sas&create_if_missing=false[?max_connections=2&socket_timeout=(20,100)]
    • with SAS and additional parameters: azure://account_name:shared_access_signature@container?use_sas&create_if_missing=false[?max_connections=2&socket_timeout=(20,100)][?max_block_size=4*1024*1024&max_single_put_size=64*1024*1024][?default_endpoints_protocol=http&blob_endpoint=http://localhost:2121]

Storage URLs starting with a h indicate extended allowed characters. This allows the usage of slashes and spaces in blob names. URL options with [] are optional and the [] need to be removed.

Documentation

The documentation can be found on readthedocs.

Development

To run the all tests run:

tox

About

A factory for simplekv-Store-based storage classes.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%