{"id":16865911,"url":"https://github.com/jturner314/typed_csv","last_synced_at":"2025-10-13T23:24:14.214Z","repository":{"id":146870433,"uuid":"80901832","full_name":"jturner314/typed_csv","owner":"jturner314","description":"Wrappers for the csv crate to provide additional type-based functionality","archived":false,"fork":false,"pushed_at":"2017-02-14T23:13:02.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T17:53:32.946Z","etag":null,"topics":["csv","rust","rust-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jturner314.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2017-02-04T07:20:16.000Z","updated_at":"2017-02-05T01:02:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"93c46feb-fecd-41d8-ba72-6335659c8d09","html_url":"https://github.com/jturner314/typed_csv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jturner314/typed_csv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jturner314%2Ftyped_csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jturner314%2Ftyped_csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jturner314%2Ftyped_csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jturner314%2Ftyped_csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jturner314","download_url":"https://codeload.github.com/jturner314/typed_csv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jturner314%2Ftyped_csv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017243,"owners_count":26086015,"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-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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","rust","rust-library"],"created_at":"2024-10-13T14:48:50.932Z","updated_at":"2025-10-13T23:24:14.169Z","avatar_url":"https://github.com/jturner314.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typed_csv\n\n[![Build Status](https://travis-ci.org/jturner314/typed_csv.svg?branch=master)](https://travis-ci.org/jturner314/typed_csv)\n\nThis crate provides wrappers for the reader and writer in the [`csv`][csv]\ncrate that provide checking of the CSV headers (when reading) and automatically\nwriting the CSV headers (when writing) according to the field names in the\nrecord type.\n\n## Documentation\n\nRun `cargo doc --open` in this repository.\n\n## Simple examples\n\nThe reader does type-based decoding for each record in the CSV data. It checks\nthat the headers match the field names in the record type. The reader can\noptionally reorder columns to match headers to field names, ignore unused\ncolumns, or use an arbitrary predicate to match headers to field names.\n\n```rust\nextern crate rustc_serialize;\nextern crate typed_csv;\n\n#[derive(RustcDecodable)]\nstruct Record {\n    count: usize,\n    animal: String,\n    description: String,\n}\n\nfn main() {\n    let data = \"\\\ncount,animal,description\n7,penguin,happy\n10,cheetah,fast\n4,armadillo,armored\n9,platypus,unique\n7,mouse,small\n\";\n\n    let rdr = typed_csv::Reader::from_string(data);\n    for row in rdr.decode() {\n        let Record { animal, description, count } = row.unwrap();\n        println!(\"{}, {}: {}\", animal, description, count);\n    }\n}\n```\n\nThe writer automatically writes a header row according to the field names in\nthe record type.\n\n```rust\nextern crate rustc_serialize;\nextern crate typed_csv;\n\n#[derive(RustcEncodable)]\nstruct Record {\n    count: usize,\n    animal: \u0026'static str,\n    description: \u0026'static str,\n}\n\nfn main() {\n    let records = vec![\n        Record { count: 7, animal: \"penguin\", description: \"happy\" },\n        Record { count: 10, animal: \"cheetah\", description: \"fast\" },\n        Record { count: 4, animal: \"armadillo\", description: \"armored\" },\n        Record { count: 9, animal: \"platypus\", description: \"unique\" },\n    ];\n\n    let mut wtr = typed_csv::Writer::from_memory();\n    for record in records.into_iter() {\n        wtr.encode(record).unwrap();\n    }\n\n    assert_eq!(wtr.as_string(), \"\\\ncount,animal,description\n7,penguin,happy\n10,cheetah,fast\n4,armadillo,armored\n9,platypus,unique\n\");\n}\n```\n\n## Issues\n\nThis crate needs more tests, and it probably has a few bugs.\nPlease [file an issue](https://github.com/jturner314/typed_csv/issues/new) if\nyou find any bugs.\n\n## License\n\nSignificant portions of this crate are closely based on code from\nthe [`csv`][csv] crate, which is dual-licensed under the Unlicense and MIT\nlicenses. Many thanks to [BurntSushi](http://burntsushi.net/) (Andrew Gallant)\nfor creating such a fast and featureful CSV crate!\n\nThis crate is similarly dual-licensed under\nthe [Unlicense](https://unlicense.org/) and MIT licenses.\nSee [COPYING](COPYING) for more information.\n\n[csv]: https://github.com/BurntSushi/rust-csv\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjturner314%2Ftyped_csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjturner314%2Ftyped_csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjturner314%2Ftyped_csv/lists"}