Skip to main content

Fixes missing imports using Ruff and RipGrep (CLI and import)

Project description

Fixes missing imports using Ruff and RipGrep (CLI and import)

Tested against Windows / Python 3.11 / Anaconda

pip install ruffrgimportfixer

A Python script for adding missing import statements in your Python code. The script utilizes ruff and ripgrep to identify missing imports and organizes them based on various criteria, including the number of errors, the total number of imports, and the length of the import line.

Usage:
    from ruffrgimportfixer import fix_imports
	fix_imports('some_pythonfile.py')
	# or from the commandline ('some_pythonfile.py' as the only arg)

    # or a simple bat file: 
    python -c "from ruffrgimportfixer import fix_imports;fix_imports(r'''%*''')"

    
Dependencies:
    - ruff (https://github.com/astral-sh/ruff)
    - ripgrep (https://github.com/BurntSushi/ripgrep)
	# Both must be in sys.path

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

ruffrgimportfixer-0.11.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

ruffrgimportfixer-0.11-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page