Package: rechtspraak-extractor
Rechtspraak extractorThis library contains two functions to get rechtspraak data and metadata from the API.VersionPython 3.9ContributorsPranav Bapatrunning-machinPiotr LewandowskishashankmcgijsvdHow to install?pip install rechtspraak_extractorWhat are the functions?Rechtspraak Extractorget_rechtspraakGets all the ECLIs and saves them in the CSV file or in-memory.It gets, ECLI, title, summary, updated date, link.get_rechtspraak_metadataGets the metadata of the ECLIs created by above function and saves them in the new CSV file or in-memory.Link attribute that we get from the above function contains the links of ECLI metadata.It gets instantie, datum uitspraak, datum publicatie, zaaknummer, rechtsgebieden, bijzondere kenmerken, 
    inhoudsindicatie, and vindplaatsenWhat are the parameters?get_rechtspraak(max_ecli=100, sd='2022-05-01', ed='2022-10-01', save_file='y')Parameters:max_ecli: int, optionalMaximum amount of ECLIs to retrieveDefault: 100sd: date, optional, default '2022-08-01'The start publication date (yyyy-mm-dd)ed: date, optional, default current dateThe end publication date (yyyy-mm-dd)save_file: ['y', 'n'], default 'y'y - Save data as a CSV file in data foldern - Save data as a dataframe in-memoryget_rechtspraak_metadatasave_file: ['y', 'n'], default 'y'y - Save data as a CSV file in data foldern - Save data as a dataframe in-memorydataframe: dataframe, optionalDataframe containing ECLIs to retrieve metadata. Cannot be combined with filenamefilename: string, optionalCSV file containing ECLIs to retrieve metadata. Cannot be combined with dataframeExamplesimport rechtspraak_extractor as rex

-----------------------------------------------------------------------------------------------------------------------

# For rechtspraak

# To get the rechtspraak data in a dataframe:
df = rex.get_rechtspraak(max_ecli=100, sd='2022-08-01', save_file='n')  # Gets 100 ECLIs from 1st August 2022

# To save rechtspraak data as a CSV file:
rex.get_rechtspraak(max_ecli=100, sd='2022-08-01', save_file='y') 

-----------------------------------------------------------------------------------------------------------------------

# For rechtspraak metadata

# To get metadata as a dataframe from rechtspraak data (as a dataframe):
df_metadata = rex.get_rechtspraak_metadata(save_file='n', dataframe=df)

# To get metadata as a dataframe from rechtspraak file (as a dataframe):
df_metadata = rex.get_rechtspraak_metadata(save_file='n', filename='rechtspraak.csv')

# To get metadata as a dataframe from rechtspraak data (saved as CSV file):
rex.get_rechtspraak_metadata(save_file='y', dataframe=df)

# To get metadata and save as a CSV file:
rex.get_rechtspraak_metadata(save_file='y', filename='rechtspraak.csv')

-----------------------------------------------------------------------------------------------------------------------

# filename='rechtspraak.csv' - filename.csv is a file from the data folder created by get_rechtspraak method
# dataframe=df - df is a dataframe created by get_rechtspraak method

# Will not get any metadata
df = rex.get_rechtspraak_metadata(save_file='n')

# Will get the metadata of all the files in the data folder
rex.get_rechtspraak_metadata(save_file='y')LicensePreviously under theMIT License, as of 28/10/2022 this work is licensed under aApache License, Version 2.0.Apache License, Version 2.0

Copyright (c) 2022 Maastricht Law & Tech Lab

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    
    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.