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)
- Automatic document ID insertion (
- 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
- Install Python dependencies:
pip install aPowerConverter
- Install Pandoc:
- Windows: Download from pandoc.org/installing.html
- Linux:
sudo apt-get install pandocor equivalent - macOS:
brew install pandoc
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24da36fef9c9fd42f865146aec6e031fbc4f0f3834357f66c57ae0976a16feed
|
|
| MD5 |
33a626daeace843fa869a65594d622ce
|
|
| BLAKE2b-256 |
ecb0a45804adfd09442f9f4b8ca74884649298a2978b4a30dc90436a0f3456c6
|
File details
Details for the file apowerconverter-1.1.3-py3-none-any.whl.
File metadata
- Download URL: apowerconverter-1.1.3-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18e117b10a8a1be5938e8e1c5c5547beefb8dd0a76974862c0548b59d427854f
|
|
| MD5 |
d5896e126b54a74a1b553e2011dde543
|
|
| BLAKE2b-256 |
758709ffa8fb3879e9dacbd076922f440a5988bf0c4bd53a8a2485d6e26f7c38
|