get_icon
155
156
157@app.get("/icon/{icon}")
158def get_icon(icon: str, response: Response):159 # increase compatibility
160 if ".png" not in icon:
161 icon += ".png"
get_scan
56
57
58@app.get("/ingredients", response_class=JSONResponse)
59def get_scan(url: str, includeCategories: Optional[bool] = False): 60
61 # increase compatibility
62 if url[:4] != "http":
get_docs
51
52
53@app.get("/docs")
54def get_docs(): 55 return RedirectResponse(url="https://github.com/berrysauce/ingredients/blob/main/README.md#-using-the-api", status_code=301)
56
57
get_root
45
46
47@app.get("/", response_class=HTMLResponse)
48def get_root(): 49 with open("pages/api.html", "r") as f:
50 return HTMLResponse(content=f.read())
51
add_ingredient
16def scan(url):
17 matching_ingredients = []
18
19 def add_ingredient(category: str, ingredient: str): 20 if f"{category}/{ingredient}" not in matching_ingredients:
21 matching_ingredients.append(f"{category}/{ingredient}")
22
The module/function docstring is missing.
If you want to ignore this, you can configure this in the .deepsource.toml
file. Please refer to docs for available options.