Panoptisch는 Python 파일 또는 모듈을 가져와 가져 오기 (일명 종속성)를 찾아 모든 종속성 및 하위 의존성에 대해 재귀 적으로 수행합니다. 그런 다음 JSON에서 수입 정책을 구문 분석하고 시행 할 수 있도록 종속성 트리를 생성합니다. 수입은 Python의 가져 오기 시스템을 모방하여 해결됩니다. 소스 파일의 위치를 찾기 위해 모듈 가져 오기 외에 완전히 정적입니다. Panoptisch는 또한 종속성을 가져올 때 부작용을 방지하기 위해 최소한의 샌드 박스를 갖추고 있습니다. 샌드 박스는 완벽하지 않습니다!
이 단계에는 알려진 한계와 문제가 있습니다. Panoptisch를 사용하기 전에 이것을 읽으십시오.
다음을 참조하십시오. LIMITATIONS.md 링크.
파이썬에 대한 적절한 종속성 스캐너를 찾을 수 없었습니다. 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 Arthuement를 사용하여 panoptisch가 Linux 설치에서 표준 라이브러리 디렉토리, 일반적으로 /usr/local/lib/python3.x 자동으로 해결할 수 있는지 확인하십시오. 그런 다음 사용하여 제외 할 수 있습니다 $ panoptisch <module or file> --auto-stdlib-dir
Panoptisch가 표준 라이브러리 디렉토리를 자동으로 해결할 수없는 경우 직접 찾아 stdlib-dir 에 대한 인수로 제공 할 수 있습니다.
$ panoptisch <module or file> --stdlib-dir /the/path/to/your/standardlibrary/
모든 작업은 GNU 일반 공개 라이센스 버전 3에 따라 라이센스가 부여됩니다.
피드백, 기여 및 문제를 환영합니다.