panoptisch
0.1.7
PANOPTISCH掃描您的Python文件或模塊以找到其導入(又稱依賴項),並遞歸地對所有依賴性和亞依賴性。然後,它在JSON中生成一個依賴樹,以供您解析和執行導入策略。通過模仿Python的進口系統來解決進口。除了導入模塊以查找其源文件的位置外,它完全是靜態的。 Panoptisch還具有最小的沙箱,以防止導入依賴關係時副作用。請注意,沙箱不是萬無一失的!
此階段存在已知的局限性和問題。在使用Panoptisch之前,請閱讀此內容。
請參閱: LIMITATIONS.md鏈接。
我找不到Python的適當依賴掃描儀。 Panoptisch誕生了,需要準確驗證整個項目的依賴用法。
它的目的是生成一個可以解析和評估以主張進口政策的JSON報告。
例如,您可能需要將os , socket , sys和importlib導入到選定的軟件包中。
Panoptisch ,這很重要! pip install panoptisch
usage: panoptisch <module>
positional arguments:
module Name of module or file you wish to scan.
options:
-h, --help show this help message and exit.
--show-stdlib-dir Prints the automatically resolved stdlib directory.
--max-depth MAX_DEPTH
Maximum dependency depth.
--out OUT File to output report.
--auto-stdlib-dir Ignore stdlib modules by automatically resolving their path. MAY BE BUGGY. Try running panoptisch <module_name> --show-stdlib-dir to see the directory before using this.
--stdlib-dir STDLIB_DIR Ignore stdlib modules by providing their path.
--omit-not-found Do not include modules that could not be resolved in report.
--no-sandbox Ignore the minimal sandbox implementation.
典型的運行可能是
$ panoptisch <module or file> --max-depth 5 --omit-not-found
$ more out.json
--show-stdlib-dir爭論來查看Panoptisch是否可以自動解決您的標準庫目錄,通常是/usr/local/lib/python3.x Linux安裝上。那麼您可以使用 $ panoptisch <module or file> --auto-stdlib-dir
如果PANOPTISCH無法自動解決您的標準庫目錄,則可以自己找到它,並作為stdlib-dir的參數提供
$ panoptisch <module or file> --stdlib-dir /the/path/to/your/standardlibrary/
所有工作均根據GNU通用公共許可證3版獲得許可。
反饋,貢獻和問題歡迎。