{"id":18084827,"url":"https://github.com/jwodder/serde-jsonlines","last_synced_at":"2025-04-07T07:18:07.186Z","repository":{"id":62225614,"uuid":"558474749","full_name":"jwodder/serde-jsonlines","owner":"jwodder","description":"Read \u0026 write JSON Lines documents","archived":false,"fork":false,"pushed_at":"2025-02-09T21:51:37.000Z","size":95,"stargazers_count":28,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T06:07:37.337Z","etag":null,"topics":["available-on-crates-io","json","json-lines","jsonlines","rust","serde","serde-json"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/jwodder.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-10-27T16:08:16.000Z","updated_at":"2025-02-17T08:12:27.000Z","dependencies_parsed_at":"2023-11-09T01:25:03.672Z","dependency_job_id":"de647206-f6d8-479b-b03a-2f06a125768b","html_url":"https://github.com/jwodder/serde-jsonlines","commit_stats":{"total_commits":73,"total_committers":1,"mean_commits":73.0,"dds":0.0,"last_synced_commit":"42e50270a8cae7cffc9c88899b6b00e17cebfc35"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fserde-jsonlines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fserde-jsonlines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fserde-jsonlines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fserde-jsonlines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwodder","download_url":"https://codeload.github.com/jwodder/serde-jsonlines/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608160,"owners_count":20965953,"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":["available-on-crates-io","json","json-lines","jsonlines","rust","serde","serde-json"],"created_at":"2024-10-31T15:08:22.327Z","updated_at":"2025-04-07T07:18:07.160Z","avatar_url":"https://github.com/jwodder.png","language":"Rust","readme":"[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![CI Status](https://github.com/jwodder/serde-jsonlines/actions/workflows/test.yml/badge.svg)](https://github.com/jwodder/serde-jsonlines/actions/workflows/test.yml)\n[![codecov.io](https://codecov.io/gh/jwodder/serde-jsonlines/branch/master/graph/badge.svg)](https://codecov.io/gh/jwodder/serde-jsonlines)\n[![Minimum Supported Rust Version](https://img.shields.io/badge/MSRV-1.74-orange)](https://www.rust-lang.org)\n[![MIT License](https://img.shields.io/github/license/jwodder/serde-jsonlines.svg)](https://opensource.org/licenses/MIT)\n\n[GitHub](https://github.com/jwodder/serde-jsonlines) | [crates.io](https://crates.io/crates/serde-jsonlines) | [Documentation](https://docs.rs/serde-jsonlines) | [Issues](https://github.com/jwodder/serde-jsonlines/issues) | [Changelog](https://github.com/jwodder/serde-jsonlines/blob/master/CHANGELOG.md)\n\n[JSON Lines](https://jsonlines.org) (a.k.a. newline-delimited JSON) is a simple\nformat for storing sequences of JSON values in which each value is serialized\non a single line and terminated by a newline sequence.  The `serde-jsonlines`\ncrate provides functionality for reading \u0026 writing these documents (whether all\nat once or line by line) using `serde`'s serialization \u0026 deserialization\nfeatures.\n\nBasic usage involves simply importing the `BufReadExt` or `WriteExt` extension\ntrait and then using the `json_lines()` or `write_json_lines()` method on a\n`BufRead` or `Write` value to read or write a sequence of JSON Lines values.\nConvenience functions are also provided for the common case of reading or\nwriting a JSON Lines file given as a filepath.\n\nAt a lower level, values can be read or written one at a time (which is useful\nif, say, different lines are different types) by wrapping a `BufRead` or\n`Write` value in a `JsonLinesReader` or `JsonLinesWriter` and then calling the\nwrapped structure's `read()` or `write()` method, respectively.\n\nWhen the `async` feature is enabled, analogous types for working with JSON\nLines asynchronously under `tokio` become available.\n\nExample\n=======\n\n```rust\nuse serde::{Deserialize, Serialize};\nuse serde_jsonlines::{json_lines, write_json_lines};\nuse std::io::Result;\n\n#[derive(Debug, Deserialize, Eq, PartialEq, Serialize)]\npub struct Structure {\n    pub name: String,\n    pub size: i32,\n    pub on: bool,\n}\n\nfn main() -\u003e Result\u003c()\u003e {\n    let values = vec![\n        Structure {\n            name: \"Foo Bar\".into(),\n            size: 42,\n            on: true,\n        },\n        Structure {\n            name: \"Quux\".into(),\n            size: 23,\n            on: false,\n        },\n        Structure {\n            name: \"Gnusto Cleesh\".into(),\n            size: 17,\n            on: true,\n        },\n    ];\n    write_json_lines(\"example.jsonl\", \u0026values)?;\n    let values2 = json_lines(\"example.jsonl\")?.collect::\u003cResult\u003cVec\u003cStructure\u003e\u003e\u003e()?;\n    assert_eq!(values, values2);\n    Ok(())\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwodder%2Fserde-jsonlines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwodder%2Fserde-jsonlines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwodder%2Fserde-jsonlines/lists"}