Skip to main content

Pythonic HWP(한컴 오피스) automation via win32com — multi-document App.docs, per-Document API, xlwings-inspired facade + 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-3.0.0.tar.gz (206.6 kB view details)

Uploaded Source

Built Distribution

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

hwpapi-3.0.0-py3-none-any.whl (210.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for hwpapi-3.0.0.tar.gz
Algorithm Hash digest
SHA256 654ea61ccc4e1f75118328a29cca54a57e531837c206d37a9da2948c847dc7a6
MD5 f85cabbb578b817b22549914b1a0d5f2
BLAKE2b-256 816ec350e4800c725f8ffd32975c58fca324a9a15ca7d1217306a7f8fe8dd6fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for hwpapi-3.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-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: hwpapi-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 210.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-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d78964d643274fff6a91837116aaeffebd96852e00892b226ef542ecbfa348f6
MD5 621688457016977a96a608f007518060
BLAKE2b-256 04ec0fd5f5db430640917c16f96f918320796188fcd7205b460cd45fe1f48200

See more details on using hashes here.

Provenance

The following attestation bundles were made for hwpapi-3.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