Skip to content

[FEATURE] pycln as module #231

@LimaBD

Description

@LimaBD

I didn't find a way to use pycln as a module, it would be good if there was a way, (at least for me).

Illustrative example of this feature:

from pycln import remove_unused_imports

code = """
from os import path
import sys

a = 1
b = 2
c = a + b

print(c)
"""

modified = remove_unused_imports(code)

print(modified)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions