Skip to main content

Modern Python 3.11+ Framework: Flask/FastAPI orchestration, and strict runtime enforcement.

Project description

🛡️ 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 Timezones Enum 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_requirements decorator 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 Response protocol.

🧵 Persistence & Concurrency

🔐 Security


⚙️ 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_aide requires Python 3.11+ and is currently optimized for Linux environments.


📄 License

This project is licensed under the MIT License.

👥 Authors

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_aide-0.47.0.tar.gz (254.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_aide-0.47.0-py3-none-any.whl (245.4 kB view details)

Uploaded Python 3

File details

Details for the file py_aide-0.47.0.tar.gz.

File metadata

  • Download URL: py_aide-0.47.0.tar.gz
  • Upload date:
  • Size: 254.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for py_aide-0.47.0.tar.gz
Algorithm Hash digest
SHA256 30303f62a91dfe18866e7c9603a1d8aa008da0415e840e91ace6736f5a54c989
MD5 be4195058042a0e2b94d132f82919c24
BLAKE2b-256 aa0b11df05f1ab4af78693a5669ad8cb0641089a9f7143fbbff18aa5bd05605e

See more details on using hashes here.

File details

Details for the file py_aide-0.47.0-py3-none-any.whl.

File metadata

  • Download URL: py_aide-0.47.0-py3-none-any.whl
  • Upload date:
  • Size: 245.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for py_aide-0.47.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b87d4dde5d4c62e5cf3b2f64a3776d7ac626c5c77a35095606a437d3dafdc082
MD5 daae52c926aa726645deca434fc22c9f
BLAKE2b-256 571599873868123b9b1d6f86e87a2c7e2447f1bc96fcb7a6e0bb1f75419c791d

See more details on using hashes here.

Supported by

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