Metadata-Version: 2.4
Name: auto-docx
Version: 1.0.0
Summary: A tool to execute Python scripts and log their output to Word documents
Author-email: Krishna Aggarwal <krishnaaggarwal@example.com>
License: MIT
Project-URL: Homepage, https://github.com/example/auto-docx
Project-URL: Documentation, https://github.com/example/auto-docx#readme
Project-URL: Repository, https://github.com/example/auto-docx
Keywords: automation,documentation,word,docx,script,logging
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: python-docx>=0.8.11
Requires-Dist: nbformat>=5.9.0
Requires-Dist: nbclient>=0.10.0
Requires-Dist: pillow>=10.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: flake8>=6.0; extra == "dev"

# Auto-DOCX

A professional Python tool that executes Python scripts and automatically logs their output to formatted Word documents.

## Features

- ✅ Execute any Python script and capture its output
- ✅ Capture both stdout and stderr
- ✅ Generate professional Word documents with monospaced formatting
- ✅ Include script source code in the document (optional)
- ✅ Proper error handling and exit codes
- ✅ Command-line interface with flexible options

## Installation

### From source

```bash
# Clone the repository
cd AUTO_DOCX

# Install in development mode
pip install -e .

# Or install dependencies directly
pip install -r requirements.txt
```

## Usage

### Basic Usage

```bash
# Using the installed command
auto-docx path/to/your_script.py

# Or run directly with Python
python -m auto_docx path/to/your_script.py
```

### Command-Line Options

```bash
auto-docx <script_path> [options]

Arguments:
  script_path           Path to the Python file to execute

Options:
  -o, --output PATH     Custom output path for the Word document
  --include-source      Include the script's source code in the document
  --timeout SECONDS     Timeout for script execution (default: 300)
  -v, --verbose         Enable verbose output
  -h, --help            Show help message
```

### Examples

```bash
# Basic execution
auto-docx my_script.py

# Custom output location
auto-docx my_script.py -o results/output.docx

# Include source code and verbose output
auto-docx my_script.py --include-source -v

# Set a timeout of 60 seconds
auto-docx my_script.py --timeout 60
```

## Output Format

The generated Word document includes:

1. **Header** - Document title with timestamp
2. **Script Information** - File path and execution details
3. **Source Code** (optional) - The script's source code
4. **Execution Output** - stdout captured from the script
5. **Error Output** (if any) - stderr captured from the script
6. **Execution Summary** - Return code and execution status

All code sections use **Courier New** monospaced font for proper formatting.

## Project Structure

```
AUTO_DOCX/
├── pyproject.toml      # Project configuration and dependencies
├── requirements.txt    # Dependencies list
├── README.md          # This file
└── src/
    └── auto_docx/
        ├── __init__.py    # Package initialization
        ├── main.py        # Entry point and CLI
        ├── executor.py    # Script execution logic
        └── document.py    # Word document generation
```

## License

MIT License - See LICENSE file for details.
