Skip to main content

TaipanStack - Modular, secure, and scalable Python stack for robust development

Project description

๐Ÿ TaipanStack

The Modern Python Foundation

Launch secure, high-performance Python applications in seconds.

CI 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.

๐Ÿ›ก๏ธ 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
  • Performance benchmarks with regression detection

๐ŸŽฏ 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 (664 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 (664 tests)
make test

# Check architecture contracts
make lint-imports

# Run security scans
make security

# Run property-based fuzzing
make property-test

# Run performance benchmarks
make benchmark

๐Ÿ“ Architecture

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

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚             Application             โ”‚
                    โ”‚          (src/app/main.py)          โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                      โ”‚
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ–ผ                           โ–ผ                           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    Security     โ”‚       โ”‚     Config      โ”‚       โ”‚     Utils       โ”‚
โ”‚ guards, saniti- โ”‚       โ”‚    models,      โ”‚       โ”‚  logging, retry โ”‚
โ”‚ zers, validatorsโ”‚       โ”‚   generators    โ”‚       โ”‚ metrics, fs     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                         โ”‚                         โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚              Core                   โ”‚
                    โ”‚    Result types, base patterns      โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Project Structure

TaipanStack/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/              # Application entry point
โ”‚   โ””โ”€โ”€ taipanstack/
โ”‚       โ”œโ”€โ”€ core/         # ๐ŸŽฏ Result types, functional patterns
โ”‚       โ”œโ”€โ”€ config/       # โš™๏ธ Configuration models & generators
โ”‚       โ”œโ”€โ”€ security/     # ๐Ÿ›ก๏ธ Guards, sanitizers, validators
โ”‚       โ””โ”€โ”€ utils/        # ๐Ÿ”ง Logging, metrics, retry, filesystem
โ”œโ”€โ”€ tests/                # โœ… 664 tests, 100% coverage
โ”œโ”€โ”€ .semgrep/             # ๐Ÿ” Custom SAST rules
โ”œโ”€โ”€ .github/              # ๐Ÿ”„ CI/CD + SBOM/SLSA workflows
โ”œโ”€โ”€ Dockerfile            # ๐Ÿณ Hardened multi-stage container
โ””โ”€โ”€ pyproject.toml        # ๐Ÿ“‹ Modern dependency management

๐Ÿ” DevSecOps

TaipanStack integrates security and quality at every level:

Category Tools Purpose
SAST Bandit, Semgrep + custom rules Static Application Security Testing
SCA Safety, 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
Perf pytest-benchmark Performance regression detection
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.utils.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.utils.circuit_breaker import circuit_breaker

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

๐Ÿณ 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
  • pytest-benchmark
  • 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

Project details


Download files

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

Source Distribution

taipanstack-0.3.0.tar.gz (44.9 kB view details)

Uploaded Source

Built Distribution

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

taipanstack-0.3.0-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

Details for the file taipanstack-0.3.0.tar.gz.

File metadata

  • Download URL: taipanstack-0.3.0.tar.gz
  • Upload date:
  • Size: 44.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for taipanstack-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8d66026e7687193661bc5e3f49394d44505016a7e3d98e5ac13e82716f5b2281
MD5 ec1209e725ed6546d84b9eb804ce4d9d
BLAKE2b-256 7d3df9ef9eef71db9f63f9a0f9a8b89e3e194fc74a867e37bbde76a5b7582f03

See more details on using hashes here.

Provenance

The following attestation bundles were made for taipanstack-0.3.0.tar.gz:

Publisher: publish.yml on gabrielima7/TaipanStack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taipanstack-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: taipanstack-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 51.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for taipanstack-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fafa00e01e9016cbc8f47b5d21f0faaa619106d84bfebcedad06bb86ccc34d27
MD5 7ebb3b584505a27d73346f19b279a24b
BLAKE2b-256 3c1f3338e9b0508af0f73e42b950ba9625e361ad6bef1a7f79aa979f5ad41847

See more details on using hashes here.

Provenance

The following attestation bundles were made for taipanstack-0.3.0-py3-none-any.whl:

Publisher: publish.yml on gabrielima7/TaipanStack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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