{"id":16689551,"url":"https://github.com/sigpwned/csv4j","last_synced_at":"2025-07-22T17:34:41.160Z","repository":{"id":65507909,"uuid":"583766485","full_name":"sigpwned/csv4j","owner":"sigpwned","description":"Simple CSV reading and writing for Java 8+","archived":false,"fork":false,"pushed_at":"2025-07-01T18:44:54.000Z","size":135,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-17T00:02:00.504Z","etag":null,"topics":["csv","csv-reader","csv-writer","java","java-8","simple"],"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/sigpwned.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-30T21:09:05.000Z","updated_at":"2025-03-02T02:00:52.000Z","dependencies_parsed_at":"2024-09-11T23:48:16.694Z","dependency_job_id":"eb9e1220-df17-4aeb-a0ee-aa46723ad854","html_url":"https://github.com/sigpwned/csv4j","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/sigpwned/csv4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigpwned%2Fcsv4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigpwned%2Fcsv4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigpwned%2Fcsv4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigpwned%2Fcsv4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sigpwned","download_url":"https://codeload.github.com/sigpwned/csv4j/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigpwned%2Fcsv4j/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266539976,"owners_count":23945123,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["csv","csv-reader","csv-writer","java","java-8","simple"],"created_at":"2024-10-12T15:48:33.063Z","updated_at":"2025-07-22T17:34:41.139Z","avatar_url":"https://github.com/sigpwned.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSV4J [![tests](https://github.com/sigpwned/csv4j/actions/workflows/tests.yml/badge.svg)](https://github.com/sigpwned/csv4j/actions/workflows/tests.yml) [![Maven Central Version](https://img.shields.io/maven-central/v/com.sigpwned/csv4j)](https://search.maven.org/artifact/com.sigpwned/csv4j)\n\nCSV4J is a simple CSV reader and writer for Java 8 or later.\n\n## Goals\n\n* Provide CSV reading and writing functionality compatible with both de-facto and official standards\n* Expose low-level encoding data\n* Simple, compact API\n\n## Non-Goals\n\n* Object mapping\n* Header handling\n\n## Why Yet Another CSV Library?\n\nThere are already many good libraries with CSV support available: [Apache Commons CSV](https://commons.apache.org/proper/commons-csv/), [Super CSV](http://super-csv.github.io/super-csv/), [Opencsv](https://opencsv.sourceforge.net/), [Jackson](https://github.com/FasterXML/jackson-dataformats-text/tree/master/csv), etc. So why publish another?\n\nIn my experience, most of these libraries either:\n\n1. Have long-standing bugs\n2. Are complex to use\n3. Do too much\n4. Do not give visibility into low-level encoding data, particularly whether individual fields are quoted\n5. Do not handle [byte order marks](https://en.wikipedia.org/wiki/Byte_order_mark) (BOMs)\n\nIn response, this library is designed to be:\n\n1. Correct\n2. Simple\n3. Focused\n4. Transparent\n5. BOM-aware\n\n## Code Examples\n\nTo read data in the standard CSV format, use:\n\n    try (CsvReader rows=new CsvReader(openReader())) {\n        for(CsvRecord row=rows.readNext();row!=null;row=rows.readNext()) {\n            // Do something here\n        }\n    }\n\nTo read data in the standard CSV format while respecting BOMs -- for example, to read CSV files exported from Excel -- use:\n\n    try (CsvReader rows=new CsvReader(Boms.decodeFromBom(openInputStream(), StandardCharsets.UTF_8))) {\n        for(CsvRecord row=rows.readNext();row!=null;row=rows.readNext()) {\n            // Do something here\n        }\n    }\n\nTo write data in the standard CSV format, use:\n\n    try (CsvWriter rows=new CsvWriter(openWriter())) {\n        rows.writeNext(CsvRecord.of(\n            CsvField.of(true, \"Hello\"),\n            CsvField.of(true, \"World\")));\n        rows.writeNext(CsvRecord.of(\n            CsvField.of(false, \"Foo\"),\n            CsvField.of(false, \"Bar\")));\n    }\n\nThe `CsvReader` also has an `iterator` capability:\n\n    try (CsvReader rows=new CsvReader(openReader())) {\n        for(CsvRecord row : rows) {\n            // Do something here\n        }\n    }\n\nThe `CsvReader` also has a `stream` capability:\n\n    try (CsvReader rows=new CsvReader(openReader())) {\n        rows.stream.forEach(r -\u003e {\n            // Do something here\n        });\n    }\n\n## Related projects\n\nThe csv4j library has no dependencies. However, these libraries may be useful when processing CSV data.\n\n### chardet4j\n\nUsers may find [chardet4j](https://github.com/sigpwned/chardet4j) useful for decoding byte streams into character streams when character encodings are not known ahead of time, for example with user input:\n\n    try (CsvReader rows=new CsvReader(Chardet.decode(openInputStream(), StandardCharsets.UTF_8))) {\n        // Process rows here like normal...\n    }\n    \nThis code considers BOMs and performs a much smarter, more thorough byte frequency analysis to detect charsets.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigpwned%2Fcsv4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigpwned%2Fcsv4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigpwned%2Fcsv4j/lists"}