跳转到主要内容

使用Pythonic抽象与持久化键值存储进行交互。

项目描述

synced_collections - Pythonic abstractions over data collections

Affiliated with NumFOCUS GitHub Actions License Slack Twitter GitHub Stars

The signac 框架 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.

资源

快速入门

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'}

测试

You can test this package by executing

$ python -m pytest tests/

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面