{"id":16871402,"url":"https://github.com/itsluketwist/jldc","last_synced_at":"2025-04-05T11:42:31.015Z","repository":{"id":221425885,"uuid":"747611752","full_name":"itsluketwist/jldc","owner":"itsluketwist","description":"Easily read/write JSONLines files that include dataclasses.","archived":false,"fork":false,"pushed_at":"2024-04-25T10:58:47.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-25T11:54:34.044Z","etag":null,"topics":["dataclasses","dataclasses-json","jsonl","jsonlines"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itsluketwist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-24T09:36:24.000Z","updated_at":"2024-04-25T10:58:50.000Z","dependencies_parsed_at":"2024-02-07T22:47:16.515Z","dependency_job_id":"b7bb2cd0-3da5-40fb-85e8-fed473608357","html_url":"https://github.com/itsluketwist/jldc","commit_stats":null,"previous_names":["itsluketwist/jldc"],"tags_count":2,"template":false,"template_full_name":"itsluketwist/python-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsluketwist%2Fjldc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsluketwist%2Fjldc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsluketwist%2Fjldc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsluketwist%2Fjldc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsluketwist","download_url":"https://codeload.github.com/itsluketwist/jldc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332524,"owners_count":20921852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dataclasses","dataclasses-json","jsonl","jsonlines"],"created_at":"2024-10-13T15:08:28.451Z","updated_at":"2025-04-05T11:42:30.975Z","avatar_url":"https://github.com/itsluketwist.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **jldc**\n\nSimplify using [JSON Lines](https://jsonlines.org/) files alongside \n[python dataclass](https://docs.python.org/3/library/dataclasses.html) ([PEP-557](https://peps.python.org/pep-0557/)) \nobjects, with convenient one-line reads/writes.\n\n![check code workflow](https://github.com/itsluketwist/jldc/actions/workflows/check.yaml/badge.svg)\n![release workflow](https://github.com/itsluketwist/jldc/actions/workflows/release.yaml/badge.svg)\n\n\u003cdiv\u003e\n    \u003c!-- badges from : https://shields.io/ --\u003e\n    \u003c!-- logos available : https://simpleicons.org/ --\u003e\n    \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n        \u003cimg alt=\"MIT License\" src=\"https://img.shields.io/badge/Licence-MIT-yellow?style=for-the-badge\u0026logo=docs\u0026logoColor=white\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.python.org/\"\u003e\n        \u003cimg alt=\"Python 3.10+\" src=\"https://img.shields.io/badge/Python_3.10+-blue?style=for-the-badge\u0026logo=python\u0026logoColor=white\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://jsonlines.org/\"\u003e\n        \u003cimg alt=\"JSON Lines\" src=\"https://img.shields.io/badge/JSON Lines-black?style=for-the-badge\u0026logo=JSON\u0026logoColor=white\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## *usage*\n\nImport the library and save/load lists of dataclasses or dictionaries with a single line.\n\n```python\nfrom jldc.core import load_jsonl, save_jsonl\nfrom dataclasses import dataclass\n\n\n@dataclass\nclass Person:\n    name: str\n    age: int\n\n\nsave_jsonl(\"people.jsonl\", [Person(\"Alice\", 24), Person(\"Bob\", 32)])\n\ndata = load_jsonl(\"people.jsonl\", [Person])\n\nprint(data)\n```\n\n## *installation*\n\nInstall directly from PyPI using pip:\n\n```shell\npip install jldc\n```\n\nUse the `ml` extra to encode/decode the `numpy.ndarray` type:\n\n```shell\npip install jldc[ml]\n```\n\n## *development*\n\nFork and clone the repository code:\n\n```shell\ngit clone https://github.com/itsluketwist/jldc.git\n```\n\nOnce cloned, install the package locally in a virtual environment:\n\n```shell\npython -m venv venv\n\n. venv/bin/activate\n\npip install -e \".[dev,ml]\"\n```\n\nInstall and use pre-commit to ensure code is in a good state:\n\n```shell\npre-commit install\n\npre-commit autoupdate\n\npre-commit run --all-files\n```\n\n## *testing*\n\nRun the test suite using:\n\n```shell\npytest .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsluketwist%2Fjldc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsluketwist%2Fjldc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsluketwist%2Fjldc/lists"}