-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
84 lines (59 loc) · 1.68 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
from flask import Flask, Blueprint, Response, request, send_file
from flask import render_template, redirect, url_for, make_response
from flask_restplus import Api, Resource, reqparse
from flask_restplus import Model, fields, marshal_with
from flask import jsonify, abort
import os
import re
import sys
from io import BytesIO
import zipfile
import pandas as pd
app = Flask(__name__)
api = Api(app)
# Create a URL route in our application for "/"
'''
species_model = api.model('Model', {
'task': 'fields.String',
'uri': "fields.Url('todo_ep')"
})
'''
species_ns = api.namespace(
name="species", description="Species searching by name"
)
species_parser = reqparse.RequestParser()
# species_parser.add_argument("")
@species_ns.route('/species')
class Species(Resource):
"""
This function just responds to the browser ULR
localhost:5000/
:return: varinats json
"""
# @api.marshal_with(var_model)
def get(self, id):
return {'var_name': '34868', 'var_type': 'Snp'}
taxonomy_ns = api.namespace(
name="taxonomy", description="Taxonomy searching by name"
)
@taxonomy_ns.route('/taxonomy/')
class Taxonomy(Resource):
"""
This function just responds to the browser ULR
localhost:5000/
:return: varinats json
"""
# @api.marshal_with(var_model)
def get(self, id):
return {'var_name': '34868', 'var_type': 'Snp'}
observation_ns = api.namespace(
name="observation", description="Species searching by name"
)
@observation_ns.route('/observation/<string:hgsgv_names>/list')
class Observations(Resource):
"""
"""
def get(self, id):
pass
if __name__ == "__main__":
app.run(debug=True, port=5001)