convert_module_to_init
Convert a Python module file into a package by moving it to init.py, preserving the import path to allow splitting into multiple files later.
Instructions
Convert a module file into a package by moving it to init.py.
Transforms foo.py into foo/__init__.py. No import changes needed
since the import path stays the same!
Example:
views/customer_order.py becomes views/customer_order/__init__.py
Import from views.customer_order import X stays unchanged.
This is the recommended way to convert a module to a package when you want to later split it into multiple files.
Args: project_path: Root directory of the Python project module_path: Path to module file (relative to project_path), e.g. "app/views/foo.py"
Returns: JSON with success status and new path
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| module_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |