File tree Expand file tree Collapse file tree 2 files changed +6
-27
lines changed Expand file tree Collapse file tree 2 files changed +6
-27
lines changed Original file line number Diff line number Diff line change 1
- from fastapi import FastAPI , HTTPException , Security , Depends
2
- from fastapi .security import APIKeyQuery , APIKeyHeader
3
- from starlette .status import HTTP_403_FORBIDDEN
4
- import pandas as pd
5
-
6
- import pinkbombs as pb
1
+ from fastapi import FastAPI , Depends
7
2
from pinkbombs import api , verify_token
8
3
9
4
GRAPHS = ["aqua-tonnes" ]
15
10
api .router ,
16
11
prefix = "/api/v1/secure" ,
17
12
dependencies = [Depends (verify_token )]
18
- )
19
-
20
- # @app.get("/")
21
- # async def root():
22
- # return {"message": "Hello World"}
23
-
24
-
25
- # @app.get("/graphs/{graph_name}")
26
- # async def read_item(graph_name):
27
- # if graph_name not in GRAPHS:
28
- # raise HTTPException(status_code=404, detail="Item not found")
29
- # df = pd.read_excel(
30
- # "data/atlantic_salmon-aquaculture_tonnes_live_weight_by_country_by_year.xlsx",
31
- # )
32
- # chart_obj=pb.make_area_chart(
33
- # df,
34
- # "ISO2 Code",
35
- # "Tonnes - live weight"
36
- # )
37
- # return {"graph_name": graph_name, "graph": chart_obj.to_json(), "path": "data/atlantic_salmon-aquaculture_tonnes_live_weight_by_country_by_year.xlsx"}
13
+ )
Original file line number Diff line number Diff line change @@ -24,4 +24,7 @@ async def generate(graph_name, connection: bool = Depends(verify_token)):
24
24
"ISO2 Code" ,
25
25
"Tonnes - live weight"
26
26
)
27
- return {"graph_name" : graph_name , "graph" : chart_obj .to_json (), "path" : "data/atlantic_salmon-aquaculture_tonnes_live_weight_by_country_by_year.xlsx" }
27
+ return {
28
+ "graph_name" : graph_name , "graph" : chart_obj .to_json (),
29
+ "path" : "data/atlantic_salmon-aquaculture_tonnes_live_weight_by_country_by_year.xlsx" ,
30
+ }
You can’t perform that action at this time.
0 commit comments