Py-AutoInit VSCode Extension

Overview
Py-AutoInit is a VSCode extension that helps Python developers automatically generate __init__.py
files in your project. It recursively creates import statements for all modules and top-level functions/classes, maintaining clean and organized packages.
With Py-AutoInit, you no longer have to manually update __init__.py
files. It supports both verbose mode (to include top-level functions and classes) and recursive mode (to process all subfolders).
Features
- ✅ Automatically generate
__init__.py
files for Python packages
- ✅ Recursive folder scanning
- ✅ Optional verbose mode to include top-level functions and classes
- ✅ Cross-platform (Linux, macOS, Windows)
- ✅ Right-click context menu integration in VSCode
Installation
From VSCode Marketplace
- Open VSCode.
- Go to Extensions (
Ctrl+Shift+X
).
- Search for Py-AutoInit.
- Click Install.
From VSIX (manual install)
- Download the latest
.vsix
file from Releases.
- In VSCode, go to Extensions → click
...
→ Install from VSIX....
Usage
Generate __init__.py
- In the Explorer, right-click a folder.
- Click Generate init.py.
- Answer the prompts:
Run in verbose mode (Include top-level functions and classes)? Y/N
Run in recursive mode? Y/N
- The extension generates
__init__.py
in the selected folder and subfolders if recursive mode is selected.
Example Output
# Auto-generated __init__.py
from . import process
from .process import process_results
from .process import run_command
from . import utils
from .utils import print_results
from .utils import refine_results
__all__ = [
"process",
"process_results",
"run_command",
"utils",
"print_results",
"refine_results",
]
Configuration
Currently, Py-AutoInit does not require additional configuration. It automatically detects Python packages in your workspace.
Future versions may include:
- Custom ignore patterns
- Automatic
__init__.py
updates on file save
Contributing
We welcome contributions!
- Fork the repository.
- Create a branch:
git checkout -b feature/your-feature-name
.
- Make your changes.
- Test the extension locally using
F5
in VSCode.
- Submit a pull request.
License
MIT License © 2025 Akinus21