Skip to main content

Persisty - a better persistence Layer for Python

The objective of this project is to provide a resource oriented approach accommodating both security and caching rich enough to handle most use cases while still being independant of the underlying persistence mechanism.

Using Servey to provide access via REST and GraphQL in either a hosted environment or AWS lambda environemnt, the project includes out of the box support for both SQL (via SQLAlchemy) and Dynamodb.

Concepts

Stored Items

Stored items are marked by the stored decorator. This decorator is similar to dataclass, and allows specifying attributes, keys, schemas, and indexes.

Stores

A Store provides a unified interface for interacting with stored items. StoreMeta contains info on what exactly a store supports

Standard Actions are:

  • create an item
  • read and item given its key
  • update an item
  • delete and item given its key
  • search for items given filter and sort criteria
  • count items given filter criteria
  • read_batch read a batch of items given a list of keys
  • edit_batch execute a batch of edits (create, update, delete operations)

Keys

Each item within a store has a string key, derived from the item. (Possibly based on one or more of it's attributes) A KeyConfig controls this process

Attributes

Stored items have Attributes associated with them, similar to columns in a relational database. Attributes can have generators associated with them.

SearchFilters

Search operations can have SearchFilters These can be natively supported (Converted to SQL or dynamodb query / scan criteria) or run locally in python.

Auto User Interfaces

Since this is built on top of OpenAPI, user interface options supplied by Ewey

Examples

The messenger Example App demonstrates a step by step build of an application with security and business logic.

Future Ideas

  • REDIS Storage

  • Elastic Search Storage

  • Remote HTTP Storage

  • A user app with support for OIDC, SAML and SCIM

  • A Rate Limiting app / Rate Limit Access Control

  • An Event Bridge Project (Backed by AWS Event bridge in AWS, or celery in other environments)

  • A Distributed Lock

  • An explicit custom index (Spatial RTree)

  • A Z order index

Installing local development dependencies

python setup.py install easy_install "persisty[all]"

Release Procedure

status

The typical process here is:

  • Create a PR with changes. Merge these to main (The Quality workflows make sure that your PR meets the styling, linting, and code coverage standards).
  • New releases created in github are automatically uploaded to pypi

Metadata

Release files for persisty 0.0.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for persisty 0.0.17
File Size Uploaded
persisty-0.0.17.tar.gz 65.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for persisty 0.0.17
File Interpreter ABI Platform
persisty-0.0.17-py3-none-any.whl Python 3 none any Details

Total release size: 176.7 kB

Release files / persisty-0.0.17.tar.gz

Download URL persisty-0.0.17.tar.gz
Size 65.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b8cd33352467bedad284dbacbc1d28a818382cb3f2c53ec3b69f7eac18fbe410
BLAKE2b-256 checksum
How to use checksums
940deca204e46f2df1e1d5ea8e59055d167522d5a64c771bc90f621032475e27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / persisty-0.0.17-py3-none-any.whl

Download URL persisty-0.0.17-py3-none-any.whl
Size 111.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7ed469846a10757ff5e87127bd22f98a2886cff111e092707f2bfe2fd266931
BLAKE2b-256 checksum
How to use checksums
03d6ee274cee8b3462827dc10319d24472699d1e4e2ff6f60ede2b25fc7b78a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.0.17 This release

2 release files

0.0.15

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page