I am the one who asks the question. In fact, the tool the closest to my needs seems to be PythonTidy (it's a Python program of course : Python is best served by himself ;) ).

Answer from candide on Stack Overflow
๐ŸŒ
Code Beautify
codebeautify.org โ€บ python-formatter-beautifier
Python Formatter and Beautifier
Best Python Formatter will help to format, beautify, minify, compact Python code, string, text. Format, Save, Share
๐ŸŒ
Minifier
minifier.org โ€บ python-beautifier
Python Beautifier - Format & Beautify Python Code Online
Python beautifier is a free online tool that automatically formats messy, unindented, or hard-to-read Python code into a clean, consistent format. It follows PEP8, the official Python style guide, to ensure best practices in code readability.
๐ŸŒ
Vercel
black.vercel.app
Black Playground
Playground for Black, the uncompromising Python code formatter.
๐ŸŒ
Formatter.org
formatter.org โ€บ python-formatter
Python Formatter Online โ€“ Beautify and Format Python Code
Beautify and format Python code online to improve readability, fix indentation, and keep formatting consistent.
๐ŸŒ
Pythonium
pythonium.net โ€บ domicile โ€บ python formatter
Python beautifier
February 12, 2024 - Python version for formatter ... How to format your code? Nothing could be simpler to beautify your python code, just put it in the editor and click on the โ€œformatโ€ button....
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ online_python_formatter.htm
Online Python Formatter | Tutorialspoint
Online Python Formatter and Beautifier - Try online Python Code formatter and beautifier and Editor to beautify and format Python code using jQuery Plug-in
Find elsewhere
๐ŸŒ
GitHub
github.com โ€บ psf โ€บ black
GitHub - psf/black: The uncompromising Python code formatter ยท GitHub
Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting.
Author ย  psf
๐ŸŒ
Pyrfecter
pyrfecter.com โ€บ format-python-code
Format Python code online ยท Pyrfecter
June 26, 2025 - If you have Python code you want to format online, look no further. Pyrfecter is an easy and secure way to format, lint, and improve your Python code all from inside your browser. Even if your code is well written Pyrfecter can help.
๐ŸŒ
Astral
docs.astral.sh โ€บ ruff โ€บ formatter
The Ruff Formatter | Ruff
The Ruff formatter is an extremely fast Python code formatter designed as a drop-in replacement for Black, available as part of the ruff CLI via ruff format.
๐ŸŒ
Testmuai
testmuai.com โ€บ home โ€บ free tools โ€บ python formatter & beautifier online
Python Formatter & Beautifier Online | TestMu AI
Struggling with messy Python Formatter & Beautifier Online scripts? Our Python Formatter & Beautifier Online tool provides clean and structured formatting. Beautify your code and Improve readability today!
๐ŸŒ
CleanCSS
cleancss.com โ€บ python-beautify
Python Viewer, Formatter, Editor
Enter your messy, minified, or obfuscated Python into the field above to have it cleaned up and made pretty. The editor above also contains helpful line numbers and syntax highlighting. There are many option to tailor the beautifier to your personal formatting tastes.
๐ŸŒ
Visual Studio Code
code.visualstudio.com โ€บ docs โ€บ python โ€บ formatting
Formatting Python in VS Code
November 3, 2021 - Note: If you don't find your preferred formatter listed above, you can add support via an extension. The Python Extension Template makes it easy to integrate new Python tools into VS Code.
๐ŸŒ
Encode64
encode64.com โ€บ home โ€บ formatters โ€บ python formatter
Free Online Python Formatter โ€“ Black & PEP 8 Style Code Beautifier | Encode64
Clean up your Python code in one click with a Black-style formatter. This online tool enforces consistent indentation, spacing and line length so your scripts, APIs and notebooks stay readable, reviewable and PEP 8โ€“friendly.
๐ŸŒ
ExtendsClass
extendsclass.com โ€บ python-formatter.html
Python formatter online
This Online Python formatter allows to easily format unformatted or ugly Python code.
๐ŸŒ
DeepSource
deepsource.com โ€บ blog โ€บ python-code-formatters
Python code formatters โ€ข DeepSource
November 2, 2020 - Let these tools automate style formatting for your Python code.
๐ŸŒ
Codeformatting
codeformatting.com โ€บ python
Free online python code formatter - Format and beautify code.
At codeformatting.com, our Python formatter instantly beautifies your scripts, correcting indentation, spacing, and styling based on best practices.
๐ŸŒ
Beautifier
beautifier.io
Online JavaScript beautifier
Chrome, in case the built-in CSS ... CSS Code beautifier by c7sky, โ€” jsbeautify-for-chrome by Tom Rix (github), โ€” Pretty Beautiful JavaScript by Will McSweeney โ€” Stackoverflow Code Beautify by Making Odd Edit Studios (github). Firefox: Javascript deminifier by Ben Murphy, to be used together with the firebug (github), ... Sublime Text 2/3: CodeFormatter, a python plugin by ...
๐ŸŒ
Better Programming
betterprogramming.pub โ€บ simple-hacks-to-automate-python-code-beautification-5ad934cf5a29
4 Python Packages to Beautify and Format Your Codebases
January 9, 2022 - 4 Python Packages to Beautify and Format Your Codebases Automate clean up of your Python code Have you ever come across a poorly written piece of Python code? Iโ€™m talking about a tangled mess where โ€ฆ