4Geeks logo
4Geeks logo

Courses

Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.

Coding Bootcamp

Learn live

Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.

Upcoming live events

Learning library

For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Full-Stack Software Developer - 16w

Data Science and Machine Learning - 16 wks

Search from all Lessons


LoginGet Started
← Back to Projects

Create a Dictionary Terminal APP

Goal

4Geeks Coding Projects tutorials and exercises for people learning to code or improving their coding skills

Difficulty

easy

Repository

Click to open

Video

Not available

Solution video

Not available

Average duration

4 hrs

Technologies

  • HTTP

  • Python

    The Command Line

  • APIs

  • http Request

Weekly Coding Challenge

Every week, we pick a real-life project to build your portfolio and get ready for a job. All projects are built with ChatGPT as co-pilot!

Start the Challenge

Podcast: Code Sets You Free

A tech-culture podcast where you learn to fight the enemies that blocks your way to become a successful professional in tech.

Listen the podcast

Urban Dictionary Terminal App

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.

Before you begin

  1. Register a RapidAPI.com account and make your to request a key for the urban dictionary API.
  2. Watch this 15 min video to understand pipenv, the python package manager.
  3. Watch this 10 min video on what are API Keys and credentials.

🌱 Starting the project

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

πŸ“ Features that the application must have

  1. Greet the user
  2. Ask the user for the term he/she wants to look up, use the input("What term do you want to look for?") python function.
  3. Use the python requests package to code your GET request to the Urban Dictionary API

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.

  1. Process the response body, understand it and get the word definition from the incoming response body.
  2. Show the definition on the terminal.
  3. Store the definition in a JSON file.

🀠 Feeling confident?

The following requirements are not mandatory but you can try completing them if you feel confident:

  1. Cache system: If the user asks for the same word again, instead of calling the API again you should have the previous responses stored in a dict.
  2. Look for multiple words separated by comma.
  3. Use 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

Goal

4Geeks Coding Projects tutorials and exercises for people learning to code or improving their coding skills

Difficulty

easy

Repository

Click to open

Video

Not available

Solution video

Not available

Average duration

4 hrs

Technologies

Weekly Coding Challenge

Every week, we pick a real-life project to build your portfolio and get ready for a job. All projects are built with ChatGPT as co-pilot!

Start the Challenge

Podcast: Code Sets You Free

A tech-culture podcast where you learn to fight the enemies that blocks your way to become a successful professional in tech.

Listen the podcast