🛡️ py_aide
Modern Python 3.11+ Framework: Flask/FastAPI Orchestration & Strict Runtime Enforcement
py_aide is a robust, developer-centric framework designed to bring safety, structure, and consistency to Python web applications. It provides a unique "Strict Runtime Enforcement" layer that ensures your code remains clean, documented, and type-safe at execution time.
🚀 Key Features
- Strict Runtime Enforcement: A powerful decorator that enforces type hints, docstrings, and calling conventions at runtime.
- Timezone-Aware Date Utilities: Generate dynamic, accurate timestamps across global regions using an IDE-friendly
TimezonesEnum with strict UTC defaults. - Unified Server Portal: Seamlessly orchestrate Flask and FastAPI applications with shared security gates.
- Circuit Breaker Resilience: Industrial-grade protection against cascading failures.
- Thread-Safe SQL: A thread-level multiton SQLite manager with automatic JSON serialization and a custom DSL.
- Modern Security: Argon2id password hashing with background rehashing and Fernet-based encryption.
- Enterprise HTTP Client: A standardized, "always resolve" HTTP client with built-in retries and interceptors.
📚 Documentation Roadmap
We recommend exploring the framework in this order:
⚙️ Core System
- Structural Enforcement: Learn about the
@enforce_requirementsdecorator and the validation engine. - Global Utilities: Discover helpers for dates, image processing, secure codes, and file system operations.
🌐 Server & API
- Service Portals: Documentation for Flask/FastAPI orchestration, security gates, and WebSockets.
- HTTP Client & Response: Master the "Always Resolve" strategy and the unified
Responseprotocol.
🧵 Persistence & Concurrency
- Database Orchestration: Deep dive into thread-safe SQLite and the powerful JSON DSL.
- Hybrid Cache: Lightning-fast memory access with non-blocking disk persistence.
- Threading & Buffers: Learn how to use persistent queues and non-blocking write buffers.
- Resilience & Circuits: Protecting your services with the Circuit Breaker pattern.
🔐 Security
- Security & Identity: Hashing, Token management, and Encryption standards.
⚙️ Core Philosophy: Strict Enforcement
At the heart of py_aide is the @enforce_requirements decorator. It prevents "sloppy" code by failing early (at boot-time or runtime) if your contracts are violated.
from py_aide.enforcer import enforce_requirements
from py_aide.customTypes import Options
@enforce_requirements
def create_user(*, name: str, role: Options[str, ["admin", "user"]]) -> dict:
"""Creates a new user record with runtime type and choice validation."""
return {"name": name, "role": role}
🌍 Global Timezone Utilities
py_aide prevents timezone-related bugs by defaulting to UTC while providing a robust, auto-completable Enum for localized timestamps.
from py_aide.dates import DateUtils, Timezones
# Generates a standard UTC timestamp by default
utc_time = DateUtils.current_timestamp()
# Generates localized East Africa Time safely without string typos
eat_time = DateUtils.current_timestamp(timezone=Timezones.EAT)
# Shift dates natively in specific timezones
tomorrow_tokyo = DateUtils.tomorrow(timezone=Timezones.JST)
📦 Installation
# Core only (Encryption, Tokens, Threading, Base Requests)
pip install py_aide
# With Flask Portal & WebSockets
pip install "py_aide[flask]"
# With FastAPI Portal & Uvicorn
pip install "py_aide[fastapi]"
# With Database/Cache drivers
pip install "py_aide[postgres,redis,sqlite]"
# Install everything
pip install "py_aide[all]"
Note:
py_aiderequires Python 3.11+ and is currently optimized for Linux environments.
📄 License
This project is licensed under the MIT License.
👥 Authors
- Kakuru Douglas - vicaniddouglas@gmail.com
Release files for py-aide 0.60.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py_aide-0.60.1.tar.gz | 259.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_aide-0.60.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 507.6 kB
Release files / py_aide-0.60.1.tar.gz
| Download URL | py_aide-0.60.1.tar.gz |
|---|---|
| Size | 259.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c3b8648884006e6adc778405e879f0c17e55f5370cac3c13819bc9ad7944d44
|
|
BLAKE2b-256 checksum How to use checksums |
a12f39fd35d5cd7e8d6e84e861d7245797a32c2e516018d12c8328a7437e4a1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / py_aide-0.60.1-py3-none-any.whl
| Download URL | py_aide-0.60.1-py3-none-any.whl |
|---|---|
| Size | 248.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
372ed614f0e5688fcccdce0f8d68647ef7cb935300ac3ea5232dac81191c5911
|
|
BLAKE2b-256 checksum How to use checksums |
ac765df1504095132deb06a139482fbd92374dd73f713ac4cee2b75420ad2d7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|