Skip to main content

Advanced Office Tool

Advanced office document processing toolkit — Word (DOCX), Excel (XLSX), and other formats.

Installation

pip install advanced-office-tool

Usage

Use ServerAgent for all document operations. Import once, call methods on any file path.

from advanced_office_tool import ServerAgent

agent = ServerAgent()

DOCX Translation

result = agent.translate_file(
    "manual.docx",
    target_language="en",       # "en", "zh", "auto", etc.
    target_format="{translated}" # or "{original}" or "{original}{translated}"
)
print(result["output_file_path"])
# → /home/ovos/.hermes/skills/office-tool/uploads/manual_en.docx

DOCX Merge (with auto CRC-32 repair)

from advanced_office_tool import DocxAgent, SafeDocument

# Merge with auto repair for corrupted files
agent = DocxAgent()
agent.load_document("chapter1.docx")
agent.merge_docx(["chapter2.docx", "chapter3.docx"], "merged.docx")

SafeDocument transparently repairs bad CRC-32 ZIP checksums:

from advanced_office_tool import SafeDocument
from docx import Document

# Broken DOCX auto-repairs on first access
doc = SafeDocument("corrupted.docx")
for p in doc.paragraphs:
    print(p.text)

PDF Conversion

# PDF → DOCX
result = agent.pdf_to_docx("scan.pdf")
print(result["content"])

# DOCX → PDF
result = agent.docx_to_pdf("report.docx")
print(result["content"])

# XLSX → PDF
result = agent.xlsx_to_pdf("data.xlsx")
print(result["content"])

# Images → PDF
result = agent.pngs_to_pdf(["img1.png", "img2.png"])
print(result["output_pdf_path"])

# PDF → PNG images
images = agent.pdf_to_png("document.pdf", dpi=300)
print(images)  # ["/path/to/page0.png", ...]

PDF Stamp

result = agent.add_stamp_to_pdf(
    "contract.pdf",
    position="80,80",           # top-right corner
    scale="1.5",                # stamp size multiplier
    stamp_image="./stamp.png"   # stamp image path
)
print(result["output_pdf_after_stamp"])

Excel Price Adjustment

result = agent.adjust_price_in_excel(
    "quote.xlsx",
    price_multiplier="1.3/6.9",  # unit_price * multiplier / divisor
    decimal_places="0"            # round to 0 decimals
)
print(result["output_file_path"])

Template Rendering

result = agent.render_docx_template(
    "template.docx",
    obj={"name": "Company A", "amount": 50000},
    output_path="output.docx"
)

PDF Merge to DOCX (N images per page)

result = agent.merge_pdfs_folder_to_docx_vertical(
    pdf_folder="./invoices",   # folder with PDF files
    number_in_page=2           # 2 PDF pages per DOCX page
)
print(result["output_file_path"])

Unzip

result = agent.uncompress_zip("archive.zip", "mt123456")
print(result["message"])

Available Classes

Class Description
ServerAgent Main orchestrator — PDF, Excel, DOCX, translation, templates
DocxAgent DOCX paragraph/table translation and manipulation
ExcelOperator XLSX merge, formula, style, image manipulation
TranslateAgent pygtrans batch translate with terminology protection
SafeDocument Auto-repair DOCX files with bad CRC-32 checksums
OdooAgent Odoo ERP integration

License

Apache-2.0

Metadata

Release files for advanced-office-tool 1.1.8

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

Source distribution (sdist)

Source distribution for advanced-office-tool 1.1.8
File Size Uploaded
advanced_office_tool-1.1.8.tar.gz 62.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for advanced-office-tool 1.1.8
File Interpreter ABI Platform
advanced_office_tool-1.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 126.3 kB

Release files / advanced_office_tool-1.1.8.tar.gz

Download URL advanced_office_tool-1.1.8.tar.gz
Size 62.0 kB
Tags Source
SHA-256 checksum
How to use checksums
37f16cbc7771ed6d465c0fc13d23385c801372a26ed58d2571ea3d9a645859f5
BLAKE2b-256 checksum
How to use checksums
3a49c041cd91412ee7345804c0dd3a7850e099d8de349f81721c5c9a348252bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / advanced_office_tool-1.1.8-py3-none-any.whl

Download URL advanced_office_tool-1.1.8-py3-none-any.whl
Size 64.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e018f09e4de5f9583cef0d55089c435ba47753ea36148d4f5bda958910f5f85c
BLAKE2b-256 checksum
How to use checksums
0e69fbb385d35bdc8209ed0ed3007a6d93fb23cfc8f0eb5896e1b06a6bd196b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release history Release notifications | RSS feed

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.9

2 release files

This release

1.1.8 This release

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

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