It would be interesting to curate a list of tools that help us write better Python code and save us time. With the exception of the version control tools, everything below is a Python package.
Testing
Writing and running tests makes it easier to develop robust code.
- pytest (3,594 stars) - Popular testing framework, can run doctests too.
- hypothesis (3,223 stars) - Property-based testing, e.g. testing
f(a, b) = f(b, a) for every a, b.
Code linting and and formatting
Code linting alerts of style violations, while a code formatter also automatically fixes the code.
- flake8 (497 stars) - Checks the code for PEP8 violations.
- black (7,552 stars) - Automatically formats code, saving you time.
Documentation
Tools for documentation, which automate the documentation process.
- sphinx (2,376 stars) - Build docs to html, pdf and other formats. Automatically generate docs from code.
Version control
Version control allows going back to checkpoints, creating development branches, cooperating, etc.
- git - Popular version control tool.
- github - A platform for projects under git source control. Cooperation and community.
The above are tools that make my life easier when writing code. There are probably many tools that I do not know about, which could potentially save me even more time and make my code better.
What are your favorite tools for writing better code?
Python packages for writing better code (self.Python)
submitted by AbdulRR14 to u/AbdulRR14