chiang01 Claude Opus 4.6 (1M context) commited on
Commit
98b3455
ยท
1 Parent(s): 36ebf14

Add Gradio demo app for HWP to Markdown conversion

Browse files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Files changed (3) hide show
  1. README.md +43 -4
  2. app.py +26 -0
  3. requirements.txt +1 -0
README.md CHANGED
@@ -1,8 +1,8 @@
1
  ---
2
  title: Docpler
3
- emoji: ๐Ÿ 
4
- colorFrom: gray
5
- colorTo: blue
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
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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