Skip to main content

This is a simple library to find the recursive import link of source code

Project description

Python Find imported Module

pip3 install findimport

Example:

findownimportfile

if the source file in /mnt/c/workspace/example/source_code.py

Input:

python3 -m findimport --source source_code.py --path /mnt/c/workspace/ or /mnt/c/workspace/example

Output:

/mnt/c/workspace/example/own_import_find.txt

Input:

python3 -m findimport --source source_code.py --path /mnt/c/workspace/ or /mnt/c/workspace/example --save_text /mnt/c/workspace/imported_file.txt

Ouput:

/mnt/c/workspace/imported_file.txt

$ python3.7

import findimport import_list = findimport.find_own_import(source,path) print(import_list) ['/mnt/c/workspace/example/other_code.py',...]

findownimportfile

python3 -m findimport --source source_code.py --path 'dummystring' --find_all_import

S$ python3.7

import findimport import_list = findimport.find_all_import(source)

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

findimport-0.1.tar.gz (2.6 kB view hashes)

Uploaded source

Built Distribution

findimport-0.1-py2.py3-none-any.whl (2.6 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page