Skip to main content

Shared dossier

Project description

License: MIT PyPI package version

Cover

Pyrustic Shared

Data exchange and persistence

This project is part of the Pyrustic Open Ecosystem.

Installation . Latest . Modules

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 isn't intended to replace a proper relational database such as SQLite !

Example

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", "access_datetime": now, "photo": photo,
           "pi": 3.14, "books": ["Seul sur Mars", "The Fall"],
           "is_author": 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
profile_bis = dossier.get("my_profile")

# let's compare the two profile objects !
assert profile == profile_bis

API

Explore the source code.

Installation

Shared is cross platform. It is built on Ubuntu with Python 3.8 and should work on Python 3.5 or newer.

Create and activate a virtual environment

python -m venv venv
source venv/bin/activate

Install for the first time

pip install shared

Upgrade the package

pip install shared --upgrade --upgrade-strategy eager

Deactivate the virtual environment

deactivate

About the author

Hi, I'm Alex, a tech enthusiast ! Get in touch with me !




Back to top

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shared-0.0.30.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shared-0.0.30-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file shared-0.0.30.tar.gz.

File metadata

  • Download URL: shared-0.0.30.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.9.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.5.2

File hashes

Hashes for shared-0.0.30.tar.gz
Algorithm Hash digest
SHA256 35ea8ad5d4e9ad229af0db3f9db103bcc1768049a4fdc4338b627bc934d3d437
MD5 987a72bf0797665eb7e14a410bf10d3a
BLAKE2b-256 3b0e853a403b9e3200c73db7e6d2049092f2f8217fff413416ab21ee4c727f4d

See more details on using hashes here.

File details

Details for the file shared-0.0.30-py3-none-any.whl.

File metadata

  • Download URL: shared-0.0.30-py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.9.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.5.2

File hashes

Hashes for shared-0.0.30-py3-none-any.whl
Algorithm Hash digest
SHA256 3963b598b71045367c2e68fc404a4186f3089974ecfeb244fbcc7aa7ef8419c7
MD5 60586475abf88ea9a4128eb2f8f27a71
BLAKE2b-256 5bc3ac4e407c231c79d077c7e1dacbe650d01163e85d2cca1e41d1820b066ca0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page