main

find_similar_to(source: str, accuracy: int, max: int)

Returns similar images to source in reponse to api GET request. Access using /api/similar_to/<string:source>/<int:accuracy>/<int:max>

Parameters
  • source (str) – SQL index or filename of ImageEntity

  • accuracy (int) – Only return recommendations with greater certainty than accuracy. Ranges from 0 to 100.

  • max (int) – Maximum number of ImageEntity to return

Returns

JSON - {List[Dict[str,str]]} - list of sql rows as json.

getIndex()

Returns index.html when Flask is queried at /

Returns

HTML file - PATH_STATIC/dist/index.html

get_images()

Returns all rows in database. Access using /api/images

Returns

JSON - {List[Dict[str,str]]} - list of sql rows as json.

redirect(path)

Redirects GET requests to dist folder. Ex: favicon.ico -> PATH_STATIC/dist/favicon.ico.

Parameters

path (str) – path to file inside dist folder

Returns

file at path

redirect_images(quality: str, filename: str)

Returns Image with filename

Parameters
  • quality (str) – raw returns original, else return compressed

  • filename (str) – image filename

Returns

Image file using send_from_directory

search(query: str, columns=searchColumns)

Returns SQL rows that contain query in passed columns.

Access using /api/search/<string:query>

Parameters
  • query (str) – value to search in database

  • columns (List[str]) – database columns to search inside. Defaults to searchColumns global variable.

Returns

JSON - {List[Dict[str,str]]} - list of sql rows as json.

upload()