pyantiword
A Python wrapper for antiword with the antiword binary and data files bundled for easy use in any environment.
Features
- Bundles the
antiwordbinary and required data files - No external dependencies or system requirements
- Simple Python interface to extract text from
.doc(Microsoft Word) files
Installation
pip install pyantiword
Usage
from pyantiword.antiword_wrapper import extract_text
# Extract text from a .doc file
text = extract_text("path/to/document.doc")
print(text)
Requirements
- Python 3.6+
- No external dependencies
How it works
This package includes the antiword binary and its required data files. When you install pyantiword, everything you need is included—no need to install antiword separately.
Building and Publishing
To be able to build, for now, the build_antiword.sh script only only guaranteed to work on Ubuntu, with Python 3.6 and above.
In the future, we might make this more stable with a mandatory virtual environment step, or a docker container.
To build and publish pyantiword to PyPI, follow these steps:
1. Build the antiword binary
Before packaging, ensure the antiword binary and data files are present by running:
./build_antiword.sh
2. Install build tools
If you haven't already, install the required Python packaging tools:
pip install --upgrade build twine
3. Build the package
This will create both a source distribution and a wheel in the dist/ directory:
python -m build
4. Publish to PyPI
Upload the package to PyPI using Twine:
twine upload dist/*
You will need a PyPI account and your credentials to complete this step. Your credentials being, most likely, your API token.
Note:
Always ensure the antiword binary and data files are up-to-date in the pyantiword/ directory before building the package.
License
Author
Vitor Hugo Moreira Reis
Links
Metadata
Release files for pyantiword 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyantiword-0.1.2.tar.gz | 144.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyantiword-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 353.1 kB
Release files / pyantiword-0.1.2.tar.gz
| Download URL | pyantiword-0.1.2.tar.gz |
|---|---|
| Size | 144.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e64b1994b4e059ed8bbf25b49880df4d761e515a3b6fa0934023d325cb33eb3
|
|
BLAKE2b-256 checksum How to use checksums |
91ac42b884dfc042459cb056172b39afe005c9f17f9a85fdd608e6e8518f52f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / pyantiword-0.1.2-py3-none-any.whl
| Download URL | pyantiword-0.1.2-py3-none-any.whl |
|---|---|
| Size | 208.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da2f8810f14b4f48ca7fd95e8580cb057b0a30147b4f33bb48d12f0a97069b6b
|
|
BLAKE2b-256 checksum How to use checksums |
4872319d8589e8f93e654bcbb26d8b5391767f4ef347681bb90467adee191dc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|