This is a simple Python based Flask REST API that maps the GET endpoint for job scrapping from Indeed.com. This endpoint is used by the Front End Workshop to build a web-application that displays job listings.
PackHacks Hacker Guide: How to install Python
Although any text editor will technically work, I'd recommend one that has some tools to help us write Python.
- Visual Studio Code is an open-source code editor created by Microsoft. It's the editor I use throughout.
- Atom is a free and open-source text editor developed by GitHub. You can install a package like atom-beaufity to help format your code.
Postman is a platform for API development and testing that I will be using to show that our work is actually working while in development! Please signup for Postmand and download it. If you are intersted in API development, this is a very powerful tool. Download Here
We would recommend creating a personal repo for this project. We have a template repo that we are providing to you, which has a directory structure that is also recommended for you to follow.
If you would not like to use a GitHub repo, you are free to use a local directory with a similar directory structure.
Clone this template repo. Please DO NOT CLONE TO THE SAME DIRECTORY FROM ABOVE as this will make it hard to work on the next part!
From your initial project directory, open a terminal window (I'm using the integrated terminal in VSCode).
Run these commands:
mkdir backend
cd backend
mkdir jobsearcher
cd jobsearcher
mkdir api
Run these commands:
mkdir jobsearcher
cd jobsearcher
mkdir api
cd
to the api
directory you just made.
I always create a virtual environment called env in my project directory, so let's do that now:
python -m venv env
To activate the virtual environment:
- On Unix-based OSs:
source env/bin/activate
- On Windows:
env\Scripts\activate
You will be welcomed by (env)
in front of your console line. To leave the virtual environment, type exit
in the console.
To successfully create a working REST API we need some libraries! Libraries are pre-compiled code that allows developers to expand the functionality of their code past the pure language, in our case Python. We will be installing 4 libraries into our virtual environment.
These libraries are as follows:
To install these into our virtual environment:
- Make sure your virtual environment is running.
- Run this command
pip install requests flask python-dotenv beautifulsoup4
- This will take some time but the libraries will be installed.