I've introduced all the packages that I always install when developing privately from packages that I often use at work. I think that data science people use Jupyter, so I think it is suitable for Web development. There are also dedicated packages that are useful when using web frameworks such as Django, but they are not mentioned in this article. There are famous package management such as Pipenv and poetry, but they are not written in this article.
The operating environment of the author. There should be no environment-dependent package, but just in case.
MacOS Python 3.8.0 anyenv 1.1.1 pyenv 1.2.15-1-g49bf5952
flake8
https://pypi.org/project/flake8/
$ pip install flake8
It is a library that checks whether the code in the project is styled according to the python coding standard "PEP8". It is one of the so-called Linter. Linter has the usual "pep8" and "pyflakes", flake8 has the functions of these two Linters, and you can check the coding more strictly. Therefore, it will be the same code in the sense that anyone can write it, and it will lead to writing code with good visibility.
pyformat
https://pypi.org/project/pyformat/
$ pip install pyformat
It is one of the formatters. It will automatically format your code according to Python's coding conventions. You can spend less time adjusting your coding style and focus on development. It will be powerful when used in combination with flake8. There are other tools such as "autopep8", "yapf", and "black", Choose according to your taste and project. I like the pyformat style and use it.
isort
https://github.com/timothycrosley/isort
$ pip install isort
An automatic formatting tool that specializes in sorting imports.
In python
sample.py
from hogehoge import foo
import sample
Import and use the library as follows. It will automatically sort the order of this import. There is no normal formatter that arranges the import order, so use "isort" to make up for it.
mypy
https://github.com/python/mypy
$ pip install mypy
For large projects, the code becomes difficult to understand in a dynamically typed language like Python. So mypy allows you to specify and check static language-like types.
bpython
https://bpython-interpreter.org/
$ pip install bpython
Code completion with python's interactive shell. Will highlight the letters There is "ipython" which is similar, but I use bpython because it is easy to see.
$ bpython
ipdb
https://pypi.org/project/ipdb/
$ pip install ipdb
By default, python has a debugger tool called "pdb", but it doesn't do code completion or highlighting. Therefore, "ipdb" highlights and complements ipython-like.
You can set breakpoints in your code with set_trace (), and variables etc. declared within the scope of that code will be completed properly.
Collective pip installation
$ pip install flake8 pyfortmat isort mypy bpython ipdb
There are many similar libraries in Python, and it is easy to get lost in selecting a technology. I hope it will be helpful for developing efficiently and comfortably.
The links here are a collection of well-known libraries, so you may want to refer to them.
Awesome Python: Great Python Framework Library Software Resources https://qiita.com/hatai/items/34c91d4ee0b54bd7cb8b
Recommended Posts