Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saadmk11/python-third-party-imports
A Python CLI tool (Written in Rust) that finds all third-party packages imported into your Python project
https://github.com/saadmk11/python-third-party-imports
cargo cli cli-app import maturin package pip python python-rust python3 rust rust-lang rust-python rustlang
Last synced: 23 days ago
JSON representation
A Python CLI tool (Written in Rust) that finds all third-party packages imported into your Python project
- Host: GitHub
- URL: https://github.com/saadmk11/python-third-party-imports
- Owner: saadmk11
- License: mit
- Created: 2023-01-15T15:41:51.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-31T15:24:42.000Z (almost 2 years ago)
- Last Synced: 2024-04-29T19:06:23.793Z (6 months ago)
- Topics: cargo, cli, cli-app, import, maturin, package, pip, python, python-rust, python3, rust, rust-lang, rust-python, rustlang
- Language: Rust
- Homepage: https://pypi.org/project/third-party-imports/
- Size: 61.5 KB
- Stars: 38
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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.
```console
pip install third-party-imports
```# Usage
### Run:
**Check a directory:**
```console
third-party-imports path/to/project/dir
```**Check a directory with extra files:**
```console
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:**
```console
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:
```console
Find all third-party packages imported into your python project.Usage: third-party-imports [OPTIONS]
Arguments:
Path to a file or directory to checkOptions:
-p, --project-root Path to the project's root directory
-e, --extra-file-paths Extra file paths to check
-h, --help Print help
-V, --version Print version
```# Example
```console
third-party-imports examples/
```**Output:**
```console
Found '4' third-party package imports in '5' files. (Took 920.50µs)celery
django
pandas
requests
```# Development
### Run using Cargo
```console
cargo +nightly run -- path/to/project/dir
```### Code Format
```console
cargo +nightly fmt
```### Run Tests
```console
cargo +nightly test
```### Install Package in current `virtualenv`
```console
maturin develop
```# License
The code in this project is released under the [MIT License](LICENSE).