Skip to main content

ProcessPype

CI codecov Python 3.13+ PyPI License: MIT Docs

A modular application framework for building service-oriented Python applications with FastAPI integration, structured logging, and a clear service lifecycle.

Features

  • Service Framework: Define services with a clear lifecycle (initialize, configure, start, stop) and automatic REST API endpoints
  • FastAPI Integration: Each service automatically gets HTTP endpoints for status, start, stop, and configuration
  • Configuration Management: YAML file, environment variable, and programmatic configuration with Pydantic models
  • Pure Framework: No built-in services — provides the infrastructure for building your own with clear patterns and examples
  • REST API: Application-level endpoints for service discovery, registration, and lifecycle management
  • Observability: Structured logging with multiple formatters (JSON, color, text), log redaction, and OpenTelemetry tracing support (Logfire, OTLP gRPC/HTTP, console)
  • Type Safe: Fully typed with MyPy strict mode
  • Well Tested: Comprehensive test suite with high coverage

Installation

# Using pip
pip install processpype

# Using uv
uv add processpype

Quick Start

import asyncio
from processpype import Application, ProcessPypeConfig, Service, ServiceManager, ServiceConfiguration


class GreeterManager(ServiceManager):
    async def start(self) -> None:
        self.logger.info("Greeter ready")

    async def stop(self) -> None:
        self.logger.info("Greeter stopped")


class GreeterService(Service):
    configuration_class = ServiceConfiguration

    def create_manager(self) -> GreeterManager:
        return GreeterManager(self.logger)

    def requires_configuration(self) -> bool:
        return False


async def main() -> None:
    config = ProcessPypeConfig(
        app={"title": "Hello App"},
        server={"port": 8080},
    )
    async with Application(config) as app:
        await app.initialize()
        service = app.register_service(GreeterService)
        await app.start_service(service.name)


asyncio.run(main())

Core Components

  • Application: Central orchestrator that manages the FastAPI server, configuration, and service lifecycle

    • Application(config): Create an instance with a ProcessPypeConfig
    • app.register_service(ServiceClass): Register and wire a service into the application
    • app.start_service(name) / app.stop_service(name): Lifecycle control
  • Service: Abstract base class for all services — implement create_manager() and optionally create_router()

    • Automatic REST endpoints: GET /services/{name}, POST /services/{name}/start, POST /services/{name}/stop
    • Built-in state machine: INITIALIZED → CONFIGURED → STARTING → RUNNING → STOPPING → STOPPED
  • ServiceManager: Handles business logic for a service — implement start() and stop()

  • Configuration: Hierarchical ProcessPypeConfig with app, server, and logging sections — Pydantic-validated, loadable from YAML files, environment variables, or kwargs

Documentation

Full documentation is available at gianlucapagliara.github.io/processpype.

Development

ProcessPype uses uv for dependency management and packaging:

# Install dependencies
uv sync

# Run tests
uv run pytest

# Run type checks
uv run mypy processpype

# Run linting
uv run ruff check .

# Run pre-commit hooks
uv run pre-commit run --all-files

Metadata

Release files for processpype 2.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for processpype 2.1.3
File Size Uploaded Provenance Actions
processpype-2.1.3.tar.gz 170.4 kB Without provenance Details for processpype-2.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 226.4 kB

Release files / processpype-2.1.3.tar.gz

Download URL processpype-2.1.3.tar.gz
Size 170.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d6e039d7647591ddc9feb0a05be1b0e27fad1e801d36b4d4bcac672618bb860c
BLAKE2b-256 checksum
How to use checksums
b1f2286069fc2e8ee38deb4efd00104ea015815b9d5c5a1e51eec9af615a5284
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / processpype-2.1.3-py3-none-any.whl

Download URL processpype-2.1.3-py3-none-any.whl
Size 56.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2bbb2bb40fd7e8d7c9f62edbcb6af1a4a04d597da920c57092d03ab4ded5f66
BLAKE2b-256 checksum
How to use checksums
9e81d632c9a55cf8d4d36735008a3eb8475671a806f6a4feba1110dfbdcf8ef3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for processpype 2.1.3

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.

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