Set Up the Project

First of all, we're going to create a virtual environment within which we'll install all the required dependencies.

Python now ships with the pre-installed venv library. So, to create a virtual environment, you can use the below command:

$ python -m venv env

To activate the virtual environment named env, use the command:

  • On Windows:
env\Scripts\activate.bat
  • On Linux and macOS:
source env/bin/activate

To deactivate the environment (not required at this stage):

deactivate

Now we're ready to install the dependencies. The modules and libraries we are going to use in this project are:

  • requests: Requests allow you to send HTTP/1.1 requests extremely easily. The module doesn't come pre-installed with Python, so we need to install it using the command:
    $ pip install requests
  • bs4: Beautiful Soup(bs4) is a Python library for pulling data out of HTML and XML files. The module doesn't come pre-installed with Python, so we need to install it using the command:
    $ pip install bs4
  • Flask: Flask is a simple, easy-to-use microframework for Python that can help build scalable and secure web applications. The module doesn't come pre-installed with Python, so we need to install it using the command:
    $ pip install flask
  • Flask-RESTX: Flask-RESTX lets you create APIs with Swagger Documentation. The module doesn't come pre-installed with Python, so we need to install it using the command:
    $ pip install flask-restx

We'll also use environment variables in this project. So, we are going to install another module called python-decouple to handle this:

pip install python-decouple

To learn more about environment variables in Python, you can check out this article.

Discussion
@ashutoshkrris Hi ! I Is there any way I can contact you for help. The DM of commudle is not working from my side.

You can DM me on Twitter @ashutoshkrris

I am trying to do the same but I am getting this error "Import "decouple" could not be resolvedPylancereportMissingImports" and I install every package properly

Hi Priyanka Is your code pushed somewhere so that I can see? Are you sure, you've installed python-decouple in your virtual environment?

This is super amazing Ashutosh! You are awesome :)

1

5

3