{"id":15494890,"url":"https://github.com/fracpete/gsonlines","last_synced_at":"2026-04-27T23:36:56.959Z","repository":{"id":205917579,"uuid":"715383498","full_name":"fracpete/gsonlines","owner":"fracpete","description":"Java library for reading/writing JSON lines data.","archived":false,"fork":false,"pushed_at":"2024-01-07T22:47:31.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-19T12:15:45.319Z","etag":null,"topics":["java","jsonlines","maven"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fracpete.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":"2023-11-07T03:00:57.000Z","updated_at":"2023-11-07T04:17:00.000Z","dependencies_parsed_at":"2024-01-07T23:47:03.467Z","dependency_job_id":null,"html_url":"https://github.com/fracpete/gsonlines","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":0.04347826086956519,"last_synced_commit":"8c6e1135d8f16c5a4d77422239168d38406325ff"},"previous_names":["fracpete/gsonlines"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fracpete/gsonlines","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fracpete%2Fgsonlines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fracpete%2Fgsonlines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fracpete%2Fgsonlines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fracpete%2Fgsonlines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fracpete","download_url":"https://codeload.github.com/fracpete/gsonlines/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fracpete%2Fgsonlines/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32240609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["java","jsonlines","maven"],"created_at":"2024-10-02T08:15:31.588Z","updated_at":"2026-04-27T23:36:56.917Z","avatar_url":"https://github.com/fracpete.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gsonlines\nJava library for reading/writing [JSON lines](https://jsonlines.org/) data using the \n[gson](https://github.com/google/gson) library under the hood for automatic \ndeserialization/serialization of objects.\n\nAutomatically compresses/decompresses when the file name ends with `.gz`.\n\n\n## Maven\n\nAdd the following to your `pom.xml`:\n\n```xml\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.github.fracpete\u003c/groupId\u003e\n      \u003cartifactId\u003egsonlines\u003c/artifactId\u003e\n      \u003cversion\u003e0.0.2\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\n\n## Examples\n\n### Stream\n\nThe following example reads one line at a time and writes one line at a time as well:\n\n```java\nimport com.github.fracpete.gsonlines.StreamReader;\nimport com.github.fracpete.gsonlines.StreamWriter;\n\nimport java.io.File;\nimport java.util.Map;\n\npublic class Stream {\n\n  public static void main(String[] args) throws Exception {\n    File fin = new File(\"/some/where/in.jsonl.gz\");\n    File fout = new File(\"/some/where/out.jsonl.gz\");\n    StreamReader r = new StreamReader(fin);\n    StreamWriter w = new StreamWriter(fout);\n    while (r.hasNext()) {\n      Map m = r.next(Map.class);\n      // do something with the data\n      w.write(m);\n    }\n    r.close();\n    w.close();\n  }\n}\n```\n\n### Batch\n\nThe following example reads all the lines in one go, processes them and then writes them again to another file: \n\n```java\nimport com.github.fracpete.gsonlines.ArrayReader;\nimport com.github.fracpete.gsonlines.ArrayWriter;\n\nimport java.io.File;\nimport java.util.Map;\n\npublic class Batch {\n\n  public static void main(String[] args) throws Exception {\n    File fin = new File(\"/some/where/in.jsonl\");\n    ArrayReader r = new ArrayReader(fin);\n    Map[] data = r.read(Map.class);\n    r.close();\n    // do something with the data\n    File fout = new File(\"/some/where/out.jsonl\");\n    ArrayWriter w = new ArrayWriter(fout);\n    w.write(data);\n    w.close();\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffracpete%2Fgsonlines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffracpete%2Fgsonlines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffracpete%2Fgsonlines/lists"}