No project description provided
Project description
Jararaca Microservice Framework
Overview
Jararaca is a aio-first microservice framework that provides a set of tools to build and deploy microservices in a simple and clear way.
Features
Hexagonal Architecture
The framework is based on the hexagonal architecture, which allows you to separate the business logic from the infrastructure, making the code more testable and maintainable.
Dependency Injection
The framework uses the dependency injection pattern to manage the dependencies between the components of the application.
Web Server Port
The framework provides a web server that listens on a specific port and routes the requests to the appropriate handler. It uses FastAPI as the web framework.
Message Bus
The framework provides a message bus that allows you to send messages between the components of the application. It uses AIO Pika as the message broker worker and publisher.
Installation
pip install jararaca
Usage
Create a Microservice
# app.py
from jararaca import Microservice, create_http_server, create_messagebus_worker
app = Microservice(
providers=[
ProviderSpec(
provide=Token[AppConfig],
use_factory=AppConfig.provider,
)
],
controllers=[TasksController],
interceptors=[
AIOSqlAlchemySessionInterceptor(
AIOSQAConfig(
connection_name="default",
url="sqlite+aiosqlite:///db.sqlite3",
)
),
],
)
web_app = create_http_server(app)
messagebus_worker = create_messagebus_worker(app)
Run as a Web Server
uvicorn app:web_app --reload
Run as a Message Bus Worker
jararaca worker app:messagebus_worker
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
Hashes for jararaca-0.1.2a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45e32f25a6469ec365d50864eaf300e3fee90fded151884f1fc336571fe56a68 |
|
MD5 | 0943781a7d3632808fd8c11d5f2398b9 |
|
BLAKE2b-256 | e6dd2c58f8c0f38bb1d0be4cb60c642d00d3b420111095e22f5ed46d623fa1f9 |