Nameko

[ nah - meh - koh ]

A microservice framework for Python.

Focus on business logic

Focus on business logic

Write regular Python methods and classes to implement your service. Nameko will manage connections, transports and concurrency for you.

Distributed and scalable

Distributed and scalable

Spin up multiple service instances to easily scale out. Nameko gives you effortless concurrency by yielding workers when they wait for I/O, leaving you free to handle many requests without the worry of threading.

Extensible

Extensible

Nameko is compatible with almost any protocol, transport or database. Simply use the built-in extensions, build your own or leverage the community.

Examples

RPC

Nameko includes an implementation of RPC over AMQP. It comprises the @rpc entrypoint, a proxy for services to talk to other services, and a standalone proxy that non-Nameko clients can use to make RPC calls to a cluster

# rpc.py
from nameko.rpc import rpc, RpcProxy

class ServiceY:
    name = "service_y"

    @rpc
    def append_identifier(self, value):
        return u"{}-y".format(value)


class ServiceX:
    name = "service_x"

    y = RpcProxy("service_y")

    @rpc
    def remote_method(self, value):
        res = u"{}-x".format(value)
        return self.y.append_identifier(res)

HTTP

The HTTP entrypoint is built on top of werkzeug, and supports all the standard HTTP methods (GET/POST/DELETE/PUT etc)

# http.py
import json
from nameko.web.handlers import http

class HttpService:
    name = "http_service"

    @http('GET', '/get/<int:value>')
    def get_method(self, request, value):
        return json.dumps({'value': value})

    @http('POST', '/post')
    def do_post(self, request):
        return u"received: {}".format(request.get_data(as_text=True))

Installation

The easiest way to install Nameko is from PyPI, using pip

$ pip install nameko

To read the detailed installation instructions, see our documentation

Community

Discourse

Questions & Support

Twitter

News & Announcements

Gitter

Real-time Chat

Github

Issues & Pull Requests

Discourse

Questions & Support

Extensions

Sends exception info to Sentry

Send and receive messages from Slack

Sqlalchemy dependancy

Redis dependancy

Django wrapper for Nameko

Retry delivery of messages

Sends exception info to Sentry

Testimonials

Probably the best Open Source solution for this problem in the Python world so far

-- Armin Ronacher@mitsuhiko

Bottom line, if you are considering microservices, Nameko will save you time and energy

-- Conor Seabrook@sideboltconor

Used by many

The authors

Matt Yule-Bennett

Matt Yule-Bennett

With the help of a bunch of talented, hard working contributors!

A team effort - designed by Andreea Hrincu and built by Kyle Stewart