The MkInit Module

A tool to autogenerate explicit top-level imports

Read the docs

https://mkinit.readthedocs.io

Github

https://github.com/Erotemic/mkinit

Pypi

https://pypi.org/project/mkinit

Autogenerates __init__.py files statically and dynamically. To use the static version simply pip install and run the mkinit command with the directory corresponding to the package.

The main page for this project is: https://github.com/Erotemic/mkinit

Quick Start

Install mkinit via pip install mkinit. Then run:

MOD_INIT_PATH=path/to/repo/module/__init__.py
mkinit "$MOD_INIT_PATH"

This will display autogenerated code that exposes all top-level imports. Use the --diff option to check differences with existing code, and add the -w flag to write the result.

Package Layout

Indices and tables