shared

Data exchange and persistence based on human-readable files

https://github.com/pyrustic/shared

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

collections configuration experimental file persistence pyrustic python shared
Last synced: 6 months ago · JSON representation

Repository

Data exchange and persistence based on human-readable files

Basic Info
  • Host: GitHub
  • Owner: pyrustic
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 144 KB
Statistics
  • Stars: 22
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
collections configuration experimental file persistence pyrustic python shared
Created almost 5 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

License: MIT PyPI package version

⚠️⚠️

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.

⚠️⚠️

Cover

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 ```

Back to top

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

Back to top

About the author

Hello world, I'm Alex (😎️), a tech enthusiast and the architect of Pyrustic ! Feel free to get in touch with me !




Back to top

Owner

  • Login: pyrustic
  • Kind: user
  • Location: Milky Way
  • Company: The Pyrustic Megacorp.

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

All Time
  • Total Commits: 57
  • Total Committers: 1
  • Avg Commits per committer: 57.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 10
  • Committers: 1
  • Avg Commits per committer: 10.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email 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

  • Versions: 32
  • Dependent Packages: 12
  • Dependent Repositories: 41
  • Downloads: 11,888 Last month
  • Docker Downloads: 1,686
Rankings
Dependent packages count: 0.8%
Dependent repos count: 2.3%
Docker downloads count: 2.3%
Downloads: 3.5%
Average: 8.6%
Stargazers count: 12.9%
Forks count: 29.8%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: shared
  • Versions: 6
  • Dependent Packages: 2
  • Dependent Repositories: 0
Rankings
Dependent packages count: 19.5%
Dependent repos count: 34.0%
Average: 40.4%
Stargazers count: 46.8%
Forks count: 61.1%
Last synced: 6 months ago

Dependencies

pyproject.toml pypi
setup.py pypi