Returns:
| Type | Description |
|---|---|
FileData | JSON, or an iterator of JSON records, if the file is JSON Lines |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | FilePath | the string or path to the file to read | required |
Source code in fil/fil.py
42 43 44 45 46 47 48 49 50 51 52 53 | |
Writes data to a file with a format based on the file's suffix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data | FileData | JSON, or an iterator of JSON records, if the file is JSON Lines | required |
path | FilePath | the string or path to the file to read | required |
use_safer | Optional[bool] | whether to use the safer module to avoid writing incomplete files. The default, | None |
kwargs | Dict | named arguments passed to the underlying writer | {} |
Source code in fil/fil.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |