Deploy an API built with Flask on Heroku, in order to match game names with Levenshtein distance.
Data consists of app ids and names from the Steam store (~30k games) downloaded on January 9, 2021.
To create the database of game names in lower case:
python app/file_utils.py
To run locally:
python run.py
To deploy:
heroku login
heroku create
git push heroku main
The web app can be accessed at this URL:
To ask for results about "Cyberpunk 2077", and constrain the response to 10 matches:
https://arcane-springs-42307.herokuapp.com/find/?name="Cyberpunk 2077"&n=10
If you want to make your web app accessible from a Single-Page Application, e.g. written in Svelte, then you will want to specify CORS and rate-limits.
See the cors
branch of my repository for more information.
The Levenshtein distance is not intuitive for the user.
For instance, when looking for "The Witcher 3", which has a longer title on the Steam store, the Levenshtein distance does not return the correct result, because it looks for minimal edit sequences.
I would recommend to try another method such as difflib
,
which looks for the "longest contiguous matching subsequence".