Skip to main content

Authanor

Athanor

A tool providing a a Pythonic interface to SQLAlchemy while enforcing authorization criteria for Flask.

SQLAlchemy provides a solid interface for managing database operations. However, this package is designed to enable the construction of handler objects that perform a series of consistent actions on many similar ORM entities. For example, I find that I frequently want to select all values (for specific columns) in a given table using an ORM or add an entry to the table based on a mapping. At the same time, I want to rigorously test my databases—but not pay the penalty for reconstructing the database for every test.

Authorizations & Database Handlers

The common operations are easy to do using SQLAlchemy, but rather than rolling new functions for each new query in every application, this tool provides a set of handlers that are designed to abstract away a bunch of the tedious details. Also, my experience is that enforcing authorization constraints when manipulating sophisticated table relationships can be tricky, and so this tool and its handlers provide an interface for managing those authorizations consistently.

It's possible I'm missing a key functionality of SQLAlchemy that enables this behavior elegantly, but I haven't found a satisfiably clean way to do it yet. Until I become so enlightened, this package creates an interface where each model may define the chain of joins required to establish whether it belongs to an authorized user, and then a handler to query the database and perform those joins for each query. This is designed to be extensible, since I often want this behavior available for the majority of ORM models in my application.

If you read this and think "This dude's dumb; why on Earth didn't he use this functionality baked into SQLAlchemy?" drop me a line because I'm interested to know what I'm missing.

Installation

The Authanor package is registered on the Python Package Index (PyPI) for easy installation. To install the package, simply run

$ pip install authanor

The package requires a recent version of Python (3.9+).

License

This project is licensed under the GNU General Public License, Version 3. It is fully open-source, and while you are more than welcome to fork, add, modify, etc. it is required that you keep any distributed changes and additions open-source.

Changes

Changes between versions are tracked in the changelog.

Release files for authanor 1.1.1

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

Source distribution (sdist)

Source distribution for authanor 1.1.1
File Size Uploaded
authanor-1.1.1.tar.gz 32.0 kB Details

Built distribution (wheel)

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

Total release size: 56.9 kB

Release files / authanor-1.1.1.tar.gz

Download URL authanor-1.1.1.tar.gz
Size 32.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1ac690b06ada60597152d9b10321ee43bd85baf21dc28697e297ac50f84b0300
BLAKE2b-256 checksum
How to use checksums
629eda57a0fa2148c88d827b218b74dfe9d108768295f55f4511ebc29a4596bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / authanor-1.1.1-py3-none-any.whl

Download URL authanor-1.1.1-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c837965e3274dede3f14acf1d636ee99dc92caaf935c11bbfb48c04c1a24e66b
BLAKE2b-256 checksum
How to use checksums
f215906fcc1508fd9cdb4bd5f74edc4b6ea121e4bc7bfab8147ed1d22cbda35d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

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