Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrosnet committed Nov 24, 2022
1 parent c9ae46e commit a51f5b4
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,21 @@ def statistics():


reqparse = reqparse.RequestParser()
reqparse.add_argument('url', type = str, required = True, location='args', help="The URL/DOI of the resource to be evaluated")
reqparse.add_argument(
"url",
type=str,
required=True,
location="args",
help="The URL/DOI of the resource to be evaluated",
)


def generate_check_api(metric):
@fc_check_namespace.route("/metric_" + metric.get_principle_tag())
class MetricEval(Resource):
@fc_check_namespace.doc('Evaluate ' + metric.get_principle_tag() + ' FAIR metric')
@fc_check_namespace.doc(
"Evaluate " + metric.get_principle_tag() + " FAIR metric"
)
@fc_check_namespace.expect(reqparse)
def get(self):

Expand Down Expand Up @@ -442,7 +451,6 @@ def get(self):
generate_check_api(METRICS_CUSTOM[key])



@fc_check_namespace.route("/metrics_all")
# @fc_check_namespace.doc(url_fields)
class MetricEvalAll(Resource):
Expand All @@ -453,14 +461,14 @@ class MetricEvalAll(Resource):
# # self.reqparse.add_argument('test', type = str, required = True, location='args')
# # super(MetricEvalAll, self).__init__()

@fc_check_namespace.doc('Evaluates all FAIR metrics at once')
@fc_check_namespace.doc("Evaluates all FAIR metrics at once")
@fc_check_namespace.expect(reqparse)
def get(self):
"""All FAIR metrics"""

args = reqparse.parse_args()
url = args["url"]

web_res = WebResource(url)

results = []
Expand All @@ -481,8 +489,10 @@ def get(self):

return results


# fc_check_namespace.add_resource(MetricEvalAll, "/metrics_all")


@fc_inspect_namespace.route("/get_rdf_metadata")
class RetrieveMetadata(Resource):
@fc_inspect_namespace.produces(["application/ld+json"])
Expand Down Expand Up @@ -522,9 +532,7 @@ def get(self):


def generate_ask_api(describe):
@fc_inspect_namespace.route(
"/" + describe.__name__, methods=["GET"]
)
@fc_inspect_namespace.route("/" + describe.__name__, methods=["GET"])
@fc_inspect_namespace.route("/" + describe.__name__ + "/", methods=["POST"])
# @api.doc(params={"url": "An URL"})
class Ask(Resource):
Expand Down

0 comments on commit a51f5b4

Please sign in to comment.