dol¶
Core tools to build simple interfaces to complex data sources and bend the interface to your will (and need).
dol wraps any storage backend (files, S3, databases, dicts) behind a dict-like
interface, and transforms that interface with composable layers. Start with
wrap_kvs (key/value transforms), the file stores (Files, TextFiles,
JsonFiles, PickleFiles), the ready-made codecs (ValueCodecs, KeyCodecs),
filt_iter (key filtering) and cache_this (caching).
>>> from dol import wrap_kvs
>>> import json
>>> s = wrap_kvs({}, obj_of_data=json.loads, data_of_obj=json.dumps)
>>> s['a'] = {'x': 1}
>>> s['a'], s.store
({'x': 1}, {'a': '{"x": 1}'})
Functions
|
Get the first item of an iterable, or a list of the first n items |
|
Get the first item of a kv store, or a list of the first n items |
Modules
|
Makes a new class with append (and consequential extend) methods |
Base classes for making stores. |
|
Tools to add caching layers to stores and methods. |
|
Content references and content-addressed storage — the flat "blob" layer. |
|
Layers introspection: walk the layers of a wrapped store and trace a key through them. |
|
Error objects and utils. |
|
Stores whose keys are given explicitly, with values fetched lazily from a source. |
|
File system access: dict-like stores over folders and files. |
|
Tools to make Key-Value Codecs (encoder-decoder pairs) from standard library tools. |
|
Functions to read from and write to misc sources, choosing the codec from the key. |
|
Mixins that add or restrict store behaviours. |
|
This module is about generating, validating, and operating on (parametrized) fields (i.e. strings, e.g. paths). |
|
Module for path (and path-like) object manipulation |
|
Recipes using dol |
|
Signature calculus: Tools to make it easier to work with function's signatures. |
|
Key-value views of disparate sources. |
|
Various tools to add functionality to stores. |
|
Tools to wrap stores with key/value transforms, filters, caches and other layers. |
|
Cross-platform file trash/recycle bin functionality for dol. |
|
General util objects: function composition, grouping, partial classes, file helpers. |
|
Data object layers and other utils to work with zip files. |