iscan: What are your dependencies?
Ever wondered which dependencies your Python project relies on? iscan gives you a clear view of all the third-party packages and standard library modules your project uses.
Installation
iscan can be installed using either conda or pip.
$ conda install iscan -c conda-forge
$ python -m pip install iscan
Quick start
Simply provide the path to your project. That's it!
Here's an example of running iscan on a local clone of the popular HTTP library requests; these are all the third-party packages and standard library modules requests relies on, along with their respective import counts.
$ iscan ./requests/ # Executed at the top level of the requests repo
--------------------------
Third-party packages
--------------------------
NAME COUNT
urllib3 27
chardet 3
cryptography 2
idna 2
OpenSSL 1
certifi 1
simplejson 1
--------------------------
Standard library modules
--------------------------
NAME COUNT
collections 6
sys 6
os 4
io 3
time 3
urllib 3
warnings 3
...
Dependencies
iscan is light-weight and doesn't rely on anything outside the standard library. The core scanning functionality is built on top of the ast module.
Usage
iscan provides both a command line interface and a Python API.
Command line interface
Basic usage requires simply providing the path to the directory you wish to scan.
$ iscan path/to/dir
The following optional parameters are available
-xallows a directory and its content to be excluded during scanning--ignore-std-libleaves standard library modules out of the report--alphabeticalsorts the report alphabetically; the default is to sort on import count, in descending order
As a concrete example, the following invocation will report third-party packages imported across all Python files in the requests/ directory, in alphabetical order; everything in tests/ will be ignored, as will standard library modules.
$ iscan ./requests/ -x ./tests/ --ignore-std-lib --alphabetical
--------------------------
Third-party packages
--------------------------
NAME COUNT
OpenSSL 1
certifi 1
chardet 3
cryptography 2
idna 2
simplejson 1
urllib3 27
The complete help message can be accessed as follows.
$ iscan --help
Python API
The Python API exposes a run function that returns the scanning result and import count in the form of two Counter objects, split between third-party packages and standard library modules.
>>> from iscan import run
>>> dir_to_scan = './requests'
>>> dir_to_exclude = './tests' # Use None to not exclude anything (default)
>>> third_party, std_lib = run(dir_to_scan, dir_to_exclude)
>>> from pprint import pprint
>>> pprint(third_party)
Counter({'urllib3': 27,
'chardet': 3,
'idna': 2,
'cryptography': 2,
'simplejson': 1,
'certifi': 1,
'OpenSSL': 1})
>>> pprint(std_lib)
Counter({'collections': 6,
'sys': 6,
'os': 4,
'time': 3,
'warnings': 3,
'io': 3,
'urllib': 3,
...})
Metadata
Release files for iscan 0.4.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iscan-0.4.6.tar.gz | 12.9 kB | Without provenance | Details for iscan-0.4.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iscan-0.4.6-py3-none-any.whl | Python 3 | none | any | Details for iscan-0.4.6-py3-none-any.whl |
Total release size: 27.2 kB
Release files / iscan-0.4.6.tar.gz
| Download URL | iscan-0.4.6.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce406dab533b13220661ee3538a6d7087767abae8cb3d0beca81d478c4e58620
|
|
BLAKE2b-256 checksum How to use checksums |
5b20ccab85af9ba21374069f645cef5b759bb321424bbf7ddb48769f5e2430a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / iscan-0.4.6-py3-none-any.whl
| Download URL | iscan-0.4.6-py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddb65e264831c1817f30b2acd8c8460687a22b0190f3deaaf413ec0345f58fcd
|
|
BLAKE2b-256 checksum How to use checksums |
3c42434f2cb7bb79a732f9354b1d7637e74c4dfc35051387afb1aa6944f16826
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for iscan 0.4.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.