Skip to main content

A tool to execute Python scripts and log their output to Word documents

Project description

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

# 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

# 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

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

# 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auto_docx-1.0.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auto_docx-1.0.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file auto_docx-1.0.0.tar.gz.

File metadata

  • Download URL: auto_docx-1.0.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for auto_docx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d05652c1f6c81e8853b8863e9eb81bc0b35f01685f14ae335ec90b0ddc7d4db0
MD5 1e56d1019513469c5139156e6cbffad3
BLAKE2b-256 31121f16040215c8f0ff420b5dc8d13275a26502c2491e32cb325ffa09960183

See more details on using hashes here.

File details

Details for the file auto_docx-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: auto_docx-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for auto_docx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad0610d3302653fed41d57ab4954c3dfacffcf4721499c66b0226c57fb2207fa
MD5 5edd37dcd8be2b2416fb16e021ce820e
BLAKE2b-256 765f6b704ed896409961279b8d547aeec3ca00dc0f84665702cf0b62800d8079

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page