Skip to main content

문서(HWP 3.x, HWP 5.x, HWPX, HWPML, XLSX, XLS, DOCX)를 마크다운으로 변환하는 파서 라이브러리

Project description

Serious KDocument Converter(skdconv)

PyPI version Python versions License

한국 공문서(HWP, HWPX, HWPML, XLS, XLSX, DOCX)를 마크다운으로 변환하는 파서 라이브러리입니다.

지원 포맷

포맷 설명
HWP 3.x 한글 구버전
HWP 5.x 한글 바이너리
HWPX 한글 XML 기반
HWPML 한글 XML 내보내기
XLSX Excel 2007+
XLS Excel 97-2003
DOCX Word 2007+

설치

pip install skdconv

의존성: lxml, olefile, pycryptodome

사용법

라이브러리

import skdconv

with open("문서.hwpx", "rb") as f:
    data = f.read()

result = skdconv.parse(data)

if result.success:
    print(result.markdown)
    print(result.page_count)
else:
    print(result.error, result.code)

ParseOptions

from skdconv import ParseOptions

opts = ParseOptions(
    pages="1-3",               # 페이지/섹션 범위
    remove_header_footer=True, # 머리글/바닥글 제거
)
result = skdconv.parse(data, opts)

ParseSuccess 필드

필드 타입 설명
file_type str 감지된 포맷
markdown str 변환된 마크다운
blocks list[IRBlock] 문서 블록 트리
page_count int | None 페이지 수
metadata DocumentMetadata | None 문서 메타데이터
outline list[OutlineItem] | None 목차
warnings list[ParseWarning] | None 파싱 경고
images list[ExtractedImage] | None 추출된 이미지

CLI

# 마크다운으로 출력
skdconv 문서.hwpx

# 파일로 저장
skdconv 문서.hwpx -o output.md

# 여러 파일을 디렉토리에 저장
skdconv *.hwpx -d output/

# JSON 형식 출력
skdconv 문서.xlsx --format json

# 페이지 범위 지정
skdconv 문서.hwp -p 1-5

# 머리글/바닥글 제거
skdconv 문서.hwpx --no-header-footer

라이선스

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

skdconv-1.0.3.tar.gz (94.4 kB view details)

Uploaded Source

Built Distribution

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

skdconv-1.0.3-py3-none-any.whl (106.0 kB view details)

Uploaded Python 3

File details

Details for the file skdconv-1.0.3.tar.gz.

File metadata

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

File hashes

Hashes for skdconv-1.0.3.tar.gz
Algorithm Hash digest
SHA256 016120527e723035804f70f35bd77dc1996f4ebffcf3ba207809a771f3ce5bfb
MD5 fbeb7dde8e240d53f37fdb283e784169
BLAKE2b-256 e4f09aadf6ed3f5dadc066e1624724b7a0972a9a63640c081fdd394da72f8dda

See more details on using hashes here.

Provenance

The following attestation bundles were made for skdconv-1.0.3.tar.gz:

Publisher: publish.yaml on whitebearhands/serious_kdoc_converter

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

File details

Details for the file skdconv-1.0.3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for skdconv-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 43ad6381a024a474e9ab5fa7d2b623a9fc7e064902357adc284e6753201b2b3a
MD5 5f732bd06a1805fa9925c4143d343500
BLAKE2b-256 f308b1f37feca7467bc10c14efc500007454632b550020d36de04b02ed385818

See more details on using hashes here.

Provenance

The following attestation bundles were made for skdconv-1.0.3-py3-none-any.whl:

Publisher: publish.yaml on whitebearhands/serious_kdoc_converter

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