Skip to main content

importlab

Importlab is a library for Python that automatically infers dependencies and calculates a dependency graph. It can perform dependency ordering of a set of files, including cycle detection.

Importlab’s main use case is to work with static analysis tools that process one file at a time, ensuring that a file’s dependencies are analysed before it is.

(This is not an official Google product.)

License

Apache 2.0

Installation

Importlab can be installed from pip

pip install importlab

To check out and install the latest source code

git clone https://github.com/google/importlab.git
cd importlab
python setup.py install

Usage

Importlab is primarily intended to be used as a library. It takes one or more python files as arguments, and generates an import graph, typically used to process files in dependency order.

It is currently integrated into pytype

Command-line tool

Importlab ships with a small command-line tool, also called importlab, which can display some information about a project’s import graph.

usage: importlab [-h] [--tree] [--unresolved] [filename [filename ...]]

positional arguments:
  filename              input file(s)

optional arguments:
  -h, --help            show this help message and exit
  --tree                Display import tree.
  --unresolved          Display unresolved dependencies.

Roadmap

  • Makefile generation, to take advantage of make’s incremental update and parallel execution features

  • Integration with other static analysis tools

Release files for importlab 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for importlab 0.8.1
File Size Uploaded
importlab-0.8.1.tar.gz 28.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for importlab 0.8.1
File Interpreter ABI Platform
importlab-0.8.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size:50.5 kB

Release files / importlab-0.8.1.tar.gz

Download URL importlab-0.8.1.tar.gz
Size 28.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b3893853b1f6eb027da509c3b40e6787e95dd66b4b66f1b3613aad77556e1465
BLAKE2b-256 checksum
How to use checksums
f522ab9494dccf1e237276f98364d53673bc0ab97ebe5cb671e960f18710457d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / importlab-0.8.1-py2.py3-none-any.whl

Download URL importlab-0.8.1-py2.py3-none-any.whl
Size 21.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
124cfa00e8a34fefe8aac1a5e94f56c781b178c9eb61a1d3f60f7e03b77338d3
BLAKE2b-256 checksum
How to use checksums
da1ecc7360b4259f283b1a2de153335ce15ac9e710d66145aa471cffefe4b394
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 release files

0.8

2 release files

0.7

1 release file

0.6.1

1 release file

0.5.1

1 release file

0.5

1 release file

0.4

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page