jldc
Simplify using JSON Lines files alongside python dataclass (PEP-557) objects, with convenient one-line reads/writes.
usage
Import the library and save/load lists of dataclasses or dictionaries with a single line.
from jldc.core import load_jsonl, save_jsonl
from dataclasses import dataclass
@dataclass
class Person:
name: str
age: int
save_jsonl("people.jsonl", [Person("Alice", 24), Person("Bob", 32)])
data = load_jsonl("people.jsonl", [Person])
print(data)
installation
Install directly from GitHub, using pip:
pip install jldc
Use the ml extra to encode/decode the numpy.ndarray type:
pip install jldc[ml]
development
Fork and clone the repository code:
git clone https://github.com/itsluketwist/jldc.git
Once cloned, install the package locally in a virtual environment:
python -m venv venv
. venv/bin/activate
pip install -e ".[dev,ml]"
Install and use pre-commit to ensure code is in a good state:
pre-commit install
pre-commit autoupdate
pre-commit run --all-files
testing
Run the test suite using:
pytest .
Metadata
Release files for jldc 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jldc-0.0.6.tar.gz | 5.8 kB | Without provenance | Details for jldc-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jldc-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for jldc-0.0.6-py3-none-any.whl |
Total release size: 12.2 kB
Release files / jldc-0.0.6.tar.gz
| Download URL | jldc-0.0.6.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b009a802d29e62680b6071ee2c78ed3e19da920df0c472bdfaf2871ca146cd3
|
|
BLAKE2b-256 checksum How to use checksums |
f2c8298f3fcf2902bbb088fbcb99375f6d72b385e50c4b6e3a396a3bdf816e0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / jldc-0.0.6-py3-none-any.whl
| Download URL | jldc-0.0.6-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a2bdff6fafd5452dba1fb0fbcb3ef37a3613ed107c518744b38b5211860467b
|
|
BLAKE2b-256 checksum How to use checksums |
3e5db389238ecb96a35b108b151c17b6e055cb023fdd994edcda4e8e820af9e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for jldc 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.