Skip to content
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (34 sloc) 1.01 KB
from flask import Flask
from flask_api import FlaskAPI
from pandas_datapackage_reader import read_datapackage
from flask import (
url_for, redirect,
request, flash,
from .util import *
app = FlaskAPI(__name__)
# Create API endpoints
data = read_datapackage("data")
def api_dict(resource):
return get_paginated(request.args, data[resource])
def api_json(resource):
return get_paginated(request.args, data[resource], True)
def api_all_json(resource):
return data[resource].to_json(orient='records')
# Static views
def send_home():
return render_template('public/index.html')
def send_static(path):
return send_from_directory('static', path)
def send_images(path):
return send_from_directory('images', path)
if __name__ == '__main__':
You can’t perform that action at this time.