Interact with persistent key-value stores using Pythonic abstractions.
Project description
synced_collections - Pythonic abstractions over data collections
The signac framework helps users manage and scale file-based workflows, facilitating data reuse, sharing, and reproducibility.
The synced_collections package provides Pythonic abstractions over various underlying data stores, presenting APIs that behave like standard built-in Python collections like dicts.
synced_collections form the backbone of signac's data and metadata storage, but may be used just as easily outside of signac.
For instance, users wishing to access a JSON file on disk like a dictionary and automatically persist all changes could use the synced_collections.JSONDict
.
Resources
- Slack Chat Support: Get help and ask questions on the signac Slack workspace.
- signac website: Framework overview and news.
Quickstart
This short example demonstrates what you can do with synced_collections
.
>>> from synced_collections.backends.collection_json import JSONDict
>>> d = JSONDict("data.json")
>>> d["size"] = 10
>>> d["color"] = "blue"
>>> import json
>>> with open("data.json") as f:
... print(json.load(f))
...
{'size': 10, 'color': 'blue'}
Testing
You can test this package by executing:
$ python -m pytest tests/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for synced_collections-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b0781bb887f8a0dc113bc07f7df545351e4e8d81a4808503a82952430c48392 |
|
MD5 | 1b6a55f4ee15c07d088650399a549901 |
|
BLAKE2b-256 | 4a62d47b056adb89c2e826f35d7d1ef16231bc3ce1d935c217725c38bd28a6b3 |