Skip to main content

🐍 TaipanStack

CI

The Modern Python Foundation

Launch secure, high-performance Python applications in seconds.

Python Coverage Code Style Type Checked License Security

SBOM SLSA

PyPI


Features • Quick Start • Architecture • DevSecOps • API • Contributing


✨ Why TaipanStack?

"Write less, build better."

TaipanStack is a battle-tested foundation for production-grade Python projects that combines security, performance, and developer experience into a single, cohesive toolkit.

✨ What's New in v0.7.0

  • Automated CI/CD Delivery Pipeline: Unified workflow publishing Python packages to PyPI with Sigstore Cosign signing and Docker images to GitHub Container Registry (GHCR).
  • Automated Versioning (.10 Rollover): Continuous release bumping enforcing .10 rollover (x.y.10 -> x.(y+1).0).
  • Categorized GitHub Releases: Automated release notes categorized into features, fixes, changes, and removals.

🛡️ Security First

  • Path traversal protection
  • Command injection guards
  • Input sanitizers & validators
  • Secret detection integration
  • SBOM + SLSA supply-chain attestation

⚡ High Performance

  • uvloop async event loop
  • orjson fast JSON serialization
  • Pydantic v2 validation

🎯 Rust-Style Error Handling

  • Ok/Err Result types
  • Explicit error propagation
  • Pattern matching support
  • No silent failures

🔧 Developer Experience

  • Pre-configured quality tools
  • 100% code coverage (comprehensive test suite)
  • Architecture enforcement
  • Hardened Docker template

🚀 Quick Start

Prerequisites

  • Python 3.11+ (supports 3.11, 3.12, 3.13, 3.14, 3.15)
  • Poetry (install guide)

Installation

From PyPI

pip install taipanstack

From Source

# Clone the repository
git clone https://github.com/gabrielima7/TaipanStack.git
cd TaipanStack

# Install dependencies
poetry install --with dev

# Run quality checks
make all

Verify Installation

# Run tests with 100% coverage (comprehensive test suite)
make test

# Check architecture contracts
make lint-imports

# Run security scans
make security

# Run property-based fuzzing
make property-test

📐 Architecture

TaipanStack follows a clean, layered architecture with strict dependency rules enforced by Import Linter.

                    ┌────────────────────────────────────────────────────────┐
                    │                      Application                       │
                    │                   (src/app/main.py)                    │
                    └───────────────────────────┬────────────────────────────┘
                                                │
          ┌───────────────┬─────────────────────┼───────────────┬──────────────┐
          ▼               ▼                     ▼               ▼              ▼
┌─────────────────┐┌──────────────┐     ┌──────────────┐┌──────────────┐┌──────────────┐
│    Security     ││   Config     │     │   Bridges    ││  Resilience  ││    Utils     │
│ guards, saniti- ││ models, gens │     │  http, db    ││ retry, break ││ logging, fs  │
│ zers, validators││              │     │              ││ watchdogs    ││ context      │
└────────┬────────┘└──────┬───────┘     └───────┬──────┘└───────┬──────┘└──────┬───────┘
         │                │                     │               │              │
         └────────────────┴─────────────────────┼───────────────┴──────────────┘
                                                ▼
                               ┌────────────────────────────────┐
                               │              Core              │
                               │  Result types, optimizations   │
                               └────────────────────────────────┘

Project Structure

TaipanStack/
├── src/
│   ├── app/              # Application entry point
│   └── taipanstack/
│       ├── bridges/      # 🌉 External communication integrations (http, db, web)
│       ├── config/       # ⚙️ Configuration models & generators
│       ├── core/         # 🎯 Result types, functional patterns
│       ├── resilience/   # 🌊 Reliability patterns (circuit breakers, retries, watchdogs)
│       ├── security/     # 🛡️ Guards, sanitizers, validators
│       └── utils/        # 🔧 Cross-cutting utilities (logging, cache, filesystem)
├── tests/                # ✅ comprehensive test suite, 100% coverage
├── .semgrep/             # 🔍 Custom SAST rules
├── .github/              # 🔄 CI/CD + SBOM/SLSA workflows
├── Dockerfile            # 🐳 Hardened multi-stage container
└── pyproject.toml        # 📋 Modern dependency management

Migration Notice

The taipanstack.utils resilience modules (circuit_breaker, retry, resilience) are deprecated backward-compatibility shims. New code should import resilience modules directly from taipanstack.resilience.


🔐 DevSecOps

TaipanStack integrates security and quality at every level:

Category Tools Purpose
SAST Bandit, Semgrep + custom rules Static Application Security Testing
SCA pip-audit Dependency vulnerability scanning
SBOM Syft (CycloneDX) Software Bill of Materials
SLSA Cosign (Sigstore) Artifact signing & attestation
Types Mypy (strict) Compile-time type checking
Lint Ruff Lightning-fast linting & formatting
Arch Import Linter Dependency rule enforcement
Test Pytest, Hypothesis, mutmut Property-based & mutation testing
Containers Docker (Alpine, rootless) Hardened-by-default images

CI Pipeline

# Runs on every push/PR
✓ Test Matrix     → Python 3.11-3.15 × (Ubuntu, macOS, Windows)
✓ Linux Distros   → Ubuntu, Debian, Fedora, openSUSE, Arch, Alpine
✓ Code Quality    → Ruff check & format
✓ Type Check      → Mypy strict mode
✓ Security        → Bandit + Semgrep (custom rules)
✓ Architecture    → Import Linter contracts
✓ Benchmarks      → Performance regression (>5% = fail)
✓ SBOM + SLSA     → Supply-chain attestation on release

⚙️ Environment Variables

TaipanStack supports the following environment variables for configuration:

  • STACK_ENABLE_EXPERIMENTAL: Set to 1, true, yes, or on to enable experimental features such as the JIT compiler and free-threading optimizations.
  • STACK_OPTIMIZATION_LEVEL: Set the optimization level (default 1). Use 0 for none, 1 for safe, and 2 for aggressive optimizations (requires experimental features).

📚 API Highlights

Result Types (Rust-Style Error Handling)

from taipanstack.core.result import Result, Ok, Err, safe

@safe
def divide(a: int, b: int) -> float:
    return a / b

# Explicit error handling with pattern matching
match divide(10, 0):
    case Ok(value):
        print(f"Result: {value}")
    case Err(error):
        print(f"Error: {error}")

Security Guards

from taipanstack.security.guards import (
    guard_command_injection,
    guard_env_variable,
    guard_path_traversal,
)

# Prevent path traversal attacks
safe_path = guard_path_traversal(user_input, base_dir="/app/data")

# Prevent command injection
safe_cmd = guard_command_injection(
    ["git", "clone", repo_url],
    allowed_commands=["git"]
)

# Safely access environment variables with bounds checking
safe_key = guard_env_variable(
    "API_KEY",
    allowed_names=["API_KEY", "DEBUG"],
    denied_names=["AWS_SECRET_ACCESS_KEY"]
)

Rate Limiting

from taipanstack.utils.rate_limit import rate_limit
from taipanstack.core.result import Result, Ok, Err

@rate_limit(max_calls=5, time_window=10.0)
def fetch_data() -> str:
    return "data"

# Returns an Ok('data') or Err(RateLimitError('Rate limit exceeded'))
match fetch_data():
    case Ok(value):
        print(f"Data: {value}")
    case Err(error):
        print(f"Rate limited: {error}")

Retry with Exponential Backoff

from taipanstack.resilience.retry import retry

@retry(max_attempts=3, on=(ConnectionError, TimeoutError))
async def fetch_data(url: str) -> dict:
    return await http_client.get(url)

Circuit Breaker

from taipanstack.resilience.circuit_breaker import circuit_breaker

@circuit_breaker(failure_threshold=5, timeout=30)
def call_external_service() -> Response:
    return service.call()

🔗 Combining Result + Circuit Breaker

from taipanstack.core.result import safe, Ok, Err
from taipanstack.resilience.circuit_breaker import CircuitBreaker

breaker = CircuitBreaker(failure_threshold=3, timeout=60, name="payments")

@breaker
@safe
def charge_customer(customer_id: str, amount: float) -> dict:
    return payment_gateway.charge(customer_id, amount)

# Both circuit protection AND explicit error handling
result = charge_customer("cust_123", 49.99)
match result:
    case Ok(receipt):
        print(f"Payment successful: {receipt}")
    case Err(error):
        print(f"Payment failed safely: {error}")

🔗 Combining Result + Retry with Monitoring

from taipanstack.core.result import safe
from taipanstack.resilience.retry import retry

@retry(
    max_attempts=3,
    on=(ConnectionError, TimeoutError),
    on_retry=lambda attempt, max_a, exc, delay: print(
        f"⚠️  Attempt {attempt}/{max_a} failed, retrying in {delay:.1f}s..."
    ),
)
@safe
def fetch_user_profile(user_id: str) -> dict:
    return api_client.get(f"/users/{user_id}")

# Retry handles transient failures, Result handles business errors
profile = fetch_user_profile("usr_456").unwrap_or({"name": "Unknown"})

🔗 Adaptive Resilience Pipeline

from taipanstack.core.result import Result, Ok, Err
from taipanstack.resilience.adaptive import ResilienceOrchestrator, AdaptiveCircuitBreaker
from taipanstack.resilience.retry import RetryConfig

# Compose an intelligent pipeline: Bulkhead -> Breaker -> Retry -> Timeout -> Fallback
orch = (
    ResilienceOrchestrator("billing_api")
    .with_bulkhead(max_concurrent=10, max_queue=50) # Prevent resource exhaustion
    .with_circuit_breaker(AdaptiveCircuitBreaker("billing", target_error_rate=0.1)) # Auto-tunes thresholds
    .with_retry(RetryConfig(max_attempts=3, initial_delay=0.1))
    .with_fallback({"status": "unavailable"})
)

async def process_billing() -> Result[dict, Exception]:
    # The orchestrator handles all concurrency, retry, circuit breaking, and fallbacks
    return await orch.execute(stripe_gateway.charge)

Intelligent Caching

from taipanstack.utils.cache import cached
from taipanstack.core.result import Result

@cached(ttl=60)
async def get_user_data(user_id: int) -> Result[dict, Exception]:
    return await db.fetch(user_id) # Only Ok() results are cached

Fallbacks & Timeouts

from taipanstack.resilience.resilience import fallback, timeout
from taipanstack.core.result import Result

@fallback({"status": "offline"}, exceptions=(TimeoutError,))
@timeout(seconds=5.0)
async def fetch_remote_status() -> Result[dict, Exception]:
    return await api.get_status()

🐳 Docker

# Build hardened image
docker build -t taipanstack:latest .

# Run (rootless, read-only)
docker run --rm --read-only taipanstack:latest

Security features: multi-stage build, Alpine base (<50MB), non-root appuser (UID 1000), healthcheck, no shell in runtime.


🛠️ Tech Stack

Runtime Quality DevSecOps
  • Pydantic v2
  • Orjson
  • Uvloop
  • Structlog
  • Result
  • Ruff
  • Mypy
  • Bandit
  • Pytest + Hypothesis
  • mutmut
  • GitHub Actions
  • Syft + Cosign (SBOM/SLSA)
  • Dependabot
  • Pre-commit
  • Poetry
  • Docker (Alpine, rootless)

🤝 Contributing

Contributions are welcome! Please check our Contributing Guide for details on:

  • 🐛 Bug reports
  • ✨ Feature requests
  • 📝 Documentation improvements
  • 🔧 Pull requests

🤖 Note for AI Assistants & Agents: If you are an AI assistant contributing to this repository, you MUST strictly adhere to the AI Agents Guidelines.


📝 License

This project is open-sourced under the MIT License.


Made with ❤️ for the Python community

⬆ Back to Top

Metadata

Release files for taipanstack 0.7.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 taipanstack 0.7.1
File Size Uploaded Provenance Actions
taipanstack-0.7.1.tar.gz 100.1 kB With provenance Details for taipanstack-0.7.1.tar.gz

Built distribution (wheel)

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

Total release size: 218.9 kB

Release files / taipanstack-0.7.1.tar.gz

Download URL taipanstack-0.7.1.tar.gz
Size 100.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c562c49cdfd3506bdd95c8046a99d573e77671103231bcdeb408c115e0740509
BLAKE2b-256 checksum
How to use checksums
b76d9b8730460f9a9fdd5ff55285916ae161f2f233628d1a7393d5ccc6b3ebc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / taipanstack-0.7.1-py3-none-any.whl

Download URL taipanstack-0.7.1-py3-none-any.whl
Size 118.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8a2de26d0bd066a8d67429f2ee202202dd273ab36e83d1148483cfbf4a9935e
BLAKE2b-256 checksum
How to use checksums
dd541ca84cd05efec59053ec0b881db3edc8615a226f22b5d1b7483a3e951420
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for taipanstack 0.7.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for taipanstack-0.7.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.7.1 This release

2 release files Full provenance

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