pyfarm.master.application module


Contains the functions necessary to construct the application layer classes necessary to run the master.

class pyfarm.master.application.SessionMixin[source]

Bases: object

Mixin which adds a _session attribute. This class is provided mainly to limit issues with circular imports.

class pyfarm.master.application.UUIDConverter(map)[source]

Bases: werkzeug.routing.BaseConverter

A URL converter for UUIDs. This class is loaded as part of the Flask application setup and may be used in url routing:

def foobar(value):

When a request such as GET /foo/F9A63B47-66BF-4E2B-A545-879986BB7CA9 is made UUIDConverter will receive value to to_python() which will then convert the string to an instance of UUID.


Global before_request handler that will handle common problems when trying to accept json data to the api.


Constructs and returns an instance of Blueprint for routing api requests.

Parameters:url_prefix (string) – The url prefix for the api such as /api/v1. If not provided then value will be derived from the api_prefix configuration variable.

Returns a new application context. If keys and values are provided to config_values they will be used to override the default configuration values or create new ones

>>> app = get_application(TESTING=True)
>>> assert app.testing is True
Parameters:setup_appcontext (bool) – If True then setup the flask.g variable to include the application level information (ex. g.db)

Constructs and returns an instance of LoginManager. Any keyword arguments provided will be passed to the constructor of LoginManager


Constructs and returns and instance of URLSafeTimedSerializer

pyfarm.master.application.get_sqlalchemy(app=None, use_native_unicode=True, session_options=None)[source]

Constructs and returns an instance of SQLAlchemy. Any keyword arguments provided will be passed to the constructor of SQLAlchemy