A simple and fast API framework for Python
Project description
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
@ExposeTypedecorator - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jararaca-0.4.0a35.tar.gz.
File metadata
- Download URL: jararaca-0.4.0a35.tar.gz
- Upload date:
- Size: 444.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.11.9 Linux/6.18.21-1-lts
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43e3a9520a8e6c84359a23f5ea19be8cebd3486fb74e7d91b270aa2a5283a338
|
|
| MD5 |
9da34982ff44de8387c645c2c48b6dc4
|
|
| BLAKE2b-256 |
de2b2cd708abef22911cb13619a6430bc8b8977ff78e3e7c017b43775a9efcf3
|
File details
Details for the file jararaca-0.4.0a35-py3-none-any.whl.
File metadata
- Download URL: jararaca-0.4.0a35-py3-none-any.whl
- Upload date:
- Size: 161.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.11.9 Linux/6.18.21-1-lts
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fb1d309a687054cb65faae99300c8968d87cd49db5fadd912a2e4a66cf73667
|
|
| MD5 |
8aa3d837f4ca77912e8522ea66e15527
|
|
| BLAKE2b-256 |
845c87cdf1e3cd1aa7536dc48d31b801d4aead397962df17b2bf40903f716b83
|