A lightweight Python linter for checking unused docstrings.
Project description
pymport
About
A lightweight Python linter for checking unused imports
Features
This tool tries to identify unused imports in a single module. This task is not possible to assure a 100% false positive free result due to the possible collateral execution effects when importing a module. This is, importing a module can affect or enable some feature needed somewhere else, so not using anything from that imported package/module does not necessarily mean is not needed.
A minimal typical example could be:
import os.path
print(os.curdir)
Installation
To install pymport using pip, run the following command:
pip install pymport --upgrade
Quick Start
You can run the linter from the CLI using the following syntax:
pymport [FILE] [--help]
| Argument / Option | Description |
|---|---|
[FILE] |
Files or directories to lint. (Need at least one file or dir to check.) |
--help |
Show help message and exit. |
[!TIP] Ignoring Unused Imports
Use a comment like
# noqa: unused-importto ignore the line.
Development
To contribute to the project, you can run the following commands for testing and documentation:
First, ensure you have the latest version of pip:
python -m pip install --upgrade pip
Running Tests
pip install --group=test --upgrade # Install test dependencies, skip if already installed
python -m pytest tests/ # Run all tests
python -m pytest tests/ --cov # Run tests with coverage
Running Linter
pip install --group=lint --upgrade # Install lint dependencies, skip if already installed
ruff check . # Run linter
License
This project is licensed under the MIT license.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymport-0.0.1.tar.gz.
File metadata
- Download URL: pymport-0.0.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f9f059563ec4001f213ab89e9591e156294dcaaa99525e9c7d289351a64c89d
|
|
| MD5 |
259943a6ed7239c075f5e9bab8d693da
|
|
| BLAKE2b-256 |
3ee9e6a773563d225992d3a77ab0a3262d4472415e02feea617c889dec15d7a4
|
File details
Details for the file pymport-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pymport-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f3b54e34412fb86f61255080dcf2a00a977d38fd14633400cadba1c6c6bf5e3
|
|
| MD5 |
590b05281d0010e971600c340fe84f94
|
|
| BLAKE2b-256 |
128cca816a006ec8c2c55565a0433fe7008f090bc9323920cc232ac939a57d33
|