13 Python Tools That Every Developer Should Know
By: Mikhail Raevskiy
Tags: Python, Web Development, Software Development, Data Science, Programming

When you are just starting to learn Python, someone may explain to you that you can add your source folder to the PYTHONPATH environment variable, and then your code can be imported from other directories. Very often, the explainer forgets to say that, in most cases, this is a bad idea.

Some people find this on the Internet; others know it from their own experience. But too many people (especially inexperienced programmers) think that there are no other alternatives.

Even if you know there is an alternative; it is not always easy to get used to and start using it. Python tools are confusing because there is a lot of software built on top of one another, with a ton of overlap and problems that come with it. It is not easy to understand how to use these tools correctly in your project.

For this reason, I decided to write this article and touch on the most popular tools in it, figure out when and where they are used and what tasks they solve. I will try to explain as easily as possible how to use each of these tools. If the tool is on this list, then you, as a pythonist, need to at least know about its existence. I will only talk about those tools that can be applied to any project or workflow, and you should keep them in mind when you start a new project. However, this does not mean that you should use all the presented tools in every project. It is unnecessary to overload the project with tools because, in some cases, this can overcomplicate it.

❗ Essential Python Tools ❗

1. Setuptools

Setuptools is the standard and most common way to create packages in Python. It works anywhere and does its job well. For example, by setting up a single setup.py file, you can easily create local Python packages that you can install with pip and even publish them to PyPi so you can install them elsewhere by:

pip install <your_package_name>

What It Gives: generally for creating .egg, .zip, or wheel files from the source, defining metadata for your project, collaborative structured, and standardized work on the code.

When It’s Used: Anytime you write code that needs to run on someone else’s machine.

Alternatives: Poetry and Flit

2. Virtualenv

Virtualenv is a virtual environment manager. Sandboxes like these are stand-alone python with a specific set of pre-installed packages. Using virtualenv means you don’t need to install packages in the python default system.

What It Gives: separation of dependencies, support of different versions of python with one system, easy movement of dependencies.

When It’s Used: You need to write code, and this requires a version of python different from your default python system version.

Alternatives: heavy-duty things like Docker or Singularity containers.

3. Pip

Pip is the most common package manager in Python that you’ve definitely heard of. It allows you to install local or remote packages into your virtual environment or Python system. Also, pip has a lot of nice features like installing a package in developer mode with the pip -e option or producing a list of installed packages including their version by pip freeze > requirement.txt . However, if you need to handle package dependencies for your project, things can get messy here, so this is why, for my projects, I prefer to use Poetry.

What It Gives: installing and removing packages, tracking the versions of packages that you are using.

When It’s Used: Pretty much always.

Alternatives: mentioned Poetry or Conda