{"id":20975891,"url":"https://github.com/banyc/hdv","last_synced_at":"2026-03-06T13:04:08.061Z","repository":{"id":240780592,"uuid":"803409326","full_name":"Banyc/hdv","owner":"Banyc","description":"CSV but can be parsed in a multi-layer `struct`","archived":false,"fork":false,"pushed_at":"2025-05-11T06:46:46.000Z","size":126,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-21T15:37:11.443Z","etag":null,"topics":["csv","data-science","file-format","relational-model"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Banyc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-05-20T17:04:36.000Z","updated_at":"2025-05-11T06:45:03.000Z","dependencies_parsed_at":"2024-05-22T17:02:40.863Z","dependency_job_id":"eec52cf0-e80e-46b7-9718-6d9fdde8bb55","html_url":"https://github.com/Banyc/hdv","commit_stats":null,"previous_names":["banyc/ov","banyc/hdv"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Banyc/hdv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banyc%2Fhdv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banyc%2Fhdv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banyc%2Fhdv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banyc%2Fhdv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Banyc","download_url":"https://codeload.github.com/Banyc/hdv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Banyc%2Fhdv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271229503,"owners_count":24722833,"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-08-19T02:00:09.176Z","response_time":63,"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","data-science","file-format","relational-model"],"created_at":"2024-11-19T04:47:57.159Z","updated_at":"2026-03-06T13:04:03.023Z","avatar_url":"https://github.com/Banyc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `hdv`\n\nHeader determined values.\n\nCSV but can be parsed in a multi-layer `struct`.\n\n## Usage\n\n### Import dependencies\n\n```rust\nuse std::sync::Arc;\n\nuse hdv::{\n    format::AtomValue,\n    io::{\n        bin::{HdvBinReader, HdvBinWriter},\n        text::{HdvTextReader, HdvTextWriter, HdvTextWriterOptions},\n    },\n    serde::{HdvDeserialize, HdvSerialize},\n};\nuse hdv_derive::HdvSerde;\n```\n\n### Write and read data in binary format\n\n```rust\n#[derive(Debug, HdvSerde, PartialEq)]\npub struct A {\n    a: u16,\n    b: Option\u003cB\u003e,\n    c: Option\u003cf64\u003e,\n    d: B,\n}\n#[derive(Debug, HdvSerde, PartialEq)]\nstruct B {\n    a: Arc\u003c[u8]\u003e,\n    b: i64,\n    c: Arc\u003cstr\u003e,\n    d: Option\u003cArc\u003c[u8]\u003e\u003e,\n}\n\nlet a = A {\n    a: 1,\n    b: None,\n    c: Some(3.),\n    d: B {\n        a: b\"hello\".as_ref().into(),\n        b: 2,\n        c: \"world\".into(),\n        d: None,\n    },\n};\n\nlet mut buf = vec![];\nlet mut writer = HdvBinWriter::new(\u0026mut buf);\nwriter.write(\u0026a).unwrap();\nwriter.flush().unwrap();\n\nlet mut reader = HdvBinReader::new(std::io::Cursor::new(\u0026buf));\nlet a_: A = reader.read().unwrap();\nassert_eq!(a, a_);\n\n#[derive(Debug, HdvSerde, PartialEq)]\npub struct PartialA {\n    c: Option\u003cf64\u003e,\n    a: u16,\n}\n\nlet mut reader = HdvBinReader::new(std::io::Cursor::new(\u0026buf));\nlet partial_a: PartialA = reader.read().unwrap();\nassert_eq!(a.a, partial_a.a);\nassert_eq!(a.c, partial_a.c);\n```\n\n### Write and read data in text format\n\nCurrently the text format does not accept:\n\n- bytes (`Vec\u003cu8\u003e`);\n- strings containing any of the chars `,`, `\"`, and `\\n` or starting with whitespace characters.\n\n```rust\n#[derive(Debug, HdvSerde, PartialEq)]\npub struct A {\n    a: u16,\n    b: Option\u003cB\u003e,\n    c: Option\u003cf64\u003e,\n    d: B,\n}\n#[derive(Debug, HdvSerde, PartialEq)]\nstruct B {\n    b: i64,\n    c: Arc\u003cstr\u003e,\n}\n\nlet a = A {\n    a: 1,\n    b: None,\n    c: Some(3.),\n    d: B {\n        b: 2,\n        c: \"world\".into(),\n    },\n};\n\nlet mut buf = vec![];\nlet options = HdvTextWriterOptions {\n    is_csv_header: false,\n};\nlet mut writer = HdvTextWriter::new(\u0026mut buf, options);\nwriter.write(\u0026a).unwrap();\nwriter.flush().unwrap();\n\nlet mut reader = HdvTextReader::new(std::io::Cursor::new(\u0026buf));\nlet a_: A = reader.read().unwrap();\nassert_eq!(a, a_);\n\n#[derive(Debug, HdvSerde, PartialEq)]\npub struct PartialA {\n    c: Option\u003cf64\u003e,\n    a: u16,\n}\n\nlet mut reader = HdvTextReader::new(std::io::Cursor::new(\u0026buf));\nlet partial_a: PartialA = reader.read().unwrap();\nassert_eq!(a.a, partial_a.a);\nassert_eq!(a.c, partial_a.c);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanyc%2Fhdv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbanyc%2Fhdv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanyc%2Fhdv/lists"}