Flask-APIAlchemy is an extension for Flask, modeled after Flask-SQLAlchemy, that adds support for APIAlchemy to your application. It aims to simplify using APIAlchemy with Flask.
pip install Flask-APIAlchemy
Output the contents of a file located in a GitHub repository:
from flask import Flask
from flask_apialchemy import APIAlchemy
app = Flask(__name__)
app.config['APIALCHEMY_SERVICE_URI'] = 'github://[email protected]'
aa = APIAlchemy(app)
kwargs = {
'org': 'org_name',
'repo': 'repo_name',
'path': 'path/to/file'
}
file_contents = aa.service.get_file_contents(aa.service.client, **kwargs)
print(file_contents)
Distributed under the BSD 3-Clause license.