Shared

raw JSON →
0.0.32 verified Fri May 01 auth: no python

A Python library for data exchange and persistence using human-readable files. It provides a simple interface to save and load Python objects as JSON or YAML files. Current version is 0.0.32 (pre-release), with infrequent releases.

pip install shared
error ModuleNotFoundError: No module named 'shared'
cause Library not installed or installed in a different environment.
fix
Run: pip install shared
error AttributeError: module 'shared' has no attribute 'Shared'
cause Wrong import path; some users try 'import shared' directly.
fix
Use: from shared import Shared
error yaml.YAMLError: could not determine a constructor for the tag 'tag:yaml.org,2002:...'
cause Trying to load a YAML file without PyYAML installed.
fix
Install PyYAML: pip install pyyaml
deprecated The library is in pre-release (0.0.x) and API may change significantly between versions. Pin your dependency to avoid breakage.
fix Pin version: shared==0.0.32
gotcha Shared silently overwrites existing files without warning. Ensure you have backups or use a different directory.
fix Check file existence manually before calling save() or use a unique filename.
gotcha Default serialization uses JSON. For YAML support, you must install PyYAML separately; otherwise, save will raise an error if the extension is .yaml.
fix Install PyYAML: pip install pyyaml, then use .yaml extension.

Basic usage: save and load Python dictionaries to/from human-readable files.

from shared import Shared

# Create a Shared instance with a file path
shared = Shared('config')
# Save a dictionary
shared.save({'key': 'value'})
# Load the data
data = shared.load()
print(data)