Example #1
0
def create_app():
    logger.info("Initiating Flask-REsT API.")
    app = Flask(__name__)
    api = Api(
        app,
        title='APS',
        version='1.0',
    )
    api.namespaces = []
    CORS(app)
    api.add_namespace(_job_schedule_api, path='/schedule')
    return app
Example #2
0
            return authenticate()
        return f(*args, **kwargs)

    return decorated


app = Flask(__name__)
app.config.SWAGGER_UI_DOC_EXPANSION = 'list'
api = Api(
    app,
    version='0.1',
    title='Explorable Labs API',
    description=
    'API microservices for science.\nThe molecular descriptors and some of the similarity-related operations are being generated using RDKit version 2018.09.1\nThe json returned from these endpoints is meant to be consumed by code - if you want it to be human-readable you should install an extension on your browser for viewing JSON files, such as JSON View.'
)
api.namespaces = []
app.wsgi_app = ProxyFix(
    app.wsgi_app)  # Let the swagger docs show up when we're on https

ns = api.namespace(
    'descriptors',
    description=
    "Operations related to molecular descriptors. Example <a href=\"https://api.explorablelabs.com/descriptors/smiles/CN1C=NC2=C1C(=O)N(C(=O)N2C)C\">caffeine</a>."
)
ns_sim = api.namespace(
    'similarity',
    description=
    "Operations related to molecular similarity. (Requires authentication. Contact [email protected] for a demo login.) Example <a href=\"https://api.explorablelabs.com/similarity/FDA/smiles/CC1=C(C=C(C=C1)NC(=O)C2=CC=C(C=C2)CN3CCN(CC3)C)NC4=NC=CC(=N4)C5=CN=CC=C5\">Gleevec</a>."
)