6 Python libraries for faster development and debugging

table of contents

  1. Overview
  2. Operating environment
  3. Introducing Python Library
  1. Finally

Overview

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.

Operating environment

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

Python package to introduce

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
bpython1.png

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.

Finally

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

6 Python libraries for faster development and debugging
Install Python and libraries for Python on MacOS Catalina
[For organizing] Python development environment
Python development environment options for May 2020
Emacs settings for Python development environment
Tips for replacing and debugging functions
Python development environment for macOS using venv 2016
Building a Python development environment for AI development
SublimeText2 and SublimeLinter --Syntax check for Python3--
How to install MeCab (v0.996) and libraries for Python without administrator privileges
2016-10-30 else for Python3> for:
python [for myself]
python DS debugging
Roadmap and reference materials for web development self-study
Causal reasoning and causal search with Python (for beginners)
Python development flow using Poetry, Git and Docker
Python debugging tips
Understand Python for Pepper development. -Python box self-made function-
[Python for Hikari] Chapter 09-02 Classes (Creating and instantiating classes)
python development environment -use of pyenv and virtualenv-
[2020 version] Development procedure for personal crawlers and precautions
[Python / Chrome] Basic settings and operations for scraping
PDF files and sites useful for learning Python 3
How to make Python faster for beginners [numpy]
Continuation of multi-platform development with Electron and Python
Understand Python for Pepper development. -Introduction to Python Box-
Rock-paper-scissors poi in Python for beginners (answers and explanations)
Initial settings for using Python3.8 and pip on CentOS8
[Python for Hikari-] Chapter 06-04 Functions (arguments and return value 3)
Extendable skeletons for Vim using Python, Click and Jinja2
Python text reading for multiple lines and one line
I tried pipenv and asdf for Python version control
Directory structure for test-driven development using pytest in python
Building a Docker working environment for R and Python
Benchmark for C, Java and Python with prime factorization
Python netCDF4 read speed and nesting of for statements
[Python for Hikari-] Chapter 07-01 Exception Handling (Errors and Exceptions)
[Python] Output battles and combinations (nesting for statements and if statements)
Preferences for playing Wave in Python PyAudio and PortAudio
Python learning memo for machine learning by Chainer Chapters 1 and 2
Problems and countermeasures for Otsu's binarization overflow in Python
A quick comparison of Python and node.js test libraries
Electron is the best solution for Python multi-platform development
Make Visual Studio Code autocomplete for python external libraries
[Introduction for beginners] Reading and writing Python CSV files
Read and write files with Slackbot ~ Bot development with Python ~
English-English dictionary confrontation for Python and AI related English
[Python for Hikari-] Chapter 06-01 Functions (Intrinsic Functions and Function Definitions)
Compile and install MySQL-python for python2.7 on amazon linux
Manage Python runtime packages and development environment packages with Poetry
Personal best practices for VS Code-fronted Python development environments
About creating and modifying custom themes for Python IDLE
AWS SDK for Python (Boto3) development in Visual Studio 2017
Python # How to check type and type for super beginners
[Python for Hikari-] Chapter 06-03 Functions (arguments and return value 2)
Recursively search for files and directories in Python and output
python memo (for myself): About the development environment virtualenv
[Python] Chapter 01-02 About Python (Execution and installation of development environment)
Set up python and machine learning libraries on Ubuntu
[python] Compress and decompress
About Python for loops