Skip to content

format streamlit Python files using black #133

@enryH

Description

@enryH

They do not yet have a programmatic API, but the example here should be work: https://github.com/psf/black/issues/779|

import black

black.format_str('import pandas \nimport   numpy', mode=black.FileMode(line_length=90))
# 'import pandas\nimport numpy\n'
  • would need to update default shipped dependencies (also for GUI)

This combined with isort would leave to well formatted output. And prettier for other type of files (e.g. hmtl ones).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions