Query Vietnamese law documents
Project description
Current support documents:
- Bộ luật dân sự 2015
- Bộ luật hình sự 2015
- Bộ luật lao động 2019
- Bộ luật hàng hải Việt Nam 2015
- Bộ luật tố tụng dân sự 2015
- Bộ luật tố tụng hình sự 2015
Installation
git clone https://github.com/Th1nhNg0/law-query
cd law-query
python -m venv .env
source .env/bin/activate
# make sure you are using the latest pip
python -m pip install -U pip setuptools wheel
pip install --no-build-isolation --editable .
Usage
from lawquery import Engine, list_documents
# list of document paths
document_paths = list_documents()
print(document_paths)
# create engine
engine = Engine(filepath=document_paths[0])
# print info of document
print(engine)
# print outline tree
engine.print_tree()
# query
# node_type: root,phần,chương,mục,điều,khoản,điểm
# node_id: '1','2','I','II','nhất','hai','a','b'...
results = engine.query(node_type='điều', node_id='1')
results = engine.query( node_id='1')
results = engine.query( node_type='phần')
results = engine.query( name='hôn nhân')
# query by path: from parent to child
# param is list of dict, the parameter of engine.query function
results = engine.query_by_path([
{
'node_type': 'phần',
'node_id': 'hai'
},
{
'node_type': 'chương',
'node_id': 'I'
},
{
'node_type': 'mục',
'node_id': '1'
},
{
'node_type': 'điều',
'node_id': '50'
}
])
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
lawquery-0.0.2.tar.gz
(1.1 MB
view details)
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 lawquery-0.0.2.tar.gz.
File metadata
- Download URL: lawquery-0.0.2.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9f4c4b0ea9ca3ee0e783d1053a16a2685278445af750839f08d929ea5536636
|
|
| MD5 |
3e58a3be9dcd44776849f885f5b32a3f
|
|
| BLAKE2b-256 |
f9243343b785ca49f0aa3b2f0e66eae7373b38eee11ae8fd56c3c0b4a72a128f
|
File details
Details for the file lawquery-0.0.2-py3-none-any.whl.
File metadata
- Download URL: lawquery-0.0.2-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24250b630d940ac271d3934cfd5b1e2158837b5c4f6fd1132ef578a3e119c0ef
|
|
| MD5 |
702c994d085586cda35b2cc43305bcdf
|
|
| BLAKE2b-256 |
50447cd609026e0b785c07230fdf8c8377d9ab9763f00d1b0d31d61351dc4bd2
|