Loaders¶
Functions to load JSON or XML files for conversion into authorityspoke objects.
Will usually hand off data to the io.readers module to create authorityspoke objects.
Load list of records from YAML or JSON to create
Holding
s with text selectors.- Parameters
filename (
Optional
[str
]) – the name of the JSON file to look in forHolding
data in the format that listsmentioned_factors
followed by a list of holdings.directory (
Optional
[Path
]) – the path of the directory containing the JSON file.filepath (
Optional
[Path
]) – Complete path to the XML file representing theCode
, including filename.
- Return type
Dict
[str
,Union
[Dict
[str
,Dict
[str
,Union
[Dict
[str
,Union
[str
,bool
]],Sequence
[Any
],str
,bool
]]],Dict
[str
,Dict
[str
,Union
[str
,List
[Union
[str
,Dict
[str
,str
]]]]]],List
[Dict
[str
,Union
[Dict
[str
,Union
[Dict
[str
,Sequence
[Dict
[str
,Union
[Dict
[str
,Union
[str
,bool
]],Sequence
[Any
],str
,bool
]]]],Sequence
[Dict
[str
,Union
[str
,List
[Union
[str
,Dict
[str
,str
]]]]]],str
,bool
]],str
,bool
]]]]]- Returns
a list of
Holding
s from a JSON file in theexample_data/holdings
subdirectory, from a JSON file.
Load a list of records from JSON to create
Holding
s.- Parameters
filename (
Optional
[str
]) – the name of the JSON file to look in forHolding
data in the format that listsmentioned_factors
followed by a list of holdings.directory (
Optional
[Path
]) – the path of the directory containing the JSON file.filepath (
Optional
[Path
]) – Complete path to the XML file representing theCode
, including filename.
- Return type
Dict
[str
,Union
[Dict
[str
,Dict
[str
,Union
[Dict
[str
,Union
[str
,bool
]],Sequence
[Any
],str
,bool
]]],Dict
[str
,Dict
[str
,Union
[str
,List
[Union
[str
,Dict
[str
,str
]]]]]],List
[Dict
[str
,Union
[Dict
[str
,Union
[Dict
[str
,Sequence
[Dict
[str
,Union
[Dict
[str
,Union
[str
,bool
]],Sequence
[Any
],str
,bool
]]]],Sequence
[Dict
[str
,Union
[str
,List
[Union
[str
,Dict
[str
,str
]]]]]],str
,bool
]],str
,bool
]]]]]- Returns
a list of
Holding
s from a JSON file in theexample_data/holdings
subdirectory, from a JSON file.
Read
Rule
s from a file.Even though this function will generate
Rule
s instead ofHolding
s, it uses theload_holding()
function. Some fields that can exist in aHolding
object (rule_valid, decided, exclusive) are not applicable toRule
s.
Read holdings from a file.
- Parameters
- Return type
Read holdings from file, with Opinion text anchors for holdings and factors.
- Return type
Load file containing a judicial decision with one or more opinions.
Relies on the JSON format from the Caselaw Access Project API.
- Parameters
- Return type
Load file containing a judicial decision and make an Opinion object.
- Return type