Skip to main content

A powerful bidirectional converter between DOCX and AsciiDoc formats using Pandoc and Asciidoctor

Project description

aPowerConverter

A powerful bidirectional converter between DOCX and AsciiDoc formats with advanced features.

Features

  • Bidirectional conversion:
    • DOCX → AsciiDoc
    • AsciiDoc → DOCX (new!)
  • Smart document processing:
    • Automatic document ID insertion ([[filename]])
    • Table formatting with [INFO] tags
    • Heading hierarchy normalization (DOCX → AsciiDoc)
    • Section number removal (optional, DOCX → AsciiDoc)
  • Image handling:
    • Automatic image extraction and organization
    • Relative path handling for portability
    • Optional image directory specification
  • Batch processing:
    • Multiple file conversion
    • Directory scanning
    • Recursive subdirectory support
  • User-friendly interface:
    • Progress tracking
    • Color-coded output
    • Detailed logging
    • Dry-run mode

Requirements

Core Dependencies

  • Python 3.7 or higher
  • Pandoc (for all conversions)
  • Asciidoctor (for AsciiDoc → DOCX conversion)

Installation Steps

  1. Install Python dependencies:
pip install aPowerConverter
  1. Install Pandoc:
  1. Install Asciidoctor (required for AsciiDoc → DOCX conversion):
  • Install Ruby first if not present
  • Then run: gem install asciidoctor

Usage

Basic Conversion

Convert DOCX to AsciiDoc:

apowerconverter document.docx

Convert AsciiDoc to DOCX:

apowerconverter document.adoc

Advanced Options

With image extraction:

apowerconverter document.docx -i ./images/

Keep section numbers (DOCX → AsciiDoc):

apowerconverter document.docx -k

Generalize headings (DOCX → AsciiDoc):

apowerconverter document.docx -g

Convert multiple files:

apowerconverter doc1.docx doc2.adoc doc3.docx

Process directory recursively:

apowerconverter ./documents/ -r

Specify output directory:

apowerconverter document.docx -o ./output/

Additional Options

  • --dry-run: Show what would be done without making changes
  • --quiet: Suppress all output except errors
  • --no-color: Disable color output
  • --log-file FILE: Write detailed logs to specified file
  • --verbose: Enable verbose output

Exit Codes

  • 0: Success - All files processed successfully
  • 1: Failure - One or more files failed to process
  • 2: Critical - Missing dependencies or invalid arguments

Examples

Convert a single DOCX file:

apowerconverter mydoc.docx

Convert an AsciiDoc file with images:

apowerconverter mydoc.adoc -i ./images/

Convert all documents in a directory:

apowerconverter ./docs/ -r -i ./images/ -o ./converted/

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the 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

apowerconverter-1.1.3.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

apowerconverter-1.1.3-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file apowerconverter-1.1.3.tar.gz.

File metadata

  • Download URL: apowerconverter-1.1.3.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for apowerconverter-1.1.3.tar.gz
Algorithm Hash digest
SHA256 24da36fef9c9fd42f865146aec6e031fbc4f0f3834357f66c57ae0976a16feed
MD5 33a626daeace843fa869a65594d622ce
BLAKE2b-256 ecb0a45804adfd09442f9f4b8ca74884649298a2978b4a30dc90436a0f3456c6

See more details on using hashes here.

File details

Details for the file apowerconverter-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for apowerconverter-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 18e117b10a8a1be5938e8e1c5c5547beefb8dd0a76974862c0548b59d427854f
MD5 d5896e126b54a74a1b553e2011dde543
BLAKE2b-256 758709ffa8fb3879e9dacbd076922f440a5988bf0c4bd53a8a2485d6e26f7c38

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