No project description provided
Project description
Numbering
목표: python-docx랑 호환가능한 para_idx별 번호매기기를 모듈화
HowTo:
- docx파일에서 table을 제거
- Libreoffice를 이용해 txt로 변경
- 각 줄 별로 매치해 비교한다.
- 비교한 값이 다르다 특히 왼쪽에 있는 값이 추가되어 있다 하면 그걸 번호매기기로 인식.
- 번호매기기 타입이 어떤지 분석하고 결과물을 리턴
- 가능하다면 library로 만들어서 install 해서 사용할 수 있게 만든다
[What it can do]
Former word-processor processing libraries often fail to extract numbering info properly. Numbering can extract numbering infos and store it by each document You can use it with python-docx library
[How to use it]
from numbering import DocNumberingExtractor
num = DocNumberingExtractor('NH_전담중개업무계약서.docx')
print(num.numbering_data)
from docx import Document
doc = Document('NH_전담중개업무계약서.docx')
## if 7th paragraph has missing numbering You can combine numbering info like this!
seventh_txt = doc.paragraph[7].text
seventh_numbering = num.numbering_data['numbering']
final_text = seventh_numbering + seventh_txt
[Result]
output= { 9: { 'num_type': 'decimalEnclosedFullstop', 'num': 1, 'numbering': '1.', 'is_decimal': True }, 10: { 'num_type': 'decimalEnclosedFullstop', 'num': 2, 'numbering': '2.', 'is_decimal': True }, }
[dependancies] libreoffice 엔진 필요
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file numbering-0.1.5.tar.gz.
File metadata
- Download URL: numbering-0.1.5.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62ad7a0d6560ec6c58889275d98d3a5c875676709a9126f1ffceadfe192225ad
|
|
| MD5 |
0d6d1f56e381c9ab65eb48ac3a7bfc7e
|
|
| BLAKE2b-256 |
357411fe1f6d7b78d1515a422250ff009197a5bea16f36f4a61865d8d187ec29
|
File details
Details for the file numbering-0.1.5-py3-none-any.whl.
File metadata
- Download URL: numbering-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
640d876349f186004eb56021b2fb28af69a56c2797aad26b1ea78ea472bb93f1
|
|
| MD5 |
935fcab894e66d4912dd2e880bac472d
|
|
| BLAKE2b-256 |
5480db4294ad4850cd4c351faceb8862baab2eaf3d824dc17d60745460f7a888
|