core
core copied to clipboard
Fix code related to import statements with isort
The fix was done in a virtual Python environment:
pip install isort
isort .
It orders the import statements and fixes their formatting.
I think the Python code should follow the PEP 8 style guide.
This pull request supports the intoduction of coding guidelines for the OCR-D code where using isort should be part of.
The same kind of fixes will be necessary for all Python based OCR-D processors as well.
Using flake8 would be a next step. That tool currently reports 14257 issues for core, so the required changes are huge.
Tools which can help getting cleaner Python code: https://github.com/life4/awesome-python-code-formatters.
https://github.com/OCR-D/format-converters/pull/25 shows how PEP 8 style issues can be fixed.