A microservices framework for Python that lets service developers concentrate on application logic and encourages testability.

A nameko service is just a class:


from nameko.rpc import rpc

class GreetingService:
    name = "greeting_service"

    def hello(self, name):
        return "Hello, {}!".format(name)


The example above requires RabbitMQ, because it’s using the built-in AMQP RPC features. RabbitMQ installation guidelines offer several installation options, but you can quickly install and run it using Docker.

To install and run RabbitMQ using docker:

$ docker run -d -p 5672:5672 rabbitmq:3
You might need to use sudo to do that.

You can run it in a shell:

$ nameko run helloworld
starting services: greeting_service

And play with it from another:

$ nameko shell
>>> n.rpc.greeting_service.hello(name="ナメコ")
'Hello, ナメコ!'