{"id":17538914,"url":"https://github.com/iraikov/chicken-tabular","last_synced_at":"2026-02-20T17:32:48.569Z","repository":{"id":148366667,"uuid":"199033135","full_name":"iraikov/chicken-tabular","owner":"iraikov","description":"Parsing and formatting of tabular text data such as comma- and delimiter-separated values (CSV and DSV)","archived":false,"fork":false,"pushed_at":"2021-09-20T14:38:12.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T20:37:44.637Z","etag":null,"topics":["chicken-scheme","chicken-scheme-eggs","csv","csv-format","csv-reader","dsv","scheme-language"],"latest_commit_sha":null,"homepage":null,"language":"Scheme","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iraikov.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":"2019-07-26T14:42:28.000Z","updated_at":"2021-09-20T14:38:14.000Z","dependencies_parsed_at":"2023-05-19T21:30:30.996Z","dependency_job_id":null,"html_url":"https://github.com/iraikov/chicken-tabular","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"fdf9c32548ba9a1de5f56888c73e07bfa54449f9"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/iraikov/chicken-tabular","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fchicken-tabular","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fchicken-tabular/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fchicken-tabular/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fchicken-tabular/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iraikov","download_url":"https://codeload.github.com/iraikov/chicken-tabular/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fchicken-tabular/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29658377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T16:33:43.953Z","status":"ssl_error","status_checked_at":"2026-02-20T16:33:43.598Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["chicken-scheme","chicken-scheme-eggs","csv","csv-format","csv-reader","dsv","scheme-language"],"created_at":"2024-10-20T21:38:43.894Z","updated_at":"2026-02-20T17:32:48.532Z","avatar_url":"https://github.com/iraikov.png","language":"Scheme","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tabular\n\nParsing and formatting of tabular text data such as comma- and delimiter-separated values (CSV and DSV).\n\n## Documentation\n\nThe goal of the tabular library is to provide means of reading and\nwriting tabular text data, such as comma- and delimiter-separated\nvalues (CSV and DSV), as well as fixed-width columns.\n\n\n## Procedures\n\n### Readers\n   \n`reader:: INPUT [DELIMITER: #\\,] [EOL: \"\\n\"] [COMMENT-CHAR: #f]\n[NA: #f] [COLUMN-NAMES: #f] [COLUMN-WIDTHS: #f] [RETURN-NAMES: #f] -\u003e READER STREAM`\n\nConstructs a reader procedure for the given input format specification and returns two values: the reader procedure and the input stream. The reader procedure is of the form `LAMBDA STRM -\u003e RECORD STRM`. It reads one record from the given input stream and by default returns the record as a list of values and the remainder of the input stream. If optional argument `RETURN-NAMES` is true, the record will be returned as an alist where the keys are column names (if `COLUMN-NAMES` is provided) or indices, and the values are the column values. \n\n- Argument `INPUT` is a string or a port.\n- Argument `DELIMITER` specifies the delimiter character (default is `#\\,`). If its value is #f, then `COLUMNN-WIDTHS` must be specified.\n- Argument `EOL` specifies the end-of-line string (default is `\"\\n\"`).\n- Argument `COMMENT-CHAR` specifies a comment character: the reader will skip all lines that start with this character (default: none).\n- Argument `NA` specifies a default value to be supplied when a given field is empty (default: none).\n- Argument `COLUMN-NAMES` specifies column names which will be used if `RETURN-NAMES` is true (default: none). If `COLUMN-NAMES` is the symbol `'header` then the first line of the input will be used to infer the column names. \n- Argument `COLUMN-WIDTHS` specifies column widths  which will be used if `DELIMITER` is not specified (default: none).\n- Argument `RETURN-NAMES` specifies that each returned record will have the form of an alist with column name and value pairs. If `COLUMN-NAMES` is not provided, the column index will be used as key instead.\n\n`reader*:: INPUT [DELIMITER: #\\,] [EOL: \"\\n\"] [COMMENT-CHAR: #f]\n[NA: #f] [COLUMN-NAMES: #f] [COLUMN-WIDTHS: #f] [RETURN-NAMES: #f] -\u003e READER`\n\nConstructs a reader generator procedure for the given input format specification and returns the reader procedure. The reader procedure is of the form `LAMBDA () -\u003e RECORD`. It reads one record from the given input stream and by default returns the record as a list of values. If optional argument `RETURN-NAMES` is true, the record will be returned as an alist where the keys are column names (if `COLUMN-NAMES` is provided) or indices, and the values are the column values. \n\n- Argument `INPUT` is a string or a port.\n- Argument `DELIMITER` specifies the delimiter character (default is `#\\,`). If its value is #f, then `COLUMNN-WIDTHS` must be specified.\n- Argument `EOL` specifies the end-of-line string (default is `\"\\n\"`).\n- Argument `COMMENT-CHAR` specifies a comment character: the reader will skip all lines that start with this character (default: none).\n- Argument `NA` specifies a default value to be supplied when a given field is empty (default: none).\n- Argument `COLUMN-NAMES` specifies column names which will be used if `RETURN-NAMES` is true (default: none). If `COLUMN-NAMES` is the symbol `'header` then the first line of the input will be used to infer the column names. \n- Argument `COLUMN-WIDTHS` specifies column widths  which will be used if `DELIMITER` is not specified (default: none).\n- Argument `RETURN-NAMES` specifies that each returned record will have the form of an alist with column name and value pairs. If `COLUMN-NAMES` is not provided, the column index will be used as key instead.\n\n\n### Writers\n\n` writer:: OUTPUT [DELIMITER: #\\,] [COLUMN-WIDTHS: #f] [ENDLINE: \"\\n\"] -\u003e WRITER `\n\nConstructs a writer procedure that writes out records according to the\ngiven output specification. The writer procedure is of the form\n`LAMBDA RECORDS -\u003e UNIT`. Each record is represented as a list.\n\n- Argument `OUTPUT` is a string file name or a port.\n- Argument `DELIMITER` specifies the delimiter character (default is `#\\,`). If its value is #f, then `COLUMNN-WIDTHS` must be specified.\n- Argument `ENDLINE` specifies the end-of-line string (default is `\"\\n\"`).\n- Argument `COLUMN-WIDTHS` specifies column widths  which will be used if `DELIMITER` is not specified (default: none).\n\n\n## Examples\n\n\n```scheme\n\n(import tabular)\n\n(define (stream-\u003elist proc strm)\n  (let recur ((ax '()) (strm strm))\n    (let ((value.strm (proc strm)))\n      (if (eof-object? value.strm)\n          (reverse ax)\n          (recur (cons (car value.strm) ax) (cadr value.strm))\n          ))\n    ))\n\n;; Uses a reader generator to print all records in the given input string\n(let-values (((proc strm)\n             (call-with-input-string\n                \"\\\"Test \\n1\\\"|Test 2|Test 3\\nTest 4|Test 5\\n\"\n               (lambda (port) (reader port delimiter: #\\|)))))\n               (print (stream-\u003elist proc strm)))\n\n\n;; Prints all the records from the given file, where column names are inferred from the first line\n;; and each field in a record is prefixed by its column name\n(let ((input (open-input-file \"file.csv\")))\n  (let-values (((proc strm) (reader input delimiter: #\\, column-names: 'header return-names: #t)))\n    (let ((lst (stream-\u003elist proc strm)))\n      (close-input-port input)\n      (pretty-print lst)\n      ))\n  )\n\n;; Prints the first record of the given file\n(let ((input (open-input-file \"file.csv\"))\n      (gen (reader* input delimiter: #\\,)))\n   (print (gen)) \n   )\n\n\n\n;; Writes the given records to a string port\n(call-with-output-string\n (lambda (port)\n  (let ((out (writer port)))\n    (out (list \"Test 1\" \"Test 2\" \"Test 3\")\n         (list \"Test 4\" \"Test 5\" )))\n))\n\n\n```\n\n## Version history\n\n- 1.4 : Fix for return-names in reader generator [thanks to Vasilij Schneidermann for reporting]\n- 1.3 : Fix for return-names [thanks to Vasilij Schneidermann for reporting]\n- 1.2 : Fix for escaped double quotes [thanks to Matt Welland for reporting]\n- 1.0 : Initial release\n\n## License\n\n\u003e\n\u003e Copyright 2019-2021 Ivan Raikov\n\u003e \n\u003e  This program is free software: you can redistribute it and/or modify\n\u003e  it under the terms of the GNU General Public License as published by\n\u003e  the Free Software Foundation, either version 3 of the License, or (at\n\u003e  your option) any later version.\n\u003e  \n\u003e  This program is distributed in the hope that it will be useful, but\n\u003e  WITHOUT ANY WARRANTY; without even the implied warranty of\n\u003e  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n\u003e  General Public License for more details.\n\u003e \n\u003e  A full copy of the GPL license can be found at\n\u003e  \u003chttp://www.gnu.org/licenses/\u003e.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firaikov%2Fchicken-tabular","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firaikov%2Fchicken-tabular","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firaikov%2Fchicken-tabular/lists"}