No project description provided
Project description
Nepal Constitution 2072 Document Chunker
nepal-const-doc-chunker
is a Python package for chunking the Nepal Constitution 2072 PDF document. It segments the document into preamble, articles, and schedules, providing structured access to different parts of the constitution.
Features
- Document Segmentation: Splits the constitution into preamble, articles, and schedules.
- Metadata-Rich Output: Each segment is represented as a dictionary with section names as keys and the corresponding text as values.
- Configurable Verbosity: Option to control the verbosity of the output.
Installation
Install the package via pip:
pip install nepal-const-doc-chunker
Usage
Here's an example of how to use the package to chunk the Nepal Constitution 2072:
from nepal_const_doc_chunker import chunk_nepal_constitution
chunks = chunk_nepal_constitution(
pdf_file_path="path_to_pdf/Nepal_Constitution_2072.pdf",
verbose=True)
# Access the structured output
for chunk in chunks:
print(f"Section: {list(chunk.keys())[0]}")
print(f"Content: {list(chunk.values())[0]}")
Arguments
file_path: Path to the PDF file of the Nepal Constitution 2072.
verbose: Boolean flag to control verbosity (default: False).
Output
The function returns a list of dictionaries. Each dictionary contains:
A key representing the section title (e.g., 'Preamble', 'Article Part Title', 'Schedule Title').
A value containing the corresponding text for that section.
Example output:
[
{"Preamble": "Text of the preamble..."},
{"Article Part Title 1": "Text of Article 1..."},
{"Schedule 1": "Text of Schedule 1..."}
]
Contributing
Contributions are welcome! Feel free to submit issues or pull requests via GitHub.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file nepal_const_doc_chunker-0.4.0.tar.gz
.
File metadata
- Download URL: nepal_const_doc_chunker-0.4.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac0bcf1bb1012ccbbb2734afd918297cec60ba0103f48de7bda234f74df596b8 |
|
MD5 | 0fa4da27d2e9363ad8a0545bb41d2bca |
|
BLAKE2b-256 | a009966699e16a785fc2d16b864709da43ae5a5a74760088acd95621a0b8e0eb |
File details
Details for the file nepal_const_doc_chunker-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: nepal_const_doc_chunker-0.4.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc4fe40916bd40ac7d3103e95adeb4b2a00f545a3258f24910dfe5e3bcd196e1 |
|
MD5 | 77678f9d9ebcae6cc3f0cad0129ef012 |
|
BLAKE2b-256 | 47a8b4cd2a97bd202f5ac9b198fa152d2f5153bec5095773f3f80cdc311b039f |