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 your will. In order to instantiate a backend, Ramos requires the class to have a classmethod create, which can't accept any parameter 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 (but you can use Abstract Base Classes for that).


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