autopep8 will auto formats Python module files following Pep8 code style conventions.

It is a sort of beautifier as in the JavaScript world.

pip3 install autopep8

Project: https://github.com/hhatto/autopep8

autopep8 --in-place --aggressive --aggressive ttpv_bilingual.py

pylint

pylint is a lint tool.

pip3 install pylint

We can generate a default configure as a starting point. Edit and move it to the home directory: ~/.config/pylintrc

pylint --generate-rcfile > pylintrc  

I disabled these msg C0114,C0103,C0116, under [MESSAGES CONTROL] session:

[MESSAGES CONTROL]  
...  
  
disable=raw-checker-failed,  
        bad-inline-option,  
        locally-disabled,  
        file-ignored,  
        suppressed-message,  
        useless-suppression,  
        deprecated-pragma,  
        use-symbolic-message-instead,  
        C0114,  
        C0103,  
        C0116,  
          
# p added   
# C0103: Variable name "n" doesn't conform to snake_case naming style (invalid-name)  
# C0116: Missing function or method docstring (missing-function-docstring)  
# W1514: Using open without explicitly specifying an encoding (unspecified-encoding)  
# C0114: Missing module docstring (missing-module-docstring)  
  
...

Documentation

To generate pylint’s full documentation, in reST format:

pylint --full-documentation > pylint.reST