Skip to main content

🐍 Taipan Stack

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 Taipan Stack?

"Write less, build better."

Taipan Stack 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.6.1

  • Security & Hardening: Hardened RateLimiter against infinite tokens mutations, key decoding in JWT, and validate_project_name argument parsing. Fixed large password payload crashes and removed unused constants (PR #966, #967, #968, #973, #989).
  • Concurrency & Resilience: Fixed a bulkhead acquisition memory leak in ResilienceOrchestrator and documented AdaptiveRetry features (PR #974, #980).
  • Clean Code & Refactoring: Significantly reduced cyclomatic complexity across compatibility shims, validators, filesystems, and token buckets. Enforced strict web bridge type hints and clean keyword parameters (PR #971, #976, #979, #984, #988, #993, #997, #1002, #1003).
  • QA and Standardized Testing: Fully standardized test file nomenclature, verified 1,460+ passing tests with 100% genuine branch coverage, and added rigorous microservice chaos engineering simulations (PR #972, #975, #981, #986, #990, #992, #994, #999, #1004).

🛡️ 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 (1,430 tests)
  • Architecture enforcement
  • Hardened Docker template

🚀 Quick Start

Prerequisites

  • Python 3.11+ (supports 3.11, 3.12, 3.13, 3.14)
  • 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 (1,430 tests)
make test

# Check architecture contracts
make lint-imports

# Run security scans
make security

# Run property-based fuzzing
make property-test

📐 Architecture

Taipan Stack 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/                # ✅ 1,430 tests, 100% coverage
├── .semgrep/             # 🔍 Custom SAST rules
├── .github/              # 🔄 CI/CD + SBOM/SLSA workflows
├── Dockerfile            # 🐳 Hardened multi-stage container
└── pyproject.toml        # 📋 Modern dependency management

🔐 DevSecOps

Taipan Stack 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.14 × (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

📚 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_path_traversal, guard_command_injection

# 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"]
)

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, unwrap_or
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 = unwrap_or(fetch_user_profile("usr_456"), {"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

📝 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.6.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.6.1
File Size Uploaded
taipanstack-0.6.1.tar.gz 93.5 kB Details

Built distribution (wheel)

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

Total release size: 205.4 kB

Release files / taipanstack-0.6.1.tar.gz

Download URL taipanstack-0.6.1.tar.gz
Size 93.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3fe3582d6eefccd0de544b53049340ae9d5765c8c97ac2aa1b9c287f2a0ca871
BLAKE2b-256 checksum
How to use checksums
3fddd594aa8131d7c9fa6e5e5e71fe82c7fc58bcf567bd354bfc31aefd8d8597
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 14, 2026.

Transparency log

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

Download URL taipanstack-0.6.1-py3-none-any.whl
Size 111.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24307ae737a24fccd30a3985fe29892dc92f50efce408c9daab438527dcf96c1
BLAKE2b-256 checksum
How to use checksums
2feeec2be9b9dfce404081a569e6946abd3b97380830fddf17ffb7aeab024313
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

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