Skip to main content

A simple and fast API framework for Python

Project description

Jararaca Logo

Jararaca Microservice Framework

Overview

Jararaca is an async-first microservice framework designed to simplify the development of distributed systems. It provides a comprehensive set of tools for building robust, scalable, and maintainable microservices with a focus on developer experience and type safety.

Key Features

REST API Development

  • Easy-to-use interfaces for building REST APIs
  • Automatic request/response validation
  • Type-safe endpoints with FastAPI integration
  • Automatic OpenAPI documentation generation

Message Bus Integration

  • Topic-based message bus for event-driven architecture
  • Support for both worker and publisher patterns
  • Built-in message serialization and deserialization
  • Easy integration with AIO Pika for RabbitMQ

Distributed WebSocket

  • Room-based WebSocket communication
  • Distributed broadcasting across multiple backend instances
  • Automatic message synchronization between instances
  • Built-in connection management and room handling

Task Scheduling

  • Cron-based task scheduling
  • Support for overlapping and non-overlapping tasks
  • Distributed task execution
  • Easy integration with message bus for task distribution

TypeScript Integration

  • Automatic TypeScript interface generation
  • Command-line tool for generating TypeScript types
  • Support for REST endpoints, WebSocket events, and message bus payloads
  • Type-safe frontend-backend communication
  • @ExposeType decorator - Explicitly expose types for TypeScript generation without needing them in endpoints

Hexagonal Architecture

  • Clear separation of concerns
  • Business logic isolation from infrastructure
  • Easy testing and maintainability
  • Dependency injection for flexible component management

Observability

  • Built-in OpenTelemetry integration
  • Distributed tracing support
  • Logging and metrics collection
  • Performance monitoring capabilities

Quick Start

Installation

pip install jararaca

Basic Usage

from jararaca import Microservice, create_http_server
from jararaca.presentation.http_microservice import HttpMicroservice

# Define your microservice
app = Microservice(
    providers=[
        # Add your providers here
    ],
    controllers=[
        # Add your controllers here
    ],
    interceptors=[
        # Add your interceptors here
    ],
)

# Create HTTP server
http_app = HttpMicroservice(app)
web_app = create_http_server(app)

Running the Service

# Run as HTTP server
jararaca server app:http_app

# Run as message bus worker
jararaca worker app:app

# Run as scheduler
jararaca scheduler app:app

# Generate TypeScript interfaces
jararaca gen-tsi app.main:app app.ts

Documentation

For detailed documentation, please visit our documentation site.

Examples

Check out the examples directory for complete working examples of:

  • REST API implementation
  • WebSocket usage
  • Message bus integration
  • Task scheduling
  • TypeScript interface generation

Contributing

Contributions are welcome! Please read our contributing guidelines for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

jararaca-0.4.0a32.tar.gz (447.6 kB view details)

Uploaded Source

Built Distribution

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

jararaca-0.4.0a32-py3-none-any.whl (176.4 kB view details)

Uploaded Python 3

File details

Details for the file jararaca-0.4.0a32.tar.gz.

File metadata

  • Download URL: jararaca-0.4.0a32.tar.gz
  • Upload date:
  • Size: 447.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.15 Linux/6.14.0-1017-azure

File hashes

Hashes for jararaca-0.4.0a32.tar.gz
Algorithm Hash digest
SHA256 d1677e282f2d18827c664b44e54b90bab09175ebacffb9d5cafaad42b38c7c94
MD5 ba5ae66bb3da02f73ff8d5b534f1504b
BLAKE2b-256 f711926ec40cdae799fd68dc0ff9708bc98798686fdb5f858d8b52fea3902f9e

See more details on using hashes here.

File details

Details for the file jararaca-0.4.0a32-py3-none-any.whl.

File metadata

  • Download URL: jararaca-0.4.0a32-py3-none-any.whl
  • Upload date:
  • Size: 176.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.15 Linux/6.14.0-1017-azure

File hashes

Hashes for jararaca-0.4.0a32-py3-none-any.whl
Algorithm Hash digest
SHA256 b3c9a56055579119c4577c505da66171cc61e2f960dc5ae983f42647bec77c93
MD5 4a7e7f20c19bdde4f97bf7a05fd0067a
BLAKE2b-256 4d69a14c664c75a6b86ceabdd23ce12d6fe3fbca6edfd5bcde77ace09f1123be

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