The ulit
package provides utilities to work with legal data in a way that legal informatics practitioners can focus on addding value.
It is highly recommended to use Poetry as a dependency manager. To install the ulit
package using Poetry, follow these steps:
- Set up a Poetry environment by running the following command in your terminal:
poetry init
poetry shell
- Add the
ulit
package as a dependency in yourpyproject.toml
file by running the following command:
poetry add ulit
Alternatively, you can install the ulit
package in the environment of your choice by using pip by running the following command in your terminal:
pip install ulit
SPARQL metadata retrieval is currently supported only from the Publications Office SPARQL endpoint based on the CELEX identifier.
from ulit.sparql import send_sparql_query
response = send_sparql_query(sparql_query_filepath, celex=None)
Replace "sparql_query_filepath"
with the actual path to your SPARQL query file and "celex"
with the desired celex identifier.
from ulit.download import download_documents
download_documents(results=response, download_dir='desired_downloadpath', log_dir='desired_log_dir'format='xhtml')
The ulit package has been inspired by a series of previous packages and builds upon some of their architectures and workflows. We would like to acknowledge the following sources that have contributed to the development of this generic solution:
- The eu_corpus_compiler repository by Selja Seppala concerning the methods used to query the CELLAR SPARQL API and WEB APIs
- The implementation of the Akoma Ntoso parser made in the SORTIS project repository