{"id":13752449,"url":"https://github.com/csvspecs/csv-yaml","last_synced_at":"2025-05-09T19:32:09.410Z","repository":{"id":75995178,"uuid":"153536518","full_name":"csvspecs/csv-yaml","owner":"csvspecs","description":"CSV ❤ YAML Format - Comma-Separated Values (CSV) Line-by-Line Records with YAML Encoding Rules - A Modern (Simple) Tabular Data Format incl. Arrays, Numbers, Booleans, Nulls, Nested Structures, Comments and More","archived":false,"fork":false,"pushed_at":"2018-10-23T08:50:46.000Z","size":10,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-03T09:03:59.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csvspecs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-10-17T23:31:30.000Z","updated_at":"2023-07-14T05:39:18.000Z","dependencies_parsed_at":"2024-01-17T15:02:45.496Z","dependency_job_id":"811d0973-0aba-4d54-9660-8bef39510706","html_url":"https://github.com/csvspecs/csv-yaml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csvspecs%2Fcsv-yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csvspecs%2Fcsv-yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csvspecs%2Fcsv-yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csvspecs%2Fcsv-yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csvspecs","download_url":"https://codeload.github.com/csvspecs/csv-yaml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224880776,"owners_count":17385367,"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":[],"created_at":"2024-08-03T09:01:06.004Z","updated_at":"2024-11-16T05:30:33.057Z","avatar_url":"https://github.com/csvspecs.png","language":null,"readme":"# CSV \u003c3 YAML Format\n \n\n_CSV (Line-by-Line) Records with YAML Encoding Rules - A Modern (Simple) Tabular Data Format incl. Arrays, Numbers, Booleans, Nulls, Nested Structures, Comments and More_\n\n\n\n## CSV \u003c3 YAML By Example\n\n\n```\n# \"Vanilla\" CSV \u003c3 YAML\n\n1,John,12 Totem Rd. Aspen,true\n2,Bob,null,false\n3,Sue,\"Bigsby, 345 Carnival, WA 23009\",false\n```\n\nor\n\n```\n# \"Vanilla\" CSV \u003c3 YAML (Pretty Printed)\n\n1, John, 12 Totem Rd. Aspen,               true\n2, Bob,  null,                             false\n3, Sue,  \"Bigsby, 345 Carnival, WA 23009\", false\n```\n\nor\n\n```\n# CSV \u003c3 YAML with header / headers row\n\nid,name,address,regular\n1,John,12 Totem Rd. Aspen,true\n2,Bob,null,false\n3,Sue,\"Bigsby, 345 Carnival, WA 23009\",false\n```\n\nor\n\n```\n# CSV \u003c3 YAML with values containing quotes and commas\n\nid,name,address,regular\n1,John,\"12 Totem Rd., Aspen\",true\n2,Bob,null,false\n3,Sue,\"\\\"Bigsby\\\", 345 Carnival, WA 23009\",false\n```\n\nor\n\n```\n# CSV \u003c3 YAML with array values\n\n1,directions,[north,south,east,west]\n2,colors,[red,green,blue]\n3,drinks,[soda,water,tea,coffe]\n4,spells,[]\n```\t\n\nor\n\n```\n# CSV \u003c3 YAML with all kinds of values\n\nindex,value1,value2\nnumber,1,2\nboolean,false,true\n\"null\",null,non null\narray of numbers,[1],[1,2]\nsimple object,{a:1},{a:1, b:2}\narray with mixed objects,[1,null,ball],[2,{a:10,b:20},cube]\nstring with quotes,\"a\\\"b\",\"alert(\\\"Hi!\\\")\"\nstring with bell\u0026newlines,\"bell is \\u0007\",\"multi\\nline\\ntext\"\n```\n\n\n\n## Frequently Asked Questions (FAQ) and Answers\n\n### Q: What's the recommended file type extension for CSV \u003c3 YAML files?\n\nThe recommended file format for CSV \u003c3 YAML files is `.csv` :-) or use `.yaml.csv` (to highlight \nthe fact of the YAML encoding rules).\n\n\n\n\n\n## Do-It-Yourself (DIY) - No CSV \u003c3 YAML Parser in Your Language? - Build Your Own \n\n\nBuild your own parser:\n\n- Read the input (e.g. string or file) line-by-line\n  - If the line is blank (only whitespace), skip the line.\n  - If the line starts with a hash mark (`#`), skip the comment line.\n  - Otherwise wrap the line in (`[]`) and pass along to the YAML parser :-).\n  \n  \nExample in Ruby:\n\n``` ruby\ndef parse( input )\n   records = []\n   input.each_line do |line|\n        \n      ##  note: chomp('') if is an empty string,\n      ##    it will remove all trailing newlines (e.g. \\n or \\r\\n) from the line\n      line = line.chomp( '' )\n      \n      ##  strip leading and trailing whitespaces (space and tab)\n      line = line.strip\n      \n      next if line.empty?             ## skip blank lines\n      next if line.start_with?( '#' ) ## skip comment lines\n        \n      ## note: auto-wrap in array e.g. with []\n      records \u003c\u003c YAML.load( \"[#{line}]\" )\n    end\n    records\nend\n```\n\n\n\n## Inspiration / Heritage / Alternatives\n\n### JSON\n\n- CSV \u003c3 JSON Format, see \u003chttps://github.com/csvspecs/csv-json\u003e\n\n\n\n## License\n\nThe CSV \u003c3 YAML format is dedicated to the public domain.\n\n\n\n## Request for Comments (RFC)\n\nPlease post your comments to the [wwwmake forum](http://groups.google.com/group/wwwmake).\nThanks!\n","funding_links":[],"categories":["CSV \u003c3 YAML"],"sub_categories":["Can I use \\_\\_? (RFC 4180 \"Strict\")"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsvspecs%2Fcsv-yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsvspecs%2Fcsv-yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsvspecs%2Fcsv-yaml/lists"}