The Urban Dictionary is an amazing resource for english language lovers; It features the accurate definitions of words, not like other services like Wikipedia, Oxford, etc. ๐
In this project your are going to build a terminal based (CLI) dictionary.
Clone this repository locally (git clone <project url>
) or open it with Gitpod by clicking here (recomended):
Note: The project requires Python 3.8 and pipenv (python package manager), if you open it with Gitpod you are ok but localhost users will need to install manually.
Install the application dependencies by typing (only once):
1$ pipenv install
Run the application by typing (every time):
1$ pipenv run python app.py
input("What term do you want to look for?")
python function.Let's supposed that we are looking for the definition of the word computer
The API specification says that you have to do a GET request to the following URL:
1url = "https://mashape-community-urban-dictionary.p.rapidapi.com/define?term=computer"
Don't forget to add the headers
with the API credentials, please refer to the API example in the documentation.
The following requirements are not mandatory but you can try completing them if you feel confident:
dict
.sys.argv
to allow the user to ask for a definition like this:1# "enjoy" is the word the user is looking up the definition 2$ pipenv run python app.py enjoy
Hint: how to use the sys.argv