Example 1: read a file
d1 = fil.read('file.json') # Any Json
d2 = fil.read('file.toml') # A dict
d3 = fil.read('file.yaml') # Any JSON
d4 = fil.read('file.txt') # A string
# Reading a JSON Line file returns an interator:
for record in fil.read('file.jsonl'):
print(record) # A sequence of JSON
Example 2: write to a file
fil.write(d1, 'file.json') # d1 can be any JSON
fil.write(d2, 'file.toml') # d2 must be a dict
fil.write(d3, 'file.yaml') # d3 can be any JSON
fil.write(d4, 'file.txt') # d4 most be a str
# Write an iterator to a JSON Line file
dicts = ({'key': i} for i in range(10))
fil.write(dicts, 'file.jsonl')
API Documentation
Metadata
Release files for fil 1.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fil-1.6.0.tar.gz | 19.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fil-1.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.1 kB
Release files / fil-1.6.0.tar.gz
| Download URL | fil-1.6.0.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8467bb9891bef50d51ad00809a20f99d9c7787070e9af13aed646a01c4d8c8b
|
|
BLAKE2b-256 checksum How to use checksums |
2c45cb22d89802f770ec2898d105279e6e8695fc7ea317ca42c0cf6280ac4d8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / fil-1.6.0-py3-none-any.whl
| Download URL | fil-1.6.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8c9e5cb9df3c29bc3295f3408fd812e39da99d35fa7cb21d224c56881ec4a58
|
|
BLAKE2b-256 checksum How to use checksums |
f790362111a21b816eeb63cf4d3b849717000521267698695ee62c1643eb82ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|