Skip to main content

libhwp

rust로 작성된 python hwp 리더 라이브러리

본 제품은 한글과컴퓨터의 한/글 문서 파일(.hwp) 공개 문서를 참고하여 개발하였습니다.

hwp-rs와 libhwp를 공개합니다

API

find_all

  • hwp
  • hwp.sections[i]
  • hwp.sections[i].paragraphs[i] 등에서 사용할 수 있습니다.

find_all('tag', recursive=Boolean)이며 recursive는 기본적으로 True입니다.

지원되는 tag

  • paragraph: 문단
  • table: 표
  • caption: 캡션
  • equation: 수식
  • footnote: 각주
  • endnote: 미주
  • header: 머리말
  • footer: 꼬리말

예

from libhwp import HWPReader

hwp = HWPReader('<파일 경로>')

# 모든 문단 출력 (표, 캡션 포함)
for paragraph in hwp.find_all('paragraph'):
    print(paragraph)

# 표 내용 출력 (표 안의 표 포함)
for table in hwp.find_all('table'):
    for cell in table.cells:
        for paragraph in cell.paragraphs:
            print(paragraph)

# 표 내용 출력 (표 안의 표 무시)
for table in hwp.find_all('table', recursive=False):
    for cell in table.cells:
        for paragraph in cell.paragraphs:
            print(paragraph)

# 표 안의 표 내용 출력 방법 2
for table in hwp.find_all('table'):
    for cell in table.cells:
        for paragraph in cell.paragraphs:
            print(paragraph)

            # paragraph에서도 recursive 하게 찾을 수 있다
            for p in paragraph.find_all('paragraph'):
                print(p)

# 수식 내용 출력
for equation in hwp.find_all('equation'):
    print(equation.script)  # eg. f(x)= logx+sinx

# 문서에 사용된 파일 저장
for file in hwp.bin_data:
    with open(file.name, 'wb') as f:
        f.write(file.data)

Release files for libhwp 0.2.0

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

Source distribution (sdist)

Source distribution for libhwp 0.2.0
File Size Uploaded
libhwp-0.2.0.tar.gz 3.9 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for libhwp 0.2.0
File
libhwp-0.2.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl PyPy 3.9 PyPy 3.9 7.3 Linux glibc 2.17+ x86-64 Details
libhwp-0.2.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl PyPy 3.8 PyPy 3.8 7.3 Linux glibc 2.17+ x86-64 Details
libhwp-0.2.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl PyPy 3.7 PyPy 3.7 7.3 Linux glibc 2.17+ x86-64 Details
libhwp-0.2.0-cp311-none-win_amd64.whl CPython 3.11 none Windows x86-64 Details
libhwp-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
libhwp-0.2.0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64, macOS 11.0+ ARM64, macOS 10.9+ universal2 (ARM64, x86-64) Details
libhwp-0.2.0-cp310-none-win_amd64.whl CPython 3.10 none Windows x86-64 Details
libhwp-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
libhwp-0.2.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64, macOS 11.0+ ARM64, macOS 10.9+ universal2 (ARM64, x86-64) Details
libhwp-0.2.0-cp39-none-win_amd64.whl CPython 3.9 none Windows x86-64 Details
libhwp-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
libhwp-0.2.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64, macOS 11.0+ ARM64, macOS 10.9+ universal2 (ARM64, x86-64) Details
libhwp-0.2.0-cp38-none-win_amd64.whl CPython 3.8 none Windows x86-64 Details
libhwp-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
libhwp-0.2.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.8 CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64, macOS 11.0+ ARM64 Details
libhwp-0.2.0-cp37-none-win_amd64.whl CPython 3.7 none Windows x86-64 Details
libhwp-0.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Details
libhwp-0.2.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64, macOS 11.0+ ARM64 Details

Total release size: 20.8 MB

Release files / libhwp-0.2.0.tar.gz

Download URL libhwp-0.2.0.tar.gz
Size 3.9 MB
Tags Source
SHA-256 checksum
How to use checksums
b91c4ec99d5f0f032d5600ddbeb4cf24f15d5728eddd72c78677472204c8372b
BLAKE2b-256 checksum
How to use checksums
bf68b5abbc208cb7df26907411f4967c5e5f346edc6133449b06da1a09a45dfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL libhwp-0.2.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags Linux glibc 2.17+ x86-64 PyPy 3.9 PyPy 3.9 7.3
SHA-256 checksum
How to use checksums
5d72c7384af347c4cd1c17e4dfeea64042cdd3fc8cddaad6f4ca75f7291d19ae
BLAKE2b-256 checksum
How to use checksums
7630c70f0dcbe1c48d31bd8af0d0b2922405d6fde2373e44a81291b6a6cea039
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL libhwp-0.2.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags Linux glibc 2.17+ x86-64 PyPy 3.8 PyPy 3.8 7.3
SHA-256 checksum
How to use checksums
3e747980e469cb93f554cf6358f79eaa6fc903148684dd75a7a7050f23d77b5a
BLAKE2b-256 checksum
How to use checksums
4b7ab7ea6104ddd2529819226ebd9ee0a55252e56c33c7bc1ec7c7d08f2571c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL libhwp-0.2.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags Linux glibc 2.17+ x86-64 PyPy 3.7 PyPy 3.7 7.3
SHA-256 checksum
How to use checksums
b2a6ff481b328e8f67f1b794aaf2a5c40993eaadc4b028aa8ba99cd208d94325
BLAKE2b-256 checksum
How to use checksums
bde7308ddbfc7b7fdc98a9a11c3d1625afb73d6824100553c56c1539f02d520a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp311-none-win_amd64.whl

Download URL libhwp-0.2.0-cp311-none-win_amd64.whl
Size 355.3 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
231b73394759458de86d18fe9de4e8192d66db458d3743eb94aa92bdbae5c469
BLAKE2b-256 checksum
How to use checksums
91e0c4e410d2c4ed199de1bef887f9455c84341f3fe3f30d2945be0f9521a0ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL libhwp-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
d09efc06eca77fd4ba31c0fe2827a951f12adf90fc0129622d348fb3d4ba3b2c
BLAKE2b-256 checksum
How to use checksums
e71e41b39c475fb1e0b9fa9970fce2b6eb2b54453b2636e54ad2929b83e3bda5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL libhwp-0.2.0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 922.0 kB
Tags CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0189f2b1130e153161fa9c74713494e7c107e4abea912aa75dec6a4f2d45cc40
BLAKE2b-256 checksum
How to use checksums
b8750fe9675dcbf64e388b263c836ba6d15a014744fe6b5f88e6124b9feeef31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp310-none-win_amd64.whl

Download URL libhwp-0.2.0-cp310-none-win_amd64.whl
Size 355.3 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
2cbb1c6175cda24208a5848c515b44f50c2f036e8e30e1fdb5e9325492bd32dc
BLAKE2b-256 checksum
How to use checksums
ea3c88d739ecd4616538af392246623646224076df266c700e9b76d8bc18d9f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL libhwp-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
afaa5b5757e15a38dd158c73c72290a344b81a7fb433d3e2e2c8a46b1ddf95a2
BLAKE2b-256 checksum
How to use checksums
2ee0cc41d215115bc10cd82a5ee84477c8d307330254488acfbbc39d9778faf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL libhwp-0.2.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 922.0 kB
Tags CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7925367efd88bb5d8abcee362f2c04d838fbecb06c2af1cf526ceba7e5b2de45
BLAKE2b-256 checksum
How to use checksums
e8311f3d30c8c86013ec89e506190ef23f1b5b4075e0edee7137a606a5f708d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp39-none-win_amd64.whl

Download URL libhwp-0.2.0-cp39-none-win_amd64.whl
Size 355.6 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
9bfc650827006fedead591c27f03306cb8450dfc28b7ba012f000c38654b8d8b
BLAKE2b-256 checksum
How to use checksums
a8088c8d115fe8116b055c9d95afed56a345bb2f25a7bab61a866451f060e404
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL libhwp-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
00ed21ac8f184a74256355cc4e940ee0ff0d81308c41f0a38f99d72e7ab9ef2f
BLAKE2b-256 checksum
How to use checksums
bb8b512d7998bc68197ae16cdd64bbf6ff06960ef74ac2ca841faa3a994b0f6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL libhwp-0.2.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 922.9 kB
Tags CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2d28b55ab3333b546d2cbbbd7a43b953685ce31940261baf3c8fd29f475af9b8
BLAKE2b-256 checksum
How to use checksums
07b6c6c4861a1ddea5886942827eece20ddb09768df8a3e24b371d9b4e4a3119
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp38-none-win_amd64.whl

Download URL libhwp-0.2.0-cp38-none-win_amd64.whl
Size 355.7 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
b42e12b59f12d701571760f505e5fc3f5dc2add13e54b61095e0164181899d04
BLAKE2b-256 checksum
How to use checksums
4b9737afaaaac1ae5a9bef33739d89185f2cd2c09ee72843f538b74974bacb96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL libhwp-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cc5011643cb3373a0ec9c813b54f1ced06561ae607a75b4eeede7414093132c4
BLAKE2b-256 checksum
How to use checksums
98e745e68762226e8f2d24d2414499de9a8fbd570b7e94bdf8f284aba16c8309
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL libhwp-0.2.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 922.5 kB
Tags CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0ae8c9f0a5bc563251f2a5bd4d3f80d2dba328677fa84c81012a4a40be92706e
BLAKE2b-256 checksum
How to use checksums
4a85095349f6d3fa299798d91561ac832ba0bad8d3a05a16770eb21ff37efdc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp37-none-win_amd64.whl

Download URL libhwp-0.2.0-cp37-none-win_amd64.whl
Size 355.6 kB
Tags CPython 3.7 Windows x86-64
SHA-256 checksum
How to use checksums
257b13c1f3f22b10ec80613ef410df1c35f15a5c470602558f46d9de214e9850
BLAKE2b-256 checksum
How to use checksums
40d1ff6fa9e0650fe642d5e9e324bf5b2255c180135326090a5341eedb354f89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL libhwp-0.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7d06c281fd1021c674798081cee9784a2df8df4a6086c802cfa0d4302b78ccd1
BLAKE2b-256 checksum
How to use checksums
f92301c6417d7dfefe37d897f92fdcb1225b8cf89b874eae63e726e3d9059d45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release files / libhwp-0.2.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL libhwp-0.2.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 922.6 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0ce37c69239d063e8dd47daae1810673182deb823556cf82d7942de14c034154
BLAKE2b-256 checksum
How to use checksums
de08b454838d53ef41c22d1a0249b7e403b0bb999aa882e2da8540336017791a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.13.7

Release history Release notifications | RSS feed

This release

0.2.0 This release

19 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