Introduction
tomodachi
⌁ a lightweight microservice lib ⌁ for Python 3
tomodachi
A framework to quickly create microservices using
asyncio
(async
/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.
Built on Python 3 and used for fast-paced development
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. ✨✨
Additional features
🦸 ⋯ 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.
Already supported protocols / transport layers
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 tomodachi.Invoker
class.
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
Source code / open source / GitHub
Note that
tomodachi
is open source software licensed under theMIT License
and 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
Disclaimer
Please note: this library is a work in progress.
Consider
tomodachi
as beta software.tomodachi
is still an experimental project with an unregular release schedule. The package is not yet available as1.0.0
and there may be breaking changes between0.x
versions.
Updated over 1 year ago