Spaces:
Running
Running
Add Gradio demo app for HWP to Markdown conversion
Browse filesCo-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- README.md +43 -4
- app.py +26 -0
- requirements.txt +1 -0
README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
---
|
| 2 |
title: Docpler
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 6.11.0
|
| 8 |
app_file: app.py
|
|
@@ -11,4 +11,43 @@ license: mit
|
|
| 11 |
short_description: Convert HWP (Korean word processor) documents to Markdown
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Docpler
|
| 3 |
+
emoji: ๐
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 6.11.0
|
| 8 |
app_file: app.py
|
|
|
|
| 11 |
short_description: Convert HWP (Korean word processor) documents to Markdown
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# docpler
|
| 15 |
+
|
| 16 |
+
Convert HWP documents to Markdown.
|
| 17 |
+
|
| 18 |
+
HWP is a document format used by [Hancom Office](https://www.hancom.com/), the most widely used word processor in South Korea โ commonly found in government, legal, and academic documents.
|
| 19 |
+
|
| 20 |
+
- High-performance Rust core
|
| 21 |
+
- HWP 5.0 format support (tables, equations, text boxes)
|
| 22 |
+
- [MarkItDown](https://github.com/microsoft/markitdown) plugin available
|
| 23 |
+
|
| 24 |
+
## Links
|
| 25 |
+
|
| 26 |
+
- [PyPI - docpler](https://pypi.org/project/docpler/)
|
| 27 |
+
- [PyPI - markitdown-hwp](https://pypi.org/project/markitdown-hwp/)
|
| 28 |
+
- [GitHub](https://github.com/docpler/docpler-python)
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
# ํ๊ตญ์ด
|
| 33 |
+
|
| 34 |
+
HWP(ํ๊ธ ์๋ํ๋ก์ธ์) ๋ฌธ์๋ฅผ Markdown์ผ๋ก ๋ณํํฉ๋๋ค.
|
| 35 |
+
|
| 36 |
+
- Rust ์ฝ์ด ๊ธฐ๋ฐ์ ๋น ๋ฅด๊ณ ์ ํํ ํ์ฑ
|
| 37 |
+
- HWP 5.0 ํฌ๋งท ์ง์ (ํ, ์์, ๊ธ์์)
|
| 38 |
+
- [MarkItDown](https://github.com/microsoft/markitdown) ํ๋ฌ๊ทธ์ธ ์ง์
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## License
|
| 43 |
+
|
| 44 |
+
MIT
|
| 45 |
+
|
| 46 |
+
- Python wrapper: open source (MIT)
|
| 47 |
+
- Rust core engine: distributed as compiled binary, source code is private.
|
| 48 |
+
|
| 49 |
+
## HWP Format Notice
|
| 50 |
+
|
| 51 |
+
This product was developed with reference to the HWP document file (.hwp) specification published by [Hancom](https://www.hancom.com/etc/hwpDownload.do).
|
| 52 |
+
|
| 53 |
+
๋ณธ ์ ํ์ ํ๊ธ๊ณผ์ปดํจํฐ์ ํ๊ธ ๋ฌธ์ ํ์ผ(.hwp) ๊ณต๊ฐ ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํ์ฌ ๊ฐ๋ฐํ์์ต๋๋ค.
|
app.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from docpler.hwp import convert
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def hwp_to_markdown(file):
|
| 6 |
+
if file is None:
|
| 7 |
+
return ""
|
| 8 |
+
return convert(file.name)
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
demo = gr.Interface(
|
| 12 |
+
fn=hwp_to_markdown,
|
| 13 |
+
inputs=gr.File(label="Upload HWP file / HWP ํ์ผ ์
๋ก๋", file_types=[".hwp"]),
|
| 14 |
+
outputs=gr.Textbox(label="Markdown output / Markdown ๊ฒฐ๊ณผ", lines=20, show_copy_button=True),
|
| 15 |
+
title="docpler โ HWP to Markdown",
|
| 16 |
+
description=(
|
| 17 |
+
"Convert HWP (Korean word processor) documents to Markdown. "
|
| 18 |
+
"Powered by a high-performance Rust parser.\n\n"
|
| 19 |
+
"HWP(ํ๊ธ ์๋ํ๋ก์ธ์) ๋ฌธ์๋ฅผ Markdown์ผ๋ก ๋ณํํฉ๋๋ค. "
|
| 20 |
+
"Rust ๊ธฐ๋ฐ์ ๋น ๋ฅด๊ณ ์ ํํ ํ์๋ฅผ ์ฌ์ฉํฉ๋๋ค."
|
| 21 |
+
),
|
| 22 |
+
allow_flagging="never",
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
if __name__ == "__main__":
|
| 26 |
+
demo.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
docpler
|