Skip to main content

doc2docx

PyPI

Convert doc to docx on Windows or macOS directly using Microsoft Word (must be installed).

On Windows, this is implemented via win32com while on macOS this is implemented via JXA (Javascript for Automation, aka AppleScript in JS).

Install

Via brew:

brew install cosmojg/tap/doc2docx

Via pipx:

pipx install doc2docx

Via pip:

pip install doc2docx

CLI

usage: doc2docx [-h] [--keep-active] [--version] input [output]

Example Usage:

Convert single doc file in-place from myfile.doc to myfile.docx:
    doc2docx myfile.doc

Batch convert doc folder in-place. Output docx files will go in the same folder:
    doc2docx myfolder/

Convert single doc file with explicit output filepath:
    doc2docx input.doc output.docx

Convert single doc file and output to a different explicit folder:
    doc2docx input.doc output_dir/

Batch convert doc folder. Output docx files will go to a different explicit folder:
    doc2docx input_dir/ output_dir/

positional arguments:
  input          input file or folder. batch converts entire folder or convert
                 single file
  output         output file or folder

optional arguments:
  -h, --help     show this help message and exit
  --keep-active  prevent closing word after conversion
  --version      display version and exit

Library

from doc2docx import convert

convert("input.doc")
convert("input.doc", "output.docx")
convert("my_doc_folder/")

See CLI docs above (or in doc2docx --help) for all the different invocations. It is the same for the CLI and python library.

Jupyter Notebook

If you are using this in the context of jupyter notebook, you will need ipywidgets for the tqdm progress bar to render properly.

pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension

Acknowledgements

Many thanks to @AlJohri for the excellent docx2pdf upon which this is based!

Metadata

Release files for doc2docx 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for doc2docx 0.2.4
File Size Uploaded Provenance Actions
doc2docx-0.2.4.tar.gz 5.9 kB Without provenance Details for doc2docx-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for doc2docx 0.2.4
File Interpreter ABI Platform Actions
doc2docx-0.2.4-py3-none-any.whl Python 3 none any Details for doc2docx-0.2.4-py3-none-any.whl

Total release size: 12.7 kB

Release files / doc2docx-0.2.4.tar.gz

Download URL doc2docx-0.2.4.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3a645892549f9e814a3b938d580a1e391e0d557980b5a0ad5e9574071bb5feae
BLAKE2b-256 checksum
How to use checksums
dc2f86f311a31cb437a2bee53bf8ec19c1ed513a8b65192972c73076335aa487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.11.2 Darwin/22.4.0

Release files / doc2docx-0.2.4-py3-none-any.whl

Download URL doc2docx-0.2.4-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd9b60612ddb4c12383189ee85010a3791bb3056e6ea8bc29fceb2714279f738
BLAKE2b-256 checksum
How to use checksums
9022f4d841443a5b0d7de23514419a559bf91f7c5f9bdbb0cdcedf414637525d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.11.2 Darwin/22.4.0

Security for doc2docx 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page