Skip to main content

Feature collection storage for DossierStack

Project description

`` is a Python package that provides database storage for
feature collections in DossierStack. It is built on top of `kvlayer`, so
it supports many database backends like PostgreSQL, Accumulo and Redis.
`` also provides support for defining basic indexes.

### Installation

`` is on PyPI and can be installed with `pip`:

pip install

Currently, `` requires Python 2.7. It is not yet Python 3

### Documentation

API documentation with examples is available as part of the Dossier Stack

### Basic example

A full working example that uses local memory to store a feature collection:

from dossier.fc import FeatureCollection
from import Store
import kvlayer
import yakonfig

yaml = """
app_name: store
namespace: dossier
storage_type: local
with yakonfig.defaulted_config([kvlayer], yaml=yaml):
store = Store(kvlayer.client())

fc = FeatureCollection({u'NAME': {'Foo': 1, 'Bar': 2}})
store.put([('1', fc)])
print store.get('1')

### Example using indexes

Here is another example that demonstrates use of indexing to enable a
poor man's case insensitive search:

fc = dossier.fc.FeatureCollection()
fc[u'NAME'][u'foo'] += 1
fc[u'NAME'][u'bar'] = 42

kvl = kvlayer.client()
store =

# Index transforms must be defined on every instance of `Store`.
# (The index data is persisted; the transforms themselves are
# ephemeral.)
transform=lambda s: s.lower().encode('utf-8'))

store.put('{yourid}', fc) # `put` automatically updates indexes.
assert list(store.index_scan(u'name_casei', 'FoO'))[0] == '{yourid}'

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size (54.1 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size (23.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page