Ramos - Generic Backend Pool

Ramos is a library to create, locate, instantiate and control the lifecyle of generic backends.

What is a backend?

Plugable Backend (or backend for short) is a term borrowed from Django. It is a standard interface to a resource, so that it can be plugged at the developer's will. In order to instantiate a backend, Ramos requires the class to have a classmethod create, which usually does not accept any parameter (but it can, if you need) and must return your backend's instance. Ramos does not verify if the classes configured in a backend type really have a common interface, it is up to you (Abstract Base Classes can help).


install using pip.

pip install ramos


This is a quick step-by-step example of what you can do with Ramos. We will create 2 simple and interchangeable backends which only print a greeting.

Create the backends.

class PrintHiBackend:

    id = 'hi'

    def create(cls):
        return cls()

    def print(self):

class PrintByeBackend:

    id = 'bye'

    def create(cls):
        return cls()

    def print(self):

Setup the path for your backends.

import ramos

    'print': (

Setup the backend pool to load your backends.

from ramos.pool import BackendPool

class PrintBackendPool(BackendPool):
    backend_type = 'print'

Instantiate the pool and use your backends!

pool = PrintBackendPool()

# iterate over all of them
for backend in pool.all():

# get a backend by id
backend = pool.get('bye')

See also