biothings.web.applications

Biothings Web Applications -

define the routes and handlers a supported web framework would consume basing on a config file, typically named config.py, enhanced by biothings.web.settings.configs.

The currently supported web frameworks are Tornado, Flask, and FastAPI.

The biothings.web.launcher can start the compatible HTTP servers basing on their interface. And the web applications delegate routes defined in the config file to handlers typically in biothings.web.handlers.

Web Framework

Interface

Handlers

Tornado

Tornado

biothings.web.handlers.*

Flask

WSGI

biothings.web.handlers._flask

FastAPI

ASGI

biothings.web.handlers._fastapi

biothings.web.applications.BiothingsAPI

alias of biothings.web.applications.TornadoBiothingsAPI

class biothings.web.applications.FastAPIBiothingsAPI[source]

Bases: object

classmethod get_app(config)[source]
class biothings.web.applications.FlaskBiothingsAPI[source]

Bases: object

classmethod get_app(config)[source]
class biothings.web.applications.TornadoBiothingsAPI(*args, **kwargs)[source]

Bases: tornado.web.Application

classmethod get_app(config, settings=None, handlers=None)[source]

Return the tornado.web.Application defined by this config. Additional settings and handlers are accepted as parameters.

biothings.web.applications.load_class(kls)[source]