Pycln - Unused Import Cleaner

2.6.0 · active · verified Wed Apr 15

Pycln is a fast and efficient code formatter for finding and removing unused import statements in Python code. It helps to keep your codebase clean and reduce unnecessary dependencies. The current version is 2.6.0 and it maintains a relatively frequent release cadence, often aligning with Python version updates and bug fixes.

Warnings

Install

Imports

Quickstart

The primary way to use Pycln is through its command-line interface. Run `pycln .` in your project's root directory to scan and remove unused imports. Use `--check` to preview changes, or `--diff` to see a diff.

# To analyze current directory and remove unused imports:
pycln . 

# To check for unused imports without modifying files:
pycln --check . 

# To include specific files or directories:
pycln my_module.py my_package/

view raw JSON →