Skip to main content

A better persistence layer for python

Project description

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

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

persisty-0.0.17.tar.gz (65.7 kB view details)

Uploaded Source

Built Distribution

persisty-0.0.17-py3-none-any.whl (111.1 kB view details)

Uploaded Python 3

File details

Details for the file persisty-0.0.17.tar.gz.

File metadata

  • Download URL: persisty-0.0.17.tar.gz
  • Upload date:
  • Size: 65.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for persisty-0.0.17.tar.gz
Algorithm Hash digest
SHA256 b8cd33352467bedad284dbacbc1d28a818382cb3f2c53ec3b69f7eac18fbe410
MD5 c0961b026c4ad8e00cd1dc84ff155c09
BLAKE2b-256 940deca204e46f2df1e1d5ea8e59055d167522d5a64c771bc90f621032475e27

See more details on using hashes here.

File details

Details for the file persisty-0.0.17-py3-none-any.whl.

File metadata

  • Download URL: persisty-0.0.17-py3-none-any.whl
  • Upload date:
  • Size: 111.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for persisty-0.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 d7ed469846a10757ff5e87127bd22f98a2886cff111e092707f2bfe2fd266931
MD5 13c5a496faaccc0c62de3e81ac2dfc15
BLAKE2b-256 03d6ee274cee8b3462827dc10319d24472699d1e4e2ff6f60ede2b25fc7b78a9

See more details on using hashes here.

Supported by

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