Matter persistance library.
Project description
matter-persistence
Table of Contents
Installation
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.
DatabaseManager encapsulates a Sqlalchemy connection pool to a relational database (e.g. Postgresql), and exposes methods to obtain a Connection or a 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.
Contributing
for contributions, check the CONTRIBUTING.md file
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file matter_persistence-1.7.0-py3-none-any.whl
.
File metadata
- Download URL: matter_persistence-1.7.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d25656830fa66efb270662f89118b2361cbac3a118c664b54b823e619be7774 |
|
MD5 | 3cafabefdffc1bab18243114c642a8ac |
|
BLAKE2b-256 | 079b896f65bf3da4e36d68aa0604ea553a3f962ce18f1c7cd30696713ec12f88 |