black
The uncompromising Python code formatter (by psf)
yapf
A formatter for Python files (by google)
Our great sponsors
black | yapf | |
---|---|---|
204 | 9 | |
27,262 | 12,525 | |
2.1% | 0.8% | |
9.5 | 8.3 | |
6 days ago | 24 days ago | |
Python | Python | |
MIT License | Apache License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
black
Posts with mentions or reviews of black.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-05-12.
-
Didn't get the job, code review please
Code linting/formatters + good practices: flake8, black , isort,... BONUS do this on pre-commit BONUS BONUS set black to run when you save a file 🤩
- 1000Words — easily share your data analysis, directly from Jupyter
- a web based youtube downloader I built
-
Can someone explain to me what's wrong with this code?
A good idea to have https://github.com/psf/black run on save =)
-
Prettier keeps breaking lines!!
Prettier doesn't support Python so you must be using something else. Maybe you are using black?
- Suomalaisia, yleishyödyllisiä avoimen lähdekoodin projekteja haussa
-
Black formatter - Ignore specific multi-line code
np.array( [ [1, 0, 0, 0], [0, -1, 0, 0], [0, 0, 1, 0], [0, 0, 0, -1], ])# Will be formatted tonp.array([[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, 1, 0], [0, 0, 0, -1]]) I found this issue in black github, but that only works for inline command, which is not what I have here.
-
RegEx, Data Classes and Type Hints with Python: Learning from tweet text
I've found many bugs with the help of mypy since I started using it two years ago, so let's make our project a bit better. Let's apply black and isort also. Here's the script to evaluate our project:
-
Can this code be made faster, or is this a job for a super computer?
Is a much better name and clearly expresses intent. https://github.com/psf/black Is a linter we run over our code to make sure it is formatted correctly.
-
dethklok: The most uncompromising Python code formatter ever!
Looks like it hasn’t been touched in 2 years. Just use black.
yapf
Posts with mentions or reviews of yapf.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-03-07.
- On 4/20 I started '100 Days of Python: Beginner to Pro' to learn my first coding language. Here is my day 11 Project: Blackjack
-
From Python to Dart - Day 2, Meet the dart CLI
When working with several people on one project, it is very often necessary to use a single style of code design, writing comments, using variable names, etc. In the Python world, we use linters flake8, various formatters (black, yapf, autopep8) and mypy for type checking. How can Dart help meet these challenges?
-
How to Audit the Quality of Your Python Code: A Step-by-Step Guide (Checklist Inside)
Yapf—a Python formatter.
-
Formatting Code with Black
A little shoutout to a alternative Python formating tool https://github.com/google/yapf (developed by Google).
The built in "facebook style" formating felt by far the most natural to me.
-
Black, the Uncompromising (Python) Code Formatter Is Stable
Have been a long time user of yapf along with isort, yapf is way less opionated and its been good till now. https://github.com/google/yapf
-
Code Quality Tools in Python
YAPF (Yet Another Python Formatter) is Google's official python formatter which follows google's style guide. The documentation is easy to understand the installation and configuration for this formatter.
-
Sunday Daily Thread: What's everyone working on this week?
You could also try yapf - it's slower to run but has more customization options. I would recommend it if you dislike how black formatting looks, but it may take some time to figure out the customization options you like. Also if you're on a team that likes to argue about style, then you may find yourself arguing about yapf configuration instead!
-
[HELP][Tabs] Automatically select intent character based on file.
Or simply fix the python files by executing a fixer upon them, no need to even use Vim. I use yapf
-
Python: Setting Up Project Environment
Black is the uncompromising Python code formatter provided by the Python Software Foundation. An alternative to black is yapf, distributed by Google. Both tools have their own strengths and weaknesses, but in my personal opinion, black is a bit easier to use.
What are some alternatives?
When comparing black and yapf you can also consider the following projects:
autopep8 - A tool that automatically formats Python code to conform to the PEP 8 style guide.
prettier - Prettier is an opinionated code formatter.
isort - A Python utility / library to sort imports.
Pylint - It's not just a linter that annoys you!
autoflake - Removes unused imports and unused variables as reported by pyflakes
mypy - Optional static typing for Python
awesome-python-typing - Collection of awesome Python types, stubs, plugins, and tools to work with them.
pycodestyle - Simple Python style checker in one Python file
flake8
bandit - Bandit is a tool designed to find common security issues in Python code.