Toolkit for working with NSW CaseLaw decisions
Project description
nswcaselaw
A Python toolkit for downloading and extracting textual data from the NSW CaseLaw website at https://www.caselaw.nsw.gov.au/
Usage
Sample usage in Python code or a Jupyter notebook:
from nswcaselaw.search import Search import json query = Search(courts=[13], catchwords="succession") for decision in query.results(): decision.fetch() print(json.dumps(decision.values, indent=2))
CLI tool
To generate a CSV of search results:
nswcaselaw --courts 13 --catchwords succession --output cases.csv
To download complete decisions as JSON documents:
nswcaselaw --courts 13 --catchwords succession --output cases.csv --download ./decisions
To list available courts and tribunals (NOTE: full web scraping is only tested on Supreme Court decisions):
nswcaselaw --list courts nswcaselaw --list tribunals
Installation
Follow the instructions at https://docs.conda.io/projects/conda/en/latest/user-guide/install/download.html to install Conda.
To create a conda environment with Jupyter and nswcaselaw:
conda create -n mycaselaw jupyter conda activate mycaselaw pip install nswcaselaw
Once the dependencies are installed:
jupyter notebook
will start Jupyter and open a browser. Any notebooks you create in this will be able to import the nswcaselaw module as shown above:
from nswcaselaw.search import Search
To install nswcaselaw without Jupyter, follow the same steps to install Conda, and then create a new environment as follows:
conda create -n mycaselaw conda activate mycaselaw pip install nswcaselaw
You should now be able to use the nswcaselaw command from a terminal (on Mac or Linux) or the Anaconda prompt (on Windows).
Acknowledgements
This project is partially funded by a 2022 University of Sydney Research Accelerator (SOAR) Prize awarded to Ben Chen.
Note
This project has been set up using PyScaffold 4.3. For details and usage information on PyScaffold see https://pyscaffold.org/.
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
Hashes for nswcaselaw-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fbd36868e58bc19a2166c2686fc328aa1cac8d34049d67589287d1e83df0ed9 |
|
MD5 | 9cab4900f8bacf9ffbf3415b8832f06d |
|
BLAKE2b-256 | f8a9fd87e5f77ef433542ba7282cd296a27a2cb43e38723f02a4d6a231dc479b |