shared
Data exchange and persistence based on human-readable files
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.6%) to scientific vocabulary
Keywords
Repository
Data exchange and persistence based on human-readable files
Basic Info
Statistics
- Stars: 22
- Watchers: 3
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
⚠️⚠️
Shared is an experimental data exchange and persistence solution based on human-readable files. It serves as a playground to test new ideas and then create stable derivative projects. I recently built a multi-model embedded database for persisting arbitrary-sized data. The project is called Jinbase and I strongly encourage you to give it a try.
⚠️⚠️
Pyrustic Shared
Data exchange and persistence based on human-readable files
Table of contents
Overview
Shared is a Python package created to be the programmer's companion when it comes to storing unstructured application data, managing configuration files, caching data, and exchanging data with other programs.
Under the hood, Shared uses Paradict to encode a dictionary populated with strings, scalars (integer, float, decimal float, complex, booleans), date and time, null value, binary data and nested collections (list, set, and dictionary).
Note: This library does not implement any synchronization mechanisms to prevent simultaneous access to a file, which could lead to data corruption. For a safe, more robust and rich persistence solution, please consider Jinbase.
Example
```python from shared import Dossier, HOME from datetime import datetime from pathlib import Path
load a picture
with open("/home/alex/image.png", "rb") as file: photo = file.read()
create a user profile dictionary embedding the picture
now = datetime.now() profile = {"name": "alex", "accessdatetime": now, "photo": photo, "pi": 3.14, "books": ["Seul sur Mars", "The Fall"], "isauthor": True, "fingerprint": None}
create a dossier (or access an existing one)
path = Path(HOME, "my_dossier") dossier = Dossier(path)
save profile dictionary in the dossier
dossier.set("my_profile", profile)
retrieve profile dictionary
profilebis = dossier.get("myprofile")
let's compare the two profile objects !
assert profile == profile_bis # True ;) ```
Related projects
- Jinbase: Multi-model transactional embedded database
- LiteDBC: Lite database connector
- KvF: The key-value file format with sections
- Paradict: Streamable multi-format serialization with schema
- Asyncpal: Preemptive concurrency and parallelism for sporadic workloads
Testing and contributing
Feel free to open an issue to report a bug, suggest some changes, show some useful code snippets, or discuss anything related to this project. You can also directly email me.
Setup your development environment
Following are instructions to setup your development environment
```bash
create and activate a virtual environment
python -m venv venv source venv/bin/activate
clone the project then change into its directory
git clone https://github.com/pyrustic/shared.git cd shared
install the package locally (editable mode)
pip install -e .
run tests
python -m tests
deactivate the virtual environment
deactivate ```
Installation
Shared is cross-platform. It is built on Ubuntu and should work on Python 3.5 or newer.
Create and activate a virtual environment
bash
python -m venv venv
source venv/bin/activate
Install for the first time
bash
pip install shared
Upgrade the package
bash
pip install shared --upgrade --upgrade-strategy eager
Deactivate the virtual environment
bash
deactivate
About the author
Hello world, I'm Alex (😎️), a tech enthusiast and the architect of Pyrustic ! Feel free to get in touch with me !
Owner
- Login: pyrustic
- Kind: user
- Location: Milky Way
- Company: The Pyrustic Megacorp.
- Website: https://pyrustic.github.io
- Repositories: 39
- Profile: https://github.com/pyrustic
Collection of lightweight Python projects that share the same policy
GitHub Events
Total
- Watch event: 1
- Push event: 5
Last Year
- Watch event: 1
- Push event: 5
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Pyrustic Evangelist | p****c@p****m | 57 |
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 11,888 last-month
- Total docker downloads: 1,686
-
Total dependent packages: 14
(may contain duplicates) -
Total dependent repositories: 41
(may contain duplicates) - Total versions: 38
- Total maintainers: 1
pypi.org: shared
Data exchange and persistence based on human-readable files
- Homepage: https://github.com/pyrustic/shared
- Documentation: https://shared.readthedocs.io/
- License: MIT
-
Latest release: 0.0.32
published about 1 year ago
Rankings
Maintainers (1)
conda-forge.org: shared
- Homepage: https://github.com/pyrustic/shared
- License: MIT
-
Latest release: 0.0.24
published over 3 years ago