# matter-persistence
[![PyPI - Version](https://img.shields.io/pypi/v/matter-persistence.svg)](https://pypi.org/project/matter-persistence)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/matter-persistence.svg)](https://pypi.org/project/matter-persistence)
**Table of Contents**
- [Installation](#installation)
- [License](#license)
## Installation
```console
pip install matter-persistence
```
## Usage
**CacheManager** and **DatabaseManager** are the two central objects in matter_persistence.
**CacheManager** encapsulates a connection pool to Redis, and exposes methods to save, retrieve, and delete values from Redis.
*Check usage example for redis* **CacheManager** *in [examples/redis](./examples/redis.ipynb).*
**DatabaseManager** encapsulates a Sqlalchemy connection pool to a relational database (e.g. Postgresql),
and exposes methods to obtain
a [Connection](https://docs.sqlalchemy.org/en/20/core/connections.html#sqlalchemy.engine.Connection) or
a [Session](https://docs.sqlalchemy.org/en/20/orm/session_api.html#sqlalchemy.orm.Session).
Furthermore, there is a **CustomBase** in matter_persistence/sql/base.py, which is a convenient Base class for Sqlalchemy
ORM classes. It has an "id" primary key field, which is of type UUID, a "created", "updated" field that is inherited
from sqlalchemy_utils' Timestamp, and a "deleted" field, which is of type nullable timezone aware DateTime.
The **get** and **find** functions in matter_persistence/sql/utils.py
assume a deleted field!
*Check usage example for* **DatabaseManager** *and some of the utility functions in [examples/sql](./examples/sql.ipynb).*
## Contributing
for contributions, check the [CONTRIBUTING.md](CONTRIBUTING.md) file
Raw data
{
"_id": null,
"home_page": null,
"name": "matter-persistence",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "async, orm, pydantic, redis, sql",
"author": null,
"author_email": "R\u00f4mulo Jales <romulo@thisismatter.com>",
"download_url": null,
"platform": null,
"description": "# matter-persistence\n\n[![PyPI - Version](https://img.shields.io/pypi/v/matter-persistence.svg)](https://pypi.org/project/matter-persistence)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/matter-persistence.svg)](https://pypi.org/project/matter-persistence)\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [License](#license)\n\n## Installation\n\n```console\npip install matter-persistence\n```\n\n## Usage\n\n**CacheManager** and **DatabaseManager** are the two central objects in matter_persistence.\n\n**CacheManager** encapsulates a connection pool to Redis, and exposes methods to save, retrieve, and delete values from Redis.\n\n*Check usage example for redis* **CacheManager** *in [examples/redis](./examples/redis.ipynb).*\n\n**DatabaseManager** encapsulates a Sqlalchemy connection pool to a relational database (e.g. Postgresql),\nand exposes methods to obtain\na [Connection](https://docs.sqlalchemy.org/en/20/core/connections.html#sqlalchemy.engine.Connection) or\na [Session](https://docs.sqlalchemy.org/en/20/orm/session_api.html#sqlalchemy.orm.Session).\n\nFurthermore, there is a **CustomBase** in matter_persistence/sql/base.py, which is a convenient Base class for Sqlalchemy\nORM classes. It has an \"id\" primary key field, which is of type UUID, a \"created\", \"updated\" field that is inherited\nfrom sqlalchemy_utils' Timestamp, and a \"deleted\" field, which is of type nullable timezone aware DateTime.\n\nThe **get** and **find** functions in matter_persistence/sql/utils.py\nassume a deleted field!\n\n*Check usage example for* **DatabaseManager** *and some of the utility functions in [examples/sql](./examples/sql.ipynb).*\n\n## Contributing\n\nfor contributions, check the [CONTRIBUTING.md](CONTRIBUTING.md) file\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Matter persistance library.",
"version": "1.7.0",
"project_urls": {
"Documentation": "https://github.com/Matter-Tech/matter-persistence#readme",
"Issues": "https://github.com/Matter-Tech/matter-persistence/issues",
"Source": "https://github.com/Matter-Tech/matter-persistence"
},
"split_keywords": [
"async",
" orm",
" pydantic",
" redis",
" sql"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "079b896f65bf3da4e36d68aa0604ea553a3f962ce18f1c7cd30696713ec12f88",
"md5": "3cafabefdffc1bab18243114c642a8ac",
"sha256": "1d25656830fa66efb270662f89118b2361cbac3a118c664b54b823e619be7774"
},
"downloads": -1,
"filename": "matter_persistence-1.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3cafabefdffc1bab18243114c642a8ac",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 17468,
"upload_time": "2024-09-24T13:03:39",
"upload_time_iso_8601": "2024-09-24T13:03:39.828946Z",
"url": "https://files.pythonhosted.org/packages/07/9b/896f65bf3da4e36d68aa0604ea553a3f962ce18f1c7cd30696713ec12f88/matter_persistence-1.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-24 13:03:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Matter-Tech",
"github_project": "matter-persistence#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "matter-persistence"
}