A library for searching Tunisian court cases from the public judicial repository e-justice.tn.
Project description
Court Case Search
A Python library for searching Tunisian court cases.
Installation
You can install the library using pip:
pip install court_case_search
Usage
Here's a basic example of how to use the library:
from tun_justice import CourtCaseSearcher, Tribunal
searcher = CourtCaseSearcher()
results = searcher.search(tribunal=Tribunal("محكمة ناحية باردو"), annee="2023", numero="10737")
if results:
for case in results:
print(f"Case Number: {case.numero_dossier}")
print(f"Subject: {case.sujet}")
print(f"Type of Case: {case.type_de_case}")
print(f"Type of Affair: {case.type_affaire}")
print("Details:")
for detail in case.details:
print(f" - Date: {detail.date}")
print(f" Action: {detail.action}")
print(f" Phase: {detail.phase}")
print(f" Text: {detail.text}")
print("---")
else:
print("No results found or an error occurred.")
API Reference
CourtCaseSearcher
The main class for searching court cases.
Methods:
__init__(self, log_level: int = logging.INFO): Initialize the searcher with an optional log level.search(self, tribunal: str, annee: str, numero: str) -> Optional[List[CourtCase]]: Search for court cases based on the provided parameters.
CourtCase
A dataclass representing a court case.
Attributes:
tribunal: str: The tribunal code.type_de_case: str: The type of the case.numero_dossier: str: The case number.annee: str: The year of the case.sujet: str: The subject of the case.type_affaire: str: The type of affair.details: List[CaseDetail]: A list of detailed actions related to the case.
CaseDetail
A dataclass representing detailed information about a specific action in a court case.
Attributes:
phase: str: The phase of the action.action_number: str: The number of the action.action: str: The description of the action.date: str: The date of the action.text: str: Additional text related to the action.
Error Handling
The search method returns None if an error occurs during the search process. It's recommended to check if the result is not None before processing it.
Logging
The library uses Python's built-in logging module. You can set the log level when initializing the CourtCaseSearcher:
import logging
from tun_justice import CourtCaseSearcher
searcher = CourtCaseSearcher(log_level=logging.DEBUG)
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 tun_justice-0.1.0.tar.gz.
File metadata
- Download URL: tun_justice-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f87489ce6f31c73299bee39c83505fb4a5d8eb343e46520c1aebc6f6f49ddf5b
|
|
| MD5 |
8445febbab9f361c36489f983eaf92ad
|
|
| BLAKE2b-256 |
da263c4d705028f9caa211a5e1e4581e72b95e0f64fe45e3900ab6ae339c2599
|
File details
Details for the file tun_justice-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tun_justice-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdcfdc0de6f7f6fa900f6c6ded014448cb624fb6ed40262b5e12428550a108de
|
|
| MD5 |
edd0d4589a22d06d4ecf0d51050abd0a
|
|
| BLAKE2b-256 |
86bff981f6906238bf322cee1467feccacc3ebe691b73a3b091d5a03a5de0547
|