A Python CLI tool that finds all third-party packages imported into your Python project

Overview

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 <EXTRA_FILE_PATHS>  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.

You might also like...
Rust numeric library with R, MATLAB & Python syntax

Peroxide Rust numeric library contains linear algebra, numerical analysis, statistics and machine learning tools with R, MATLAB, Python like macros. W

Rust crate to create Anki decks. Based on the python library genanki

genanki-rs: A Rust Crate for Generating Anki Decks With genanki-rs you can easily generate decks for the popular open source flashcard platform Anki.

Locality Sensitive Hashing in Rust with Python bindings

lsh-rs (Locality Sensitive Hashing) Locality sensitive hashing can help retrieving Approximate Nearest Neighbors in sub-linear time. For more informat

Python package to compute levensthein distance in rust

Contents Introduction Installation Usage License Introduction Rust implementation of levensthein distance (https://en.wikipedia.org/wiki/Levenshtein_d

Pyxirr - Rust-powered collection of financial functions for Python.
Pyxirr - Rust-powered collection of financial functions for Python.

PyXIRR Rust-powered collection of financial functions. PyXIRR stands for "Python XIRR" (for historical reasons), but contains many other financial fun

Robust and Fast tokenizations alignment library for Rust and Python
Robust and Fast tokenizations alignment library for Rust and Python

Robust and Fast tokenizations alignment library for Rust and Python

A high performance python technical analysis library written in Rust and the Numpy C API.

Panther A efficient, high-performance python technical analysis library written in Rust using PyO3 and rust-numpy. Indicators ATR CMF SMA EMA RSI MACD

Rust-port of spotify/annoy as a wrapper for Approximate Nearest Neighbors in C++/Python optimized for memory usage.

Rust-port of spotify/annoy as a wrapper for Approximate Nearest Neighbors in C++/Python optimized for memory usage.

Rust-port of spotify/annoy as a wrapper for Approximate Nearest Neighbors in C++/Python optimized for memory usage.

Fareast This library is a rust port of spotify/annoy , currently only index serving is supported. It also provides FFI bindings for jvm, dotnet and da

Comments
  • 'Path must be a directory' error on Windows

    'Path must be a directory' error on Windows

    Hi,

    On Windows 10, when I run the following:

    third-party-imports gPython\gremote.py
    

    I get the following:

    error: invalid value 'gPython\gremote.py' for '<PROJECT_ROOT>': Path must be a directory
    

    This also happens if I try with forward-slash (as in Linux) or the with the full path.

    Thanks!

    enhancement 
    opened by gilbh 2
Releases(v0.0.7)
  • v0.0.7(Jan 31, 2023)

    What's Changed

    • Add --project-root CLI Option by @saadmk11 in https://github.com/saadmk11/python-third-party-imports/pull/3
    • Add --extra-file-paths Option by @saadmk11 in https://github.com/saadmk11/python-third-party-imports/pull/4

    New Contributors

    • @saadmk11 made their first contribution in https://github.com/saadmk11/python-third-party-imports/pull/3

    Full Changelog: https://github.com/saadmk11/python-third-party-imports/compare/v0.0.6...v0.0.7

    Source code(tar.gz)
    Source code(zip)
  • v0.0.6(Jan 17, 2023)

  • v0.0.5(Jan 16, 2023)

Owner
Maksudul Haque
Software Engineer, Python, Django, Open Source Contributor.
Maksudul Haque
Msgpack serialization/deserialization library for Python, written in Rust using PyO3, and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

Aviram Hassan 139 Dec 30, 2022
Turn your webcam into a face-detector with Rust, onnxruntime and actix_web!

InferCam ONNX Turn your webcam into a face detector with Rust, onnxruntime and the lightweight ultraface network. Overview Images are captured from th

null 4 May 10, 2022
Compile your WebAssembly programs into SPIR-V shaders

wasm2spirv - Compile your WebAssembly programs into SPIR-V shaders Warning wasm2spirv is still in early development, and not production ready. This re

Alex Andreba 18 Jul 25, 2023
Are all senior engineers busy? Ask senior instead!

Senior Are all senior engineers busy? Ask senior instead! How to install Requires: openssl a openAI api token rust cargo install senior or brew insta

Bruno Rucy Carneiro Alves de Lima 6 Aug 7, 2023
Your one stop CLI for ONNX model analysis.

Your one stop CLI for ONNX model analysis. Featuring graph visualization, FLOP counts, memory metrics and more! ⚡️ Quick start First, download and ins

Christopher Fleetwood 20 Dec 30, 2022
🔭 interactively explore `onnx` networks in your CLI.

nnli Interactively explore onnx networks in your CLI. Get nnli ?? From Cargo cargo install nnli From Github git clone https://github.com/drbh/nnli.git

drbh 18 Nov 27, 2023
An NVIDIA SMI'esk GPU Monitoring tool for your terminal.

NVTOP An NVIDIA SMI'esk GPU Monitoring tool for your terminal. art by stable-diffusion + Maz Contents: usage prerequisites installation why troublesho

Jer 17 Oct 14, 2023
m2cgen (Model 2 Code Generator) - is a lightweight library which provides an easy way to transpile trained statistical models into a native code

Transform ML models into a native code (Java, C, Python, Go, JavaScript, Visual Basic, C#, R, PowerShell, PHP, Dart, Haskell, Ruby, F#, Rust) with zero dependencies

Bayes' Witnesses 2.3k Dec 31, 2022
💣 SMH – a computer vision project for automatic, precision mortar strike calculations in Squad

?? Squad Mortar Helper (SMH) SMH is a computer vision toy project aimed at automating mortar calculations in the game Squad Download demo.mp4 Requirem

William 18 Dec 26, 2022
SlintDotnet is a C# bindings project to enable developers to use Slint UI with .NET C#

SlintDotnet (Alpha) Slint is a UI toolkit that supports different programming languages. SlintDotnet is the integration with .NET C#. ⚠️ This is exper

Matheus Castello 9 Oct 2, 2023