Skip to main content

.. image:: https://travis-ci.org/JDASoftwareGroup/storefact.svg?branch=master :target: https://travis-ci.org/JDASoftwareGroup/storefact .. image:: https://codecov.io/gh/JDASoftwareGroup/storefact/branch/master/graph/badge.svg :target: https://codecov.io/gh/JDASoftwareGroup/storefact .. image:: https://readthedocs.org/projects/storefact/badge/?version=latest :target: http://storefact.readthedocs.io/en/latest/?badge=latest :alt: 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.

.. _simplekv: https://github.com/mbr/simplekv

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)

.. code-block:: python

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

.. code-block:: python

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'

URL and store types:

  • In memory: :code:memory:// and :code:hmemory://.
  • Redis: :code:redis://[[password@]host[:port]][/db] and :code:hredis://[[password@]host[:port]][/db]
  • Filesystem: :code:fs:// and :code:hfs://
  • Amazon S3: :code:s3://access_key:secret_key@endpoint/bucket[?create_if_missing=true] and :code:hs3://access_key:secret_key@endpoint/bucket[?create_if_missing=true]
  • Azure Blob Storage (:code:azure:// and :code:hazure://):
    • with storage account key: :code:azure://account_name:account_key@container[?create_if_missing=true][?max_connections=2]
    • with SAS token: :code: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: :code: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 :code:h indicate extended allowed characters. This allows the usage of slashes and spaces in blob names. URL options with :code:[] are optional and the :code:[] need to be removed.

Documentation

The documentation can be found on readthedocs_.

.. _readthedocs: https://storefact.readthedocs.io/

Development

To run the all tests run::

tox

Metadata

Release files for storefact 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for storefact 0.11.0
File Size Uploaded Provenance Actions
storefact-0.11.0.tar.gz 16.7 kB Without provenance Details for storefact-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for storefact 0.11.0
File Interpreter ABI Platform Actions
storefact-0.11.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for storefact-0.11.0-py2.py3-none-any.whl

Total release size: 28.2 kB

Release files / storefact-0.11.0.tar.gz

Download URL storefact-0.11.0.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2140655072b30e5feb1e5a78e667c2c03c791812cc22aed771fbcc9d346bc828
BLAKE2b-256 checksum
How to use checksums
4fe600eb9398d02ea1d04cf9e4a17994563238d3a57365e65cdd9946f1b07cfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18

Release files / storefact-0.11.0-py2.py3-none-any.whl

Download URL storefact-0.11.0-py2.py3-none-any.whl
Size 11.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d110b9726a7e5b209a4a4d86ee3a025b9aff0550669a532fba089de55b8ed4a0
BLAKE2b-256 checksum
How to use checksums
34e86ca2b65f96b38d5249f9d5ca643bb66585a413f0b66f4f8797cdb3801f8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18

Security for storefact 0.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page