Writers¶
Functions for saving objects to file after they have been JSON serialized.
Save one case from an API response as a JSON file.
- Parameters
results – A dict representing a case, in the format of the Case Access Project API.
filename (
Optional
[str
]) – Filename (not including the directory) for the file where the downloaded opinion should be saved.directory (
Optional
[Path
]) – APath
object specifying the directory where the downloaded opinion should be saved. IfNone
is given, the current default isexample_data/cases
.filepath (
Optional
[Path
]) – Complete path to the location where the JSON file should be saved, including filename.
- Return type
None
Save cases from an API response as JSON files.
- Parameters
results (
List
[Dict
]) – A list of dicts representing cases, in the format of the Case Access Project API.filename (
Optional
[str
]) – Filename (not including the directory) for the file where the downloaded opinion should be saved.directory (
Optional
[Path
]) – APath
object specifying the directory where the downloaded opinion should be saved. IfNone
is given, the current default isexample_data/cases
.filepath (
Optional
[Path
]) – Complete path to the location where the JSON file should be saved, including filename.
- Return type
None