A framework to quickly create microservices using
await) on Python 3, with built-in support for HTTP, Websocket connections, AWS SNS+SQS event based messaging and RabbitMQ / AMQP topic exchange pub/sub for optional intra-service communication.
tomodachi is a library designed to make it easy for devs to build microservices using
asyncio on Python.
Includes ready implementations to support handlers built for HTTP requests, websockets, AWS SNS+SQS and RabbitMQ / AMQP for 🚀 event based messaging, 🔗 intra-service communication and 🐶 watchdog handlers.
HTTP request handlers (API endpoints) are sent requests via the
aiohttp server library. 🪢
Events and message handlers are hooked into a message bus, such as a queue, from for example AWS (Amazon Web Services) SNS+SQS (
aiobotocore), RabbitMQ / AMQP (
aioamqp), etc. 📡
Using the provided handler managers, the need for devs to interface with low-level libs directly should be lower, making it more of a breeze to focus on building the business logic. 🪄
tomodachi [友達] means friends — 🦊🐶🐻🐯🐮🐸🐍 — a suitable name for microservices working together. ✨✨
🦸 ⋯ Graceful termination of consumers, listeners and tasks to ensure smooth deployments.
⏰ ⋯ Scheduled function execution (cron notation / time interval) for building watchdog handlers.
🍔 ⋯ Execution middleware interface for incoming HTTP requests and received messages.
💌 ⋯ Simple envelope building and parsing for both receiving and publishing messages.
📚 ⋯ Logging support via structlog with template loggers for both "dev console" and JSON output.
⛑️ ⋯ Loggers and handler managers built to support exception tracing, from for example Sentry.
📡 ⋯ SQS queues with filter policies for SNS topic subscriptions filtering messages on message attributes.
📦 ⋯ Supports SQS dead-letter queues via redrive policy – infra orchestration from service optional.
🌱 ⋯ Designed to be extendable – most kinds of transport layers or event sources can be added.
tomodachi comes with some built-in triggers for your code, with the possibility to add additional subscriptions (ways of invoking service tasks / functions) by extending the
Currently available built-in supported protocols and transport methods:
- HTTP requests – including connection keep-alive
- WebSocket connections
- AWS SNS + SQS event based messaging – incl. message attributes, filter policy and DLQ support.
- RabbitMQ / AMQP pub/sub – topic exchange
- Scheduled function invocations – with cron notation or on timed intervals
tomodachiis open source software licensed under the
MIT Licenseand the full source code, releases and the changelog is available at:
- GitHub repository: https://github.com/kalaspuff/tomodachi
- Releases: https://github.com/kalaspuff/tomodachi/releases
- Changelog: https://github.com/kalaspuff/tomodachi/blob/master/CHANGES.rst
Please note: this library is a work in progress.
tomodachias beta software.
tomodachiis still an experimental project with an unregular release schedule. The package is not yet available as
1.0.0and there may be breaking changes between
Updated about 1 month ago