🛡️ 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
Metadata
Release files for py-aide 0.66.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py_aide-0.66.0.tar.gz | 305.9 kB | Without provenance | Details for py_aide-0.66.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py_aide-0.66.0-py3-none-any.whl | Python 3 | none | any | Details for py_aide-0.66.0-py3-none-any.whl |
Total release size: 577.0 kB
Release files / py_aide-0.66.0.tar.gz
| Download URL | py_aide-0.66.0.tar.gz |
|---|---|
| Size | 305.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cbce4898eea00d339963ccbeabb248a8c871d75a54dc73117922e9f66fe1038f
|
|
BLAKE2b-256 checksum How to use checksums |
d2f77300c8a521897a2bbcc4e644232101b3b8ac4359a72688541d94bdf8dcd0
|
| 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.66.0-py3-none-any.whl
| Download URL | py_aide-0.66.0-py3-none-any.whl |
|---|---|
| Size | 271.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6278a85535e3b654a1fbcbbeb4c2c2a16388943720416d46174c6ee7d58ed29d
|
|
BLAKE2b-256 checksum How to use checksums |
1cbe646907fab082382bd22a129a8d3f665d45f9d4753b7a6f1fbfdc058029a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for py-aide 0.66.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.