Skip to main content

Pythonic HWP(한컴 오피스) automation via win32com — slim App facade + doc.collections + hwpapi.low escape hatch

Project description

hwpapi

PyPI Python License Docs Status

한글(HWP) 자동화를 위한 Pythonic 라이브러리. hwpapi.App 슬림 퍼사드 + app.doc.* 컬렉션 + hwpapi.low.* escape hatch 의 이중 레이어 API.

📖 전체 문서는 JunDamin.github.io/hwpapi — 설치 · 5분 투어 · Guide · Recipes · API Reference · v1 → v2 마이그레이션.


Requirements

  • Windows + 한컴 오피스 설치
  • Python 3.9+
  • pywin32

Install

pip install hwpapi

5분 투어

from hwpapi import App

app = App()                                   # HWP 연결
app.open("report.hwp")

# 컬렉션 — dict-like + iterable + filterable
app.doc.fields["name"] = "홍길동"
app.doc.bookmarks.add("ch1")
for tbl in app.doc.tables:
    print(tbl.caption, tbl.rows, "×", tbl.cols)

# 문단/런
for para in app.doc.paragraphs:
    print(para.style, "|", para.text[:40])

# Escape hatch — 저수준 actions / parametersets / engine
from hwpapi.low import actions, parametersets
char = parametersets.CharShape(app.actions.CharShape.pset)
char.bold = True
actions.CharShape(app).execute(char)

app.save()

더 많은 예제는 Recipes 를 참고하세요.


v1 → v2 변경점

v2 는 public API break 를 허용한 클린컷 릴리즈입니다.

v1.x v2.0
from hwpapi.core import App from hwpapi import App
app.fields[...] app.doc.fields[...]
app.bookmarks, app.images, ... app.doc.bookmarks, app.doc.images, ...
app.charshape = {...} with hwpapi.context.charshape_scope(app, bold=True): ...
app.preset.*, app.template.* (Phase-out — Recipes 페이지에서 레시피 형태로 재공급)
hwpapi.parametersets hwpapi.low.parametersets

전체 매핑 80+ 항목: Migration Guide

v1.x 에 머무르려면 pip install "hwpapi<2" 또는 git checkout v1.x.


기여

License

MIT

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

hwpapi-2.0.0.tar.gz (199.2 kB view details)

Uploaded Source

Built Distribution

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

hwpapi-2.0.0-py3-none-any.whl (202.2 kB view details)

Uploaded Python 3

File details

Details for the file hwpapi-2.0.0.tar.gz.

File metadata

  • Download URL: hwpapi-2.0.0.tar.gz
  • Upload date:
  • Size: 199.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hwpapi-2.0.0.tar.gz
Algorithm Hash digest
SHA256 ed07919aac8d18555429a8c8a5d31415c5ee1dcbbb8f2c769d59ed44539de237
MD5 8d8661106c4358c876519c24827a27f6
BLAKE2b-256 df6b0fffb2f6878a62804178629b8bb8cd0fe3d650c36c44734f3eb742261115

See more details on using hashes here.

Provenance

The following attestation bundles were made for hwpapi-2.0.0.tar.gz:

Publisher: publish.yaml on JunDamin/hwpapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hwpapi-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: hwpapi-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 202.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hwpapi-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91c5e62bdcf1fc68f3862ed55d7b7d22c85596e8bb33ac0903610d6d01b5f5d9
MD5 c4cf78de7c1a357237d2cd7a7ae1a86a
BLAKE2b-256 ed7b472046e042e0ed082ab7266365acefa03ab23765660f7805e3eb424366c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for hwpapi-2.0.0-py3-none-any.whl:

Publisher: publish.yaml on JunDamin/hwpapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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