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
File details
Details for the file synced_collections-1.0.0.tar.gz
.
File metadata
- Download URL: synced_collections-1.0.0.tar.gz
- Upload date:
- Size: 48.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5c72df4074ce95625f155d8bc1ac608ba4d9fbb0fffde4da3c0e3a88a1e30bd |
|
MD5 | 7e28741a93f7075c594cf4e86537fdb9 |
|
BLAKE2b-256 | 06f8dd1fcc92dfeed903be2e2e1d78c5c25e7d32afc73bd43da44fb75d547771 |
Provenance
File details
Details for the file synced_collections-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: synced_collections-1.0.0-py3-none-any.whl
- Upload date:
- Size: 57.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b0781bb887f8a0dc113bc07f7df545351e4e8d81a4808503a82952430c48392 |
|
MD5 | 1b6a55f4ee15c07d088650399a549901 |
|
BLAKE2b-256 | 4a62d47b056adb89c2e826f35d7d1ef16231bc3ce1d935c217725c38bd28a6b3 |