saadmk11
python-third-party-imports
Rust

A Python CLI tool (Written in Rust) that finds all third-party packages imported into your Python project

Last updated Dec 26, 2024
36
Stars
0
Forks
1
Issues
0
Stars/day
Attention Score
5
Language breakdown
No language data available.
โ–ธ Files click to expand
README

python-third-party-imports

This is a Python CLI tool built with Rust that finds all third-party packages imported into your Python project.

Install

You can install this package via pip.

pip install third-party-imports

Usage

Run:

Check a directory:

third-party-imports path/to/project/dir

Check a directory with extra files:

third-party-imports --extra-file-paths path/to/project/dir/foo.sh path/to/project/dir

Note: You can use --extra-file-paths option to include files that do not contain .py or .pyi extension.

Check a file:

third-party-imports --project-root path/to/project/dir/ path/to/project/dir/foo/main.py

Note: If the file is not located in the project root directory, then you need to use --project-root option to specify where the project root directory is located.

Help:

Find all third-party packages imported into your python project.

Usage: third-party-imports [OPTIONS] <PATH>

Arguments: <PATH> Path to a file or directory to check

Options: -p, --project-root <PROJECT_ROOT> Path to the project's root directory -e, --extra-file-paths <EXTRAFILEPATHS> Extra file paths to check -h, --help Print help -V, --version Print version

Example

third-party-imports examples/

Output:

Found '4' third-party package imports in '5' files. (Took 920.50ยตs)

celery django pandas requests

Development

Run using Cargo

cargo +nightly run -- path/to/project/dir

Code Format

cargo +nightly fmt

Run Tests

cargo +nightly test

Install Package in current virtualenv

maturin develop

License

The code in this project is released under the MIT License.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท saadmk11/python-third-party-imports ยท Updated daily from GitHub