shared


Nameshared JSON
Version 0.0.30 PyPI version JSON
download
home_pagehttps://github.com/pyrustic/shared
SummaryShared dossier
upload_time2024-03-13 22:58:27
maintainerPyrustic Evangelist
docs_urlNone
authorPyrustic Evangelist
requires_python>=3.5
licenseMIT
keywords library json sql sqlite data shared binary database triptych configuration collections persistence pyrustic lightweight
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI package version](https://img.shields.io/pypi/v/shared)](https://pypi.org/project/shared)

<!-- Cover -->
<div align="center">
    <img src="https://raw.githubusercontent.com/pyrustic/misc/master/assets/shared/cover.png" alt="Cover" width="630">
    <p align="center">
    <i> </i>
    </p>
</div>



# Pyrustic Shared
**Data exchange and persistence**

This project is part of the [Pyrustic Open Ecosystem](https://pyrustic.github.io).
> [Installation](#installation) . [Latest](https://github.com/pyrustic/shared/tags) . [Modules](https://github.com/pyrustic/shared/tree/master/docs/modules#readme)

## Table of contents
- [Overview](#overview) 
- [Example](#example) 
- [API](#api)
- [Installation](#installation) 

# 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](https://github.com/pyrustic/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
```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", "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](https://ubuntu.com/download/desktop) with [Python 3.8](https://www.python.org/downloads/) 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
Hi, I'm Alex, a tech enthusiast ! Get in touch with [me](https://pyrustic.github.io/#contact) ! 

<br>
<br>
<br>

[Back to top](#readme)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pyrustic/shared",
    "name": "shared",
    "maintainer": "Pyrustic Evangelist",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "rusticalex@yahoo.com",
    "keywords": "library,json,sql,sqlite,data,shared,binary,database,triptych,configuration,collections,persistence,pyrustic,lightweight",
    "author": "Pyrustic Evangelist",
    "author_email": "rusticalex@yahoo.com",
    "download_url": "https://files.pythonhosted.org/packages/3b/0e/853a403b9e3200c73db7e6d2049092f2f8217fff413416ab21ee4c727f4d/shared-0.0.30.tar.gz",
    "platform": null,
    "description": "\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PyPI package version](https://img.shields.io/pypi/v/shared)](https://pypi.org/project/shared)\n\n<!-- Cover -->\n<div align=\"center\">\n    <img src=\"https://raw.githubusercontent.com/pyrustic/misc/master/assets/shared/cover.png\" alt=\"Cover\" width=\"630\">\n    <p align=\"center\">\n    <i> </i>\n    </p>\n</div>\n\n\n\n# Pyrustic Shared\n**Data exchange and persistence**\n\nThis project is part of the [Pyrustic Open Ecosystem](https://pyrustic.github.io).\n> [Installation](#installation) . [Latest](https://github.com/pyrustic/shared/tags) . [Modules](https://github.com/pyrustic/shared/tree/master/docs/modules#readme)\n\n## Table of contents\n- [Overview](#overview) \n- [Example](#example) \n- [API](#api)\n- [Installation](#installation) \n\n# Overview\n**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.\n\nUnder the hood, Shared uses [Paradict](https://github.com/pyrustic/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).\n\n> **Note:** This library isn't intended to replace a proper relational database such as SQLite !\n\n# Example\n```python\nfrom shared import Dossier, HOME\nfrom datetime import datetime\nfrom pathlib import Path\n\n# load a picture\nwith open(\"/home/alex/image.png\", \"rb\") as file:\n    photo = file.read()\n\n# create a user profile dictionary embedding the picture\nnow = datetime.now()\nprofile = {\"name\": \"alex\", \"access_datetime\": now, \"photo\": photo,\n           \"pi\": 3.14, \"books\": [\"Seul sur Mars\", \"The Fall\"],\n           \"is_author\": True, \"fingerprint\": None}\n\n# create a dossier (or access an existing one)\npath = Path(HOME, \"my_dossier\")\ndossier = Dossier(path)\n\n# save profile dictionary in the dossier\ndossier.set(\"my_profile\", profile)\n\n# retrieve profile dictionary\nprofile_bis = dossier.get(\"my_profile\")\n\n# let's compare the two profile objects !\nassert profile == profile_bis\n```\n\n# API\nExplore the source code.\n\n\n# Installation\n**Shared** is **cross platform**. It is built on [Ubuntu](https://ubuntu.com/download/desktop) with [Python 3.8](https://www.python.org/downloads/) and should work on **Python 3.5** or **newer**.\n\n\n## Create and activate a virtual environment\n```bash\npython -m venv venv\nsource venv/bin/activate\n```\n\n## Install for the first time\n\n```bash\npip install shared\n```\n\n## Upgrade the package\n```bash\npip install shared --upgrade --upgrade-strategy eager\n```\n\n## Deactivate the virtual environment\n```bash\ndeactivate\n```\n\n# About the author\nHi, I'm Alex, a tech enthusiast ! Get in touch with [me](https://pyrustic.github.io/#contact) ! \n\n<br>\n<br>\n<br>\n\n[Back to top](#readme)\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Shared dossier",
    "version": "0.0.30",
    "project_urls": {
        "Homepage": "https://github.com/pyrustic/shared"
    },
    "split_keywords": [
        "library",
        "json",
        "sql",
        "sqlite",
        "data",
        "shared",
        "binary",
        "database",
        "triptych",
        "configuration",
        "collections",
        "persistence",
        "pyrustic",
        "lightweight"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5bc3ac4e407c231c79d077c7e1dacbe650d01163e85d2cca1e41d1820b066ca0",
                "md5": "60586475abf88ea9a4128eb2f8f27a71",
                "sha256": "3963b598b71045367c2e68fc404a4186f3089974ecfeb244fbcc7aa7ef8419c7"
            },
            "downloads": -1,
            "filename": "shared-0.0.30-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "60586475abf88ea9a4128eb2f8f27a71",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 27459,
            "upload_time": "2024-03-13T22:58:24",
            "upload_time_iso_8601": "2024-03-13T22:58:24.447733Z",
            "url": "https://files.pythonhosted.org/packages/5b/c3/ac4e407c231c79d077c7e1dacbe650d01163e85d2cca1e41d1820b066ca0/shared-0.0.30-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3b0e853a403b9e3200c73db7e6d2049092f2f8217fff413416ab21ee4c727f4d",
                "md5": "987a72bf0797665eb7e14a410bf10d3a",
                "sha256": "35ea8ad5d4e9ad229af0db3f9db103bcc1768049a4fdc4338b627bc934d3d437"
            },
            "downloads": -1,
            "filename": "shared-0.0.30.tar.gz",
            "has_sig": false,
            "md5_digest": "987a72bf0797665eb7e14a410bf10d3a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 8669,
            "upload_time": "2024-03-13T22:58:27",
            "upload_time_iso_8601": "2024-03-13T22:58:27.198086Z",
            "url": "https://files.pythonhosted.org/packages/3b/0e/853a403b9e3200c73db7e6d2049092f2f8217fff413416ab21ee4c727f4d/shared-0.0.30.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-13 22:58:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pyrustic",
    "github_project": "shared",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "shared"
}
        
Elapsed time: 0.20287s