Skip to main content

A tool to automatically replace 'import *' imports with explicit imports in files

Project description

removestar

Build Status

Tool to automatically replace import * imports with explicit imports

Requires pyflakes. Somewhat inspired by autoflake.

Limitations:

  • Only works with relative imports at the moment
  • Does not work correctly with recursive star imports
  • Assumes only names in the current file are used by star imports

Usage

$ removestar file.py # Shows diff but does not edit file.py

$ removestar -i file.py # Edits file.py in-place

$ removestar module/ # Modifies every Python file in module recursively

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

removestar-1.0.1.tar.gz (20.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page