{"id":27453855,"url":"https://github.com/artyom-poptsov/guile-dsv","last_synced_at":"2026-04-01T20:30:30.026Z","repository":{"id":22564467,"uuid":"25905769","full_name":"artyom-poptsov/guile-dsv","owner":"artyom-poptsov","description":"Delimiter-separated values (DSV) format parser for GNU Guile.","archived":false,"fork":false,"pushed_at":"2026-01-06T08:51:47.000Z","size":600,"stargazers_count":18,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-13T08:52:00.858Z","etag":null,"topics":["csv","dsv","guile","lisp","parser","rfc-4180","scheme"],"latest_commit_sha":null,"homepage":"","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/artyom-poptsov.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":".github/FUNDING.yml","license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.org","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.blockchain.com/explorer/addresses/btc/bc1qp7vwxnp4z05fgedfsrqeqvt89fjwnnghng0vp5"]}},"created_at":"2014-10-29T05:22:38.000Z","updated_at":"2026-01-13T11:18:49.000Z","dependencies_parsed_at":"2022-08-21T08:00:17.448Z","dependency_job_id":"bdc99cfd-150f-4607-a5f6-1c1f782ce89e","html_url":"https://github.com/artyom-poptsov/guile-dsv","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/artyom-poptsov/guile-dsv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom-poptsov%2Fguile-dsv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom-poptsov%2Fguile-dsv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom-poptsov%2Fguile-dsv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom-poptsov%2Fguile-dsv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artyom-poptsov","download_url":"https://codeload.github.com/artyom-poptsov/guile-dsv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom-poptsov%2Fguile-dsv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: 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":["csv","dsv","guile","lisp","parser","rfc-4180","scheme"],"created_at":"2025-04-15T13:57:30.603Z","updated_at":"2026-04-01T20:30:29.993Z","avatar_url":"https://github.com/artyom-poptsov.png","language":"Scheme","funding_links":["https://www.blockchain.com/explorer/addresses/btc/bc1qp7vwxnp4z05fgedfsrqeqvt89fjwnnghng0vp5"],"categories":[],"sub_categories":[],"readme":"# -*- mode: org; -*-\n* Guile-DSV\n[[https://github.com/artyom-poptsov/guile-dsv/actions/workflows/guile2.2.yml/badge.svg]]\n[[https://github.com/artyom-poptsov/guile-dsv/actions/workflows/guile3.0.yml/badge.svg]]\n[[https://github.com/artyom-poptsov/guile-dsv/actions/workflows/guix.yml/badge.svg]]\n\nGuile-DSV is a GNU Guile module for working with the [[https://en.wikipedia.org/wiki/Delimiter-separated_values][delimiter-separated\nvalues]] (DSV) data format.\n\nGuile-DSV supports [[http://www.catb.org/~esr/writings/taoup/html/ch05s02.html#id2901882][the Unix-style DSV format]] and [[https://tools.ietf.org/html/rfc4180][RFC 4180]] format.\n\nAlso Guile-DSV ships with a program named =dsv= (source code is here:\n=utils/dsv.in=) that allows to read and process DSV format (including\ndelimiter change and conversion from one standard to another.)\n\n*Note* that if you want to use Guile-DSV from an environment where =syslog= is\nunavailable, then you must set the =log-driver= option for =dsv-\u003escm= to\n\"file\" or \"none\" to prevent it from trying to log messages to the syslog.  See\nthe Texinfo documentation for details.\n\n** Requirements\n   - [[https://www.gnu.org/software/guile/][GNU Guile]] 2.0.12+\n   - [[http://www.nongnu.org/guile-lib/][Guile Library]] 0.1.9+\n   - [[https://github.com/artyom-poptsov/guile-smc][Guile-SMC]] 0.6.2+\n   - [[https://codeberg.org/guile/fibers][Guile-Fibers]] (optional) -- when Fibers module is not available on system,\n     classic threads are used instead.\n\n*** Build dependencies\n    - Texinfo (contains =makeinfo= tool that is required for making the\n      documentation in Texinfo format)\n    - Texlive (also is needed for documentation.)\n    - [[https://www.gnu.org/software/help2man][help2man]]\n\n** Installation\n[[https://repology.org/badge/vertical-allrepos/guile-dsv.svg]]\n\n*** GNU Guix\n #+BEGIN_EXAMPLE shell\n$ guix install guile-dsv\n #+END_EXAMPLE\n\n*** Manual\n #+BEGIN_EXAMPLE shell\n$ git clone https://github.com/artyom-poptsov/guile-dsv.git\n$ cd guile-dsv\n$ autoreconf -vif\n$ ./configure --prefix=/usr\n$ make -j$(nproc)\n$ sudo make install\n#+END_EXAMPLE\n\n For a basic explanation of the installation of the package, see the\n =INSTALL= file.\n\n Please *note* that you will need [[https://www.gnu.org/software/automake/][Automake]] 1.12 or later to run\n self-tests with =make check= (but the library itself can be built with\n older Automake version such as 1.11).\n\n *important* You probably want to call configure with the\n =--with-guilesitedir= option so that this package is installed in\n Guile's default path.  But, if you don't know where your Guile site\n directory is, run =configure= without the option, and it will give you\n a suggestion.\n\n** =dsv= CLI tool\nGuile-DSV includes a command-line interface (CLI) tool named =dsv= which\nallows to use Guile-DSV facilities in console.\n*** Options\nThe default behavior of =dsv= program is to print a formatted table from a\n\u003cfile\u003e to stdout.  The options listed below can be used to change or modify\nthis behavior.\n**** =--help=, =-h=\nPrint the help message and exit.\n\n**** =--summary=, =-s=\nPrint summary information for a file.\n\n**** =--delimiter=, =-D= =\u003cdelim\u003e=\nSet a delimiter.\n\n**** =--guess-delimiter=, =-d=\nGuess a file delimiter and print the result.\n\n**** =--number=, =-n=\nNumber rows and columns.\n\n**** =--width=, =-w= =\u003cwidth\u003e=\nWrap long lines of text inside cells to fit the table into the specified\nwidth.  If with is specified as \"auto\" (default value) then current terminal\nwidth is used.  When the required width is too small for the table wrapping,\nan error will be issued.  Zero width means no wrapping so the table might not\nfit into the screen.\n\n**** =--map-cell=, =-m= =\u003ccode\u003e=\nApply an arbitrary Scheme code on each cell value before printing.  There are\nthree variables that can be used in the code:\n- =$value= -- current cell value.\n- =$row=   -- current row number.\n- =$col=   -- current column number.\n\nCode examples:\n#+BEGIN_EXAMPLE shell\n--map-cell '(if (\u003e $value 0) $value 0)'\n--map-cell '(string-append \"\\\"\" $value \"\\\"\")'\n#+END_EXAMPLE\n\nNote that the code must return a string, that in turn will be printed in a\ncell.\n\n**** =--filter-row=, =-f= =\u003ccode\u003e=\nKeep only rows for which CODE returns =#t=.\n\nThere are two variables that can be used in the code:\n- =$value= -- current row content.\n- =$row=   -- current row number.\n\nFor example with this code Guile-DSV keeps only rows that are 5 columns in\nlength:\n#+BEGIN_EXAMPLE shell\n--filter-row '(= (length $value) 5)'\n#+END_EXAMPLE\n\n**** =--filter-column=, =-c= =\u003cprocedure\u003e=\n\nKeep only columns for which PROCEDURE returns #t.\nThere are two variables that can be used in the code:\n- =$value= -- current column content as a list.\n- =$row=   -- current column number.\n\nFor example with this code Guile-DSV keeps only the 2nd column from the input\ndata:\n#+BEGIN_EXAMPLE shell\n--filter-column '(= $col 2)'\n#+END_EXAMPLE\n\n**** =--file-format=, =-F= =\u003cfmt\u003e=\nSet a file format.  Possible formats are: \"unix\" (default), \"rfc4180\"\n\n**** =--with-header=, =-H=\nUse the first row of a table as a header when printing the table to the\nscreen.\n\n**** =--table-borders=, =-b= =\u003cspec\u003e=\nSet table borders for printing.  The value can be either a borders\nspecification or a preset name.\n\nSpec can be a comma-separated list of key=value pairs that specify the table\nstyle.  The list of possible keys can be found below (see \"Table parameters\".)\n\nAlso a table preset name can be used as the value.  See \"Tables\" section\nbelow.\n\nTable preset parameters can be overridden by specifying extra parameters after\nthe preset name.  E.g.:\n#+BEGIN_EXAMPLE shell\n--table-borders \"graphic,bs=3;31\"\n#+END_EXAMPLE\n\nMore examples:\n#+BEGIN_EXAMPLE shell\n--table-borders \"v=|,h=-,j=+\"\n--table-borders org\n#+END_EXAMPLE\n\n**** =--table-presets-path= =\u003cpath\u003e=\nSet the table preset path.  This option can be also set by\n=GUILE_DSV_TABLE_PRESETS_PATH= environment variable.  See \"Tables\" section\nbelow.\n\nThe default value depends on the Guile-DSV installation path.\n\n**** =--to=, =-t= =\u003cfmt\u003e=\nConvert a file to a specified format, write the result to =stdout=.\n\n**** =--to-delimiter=, =-T= =\u003cdelim\u003e=\nConvert delimiters to the specified variant.  When this option is not used,\n default delimiters for the chosen output format will be used.\n\n**** =--version=\nPrint information about Guile-DSV version.\n\n**** =--debug=\nEnable the state machine debugging.\n\n** Tables\n*** Table parameters\n| Short name | Long name               | Description                                           |\n|------------+-------------------------+-------------------------------------------------------|\n| bt         | border-top              | The top border.                                       |\n| btl        | border-top-left         | The top left corner.                                  |\n| btr        | border-top-right        | The top right corner.                                 |\n| btj        | border-top-joint        | The top border joint.                                 |\n| bl         | border-left             | The left table border.                                |\n| blj        | border-left-joint       | The left table border joint.                          |\n| br         | border-right            | The right table border.                               |\n| brj        | border-right-joint      | The right table border joint.                         |\n| bb         | border-bottom           | The bottom border.                                    |\n| bbl        | border-bottom-left      | The left corner of the bottom border.                 |\n| bbr        | border-bottom-right     | The right corner of the bottom border.                |\n| bbj        | border-bottom-joint     | The bottom border joint.                              |\n| bs         | border-style            | The style of the borders (\"fg;bg\".)                   |\n| ts         | text-style              | The text style (\"fg;bg\".)                             |\n| s          | shadow                  | The table shadow.                                     |\n| so         | shadow-offset           | The table shadow offset in format \"x;y\" (e.g. \"2;2\".) |\n| ss         | shadow-style            | The style of the shadow (\"fg;bg\".)                    |\n| rs         | row-separator           | The table row separator.                              |\n| rj         | row-joint               | The row joint.                                        |\n| cs         | column-separator        | The table column separator.                           |\n| hs         | header-style            | The header style (\"fg;bg\".)                           |\n| ht         | header-top              | The header top border.                                |\n| htl        | header-top-left         | The header top left border.                           |\n| htr        | header-top-right        | The header top right border.                          |\n| htj        | header-top-joint        | The header top joint.                                 |\n| hl         | header-left             | The header left border.                               |\n| hr         | header-right            | The header right border.                              |\n| hcs        | header-column-separator | The header column separator.                          |\n| hb         | header-bottom           | The header bottom border.                             |\n| hbl        | header-bottom-left      | The header bottom left corner.                        |\n| hbr        | header-bottom-right     | The header bottom right border.                       |\n| hbj        | header-bottom-joint     | The header bottom joint.                              |\n\n*** Table presets\n- =ascii=\n- =graphic-bold=\n- =graphic-double=\n- =graphic=\n- =graphic-with-shadow=\n- =markdown=\n- =org=\n\n** Common use cases\n*** Printing DSV files\n    To show DSV files (Unix-style) in human-readable manner, just invoke the\n    tool like this:\n#+begin_example shell\n$ head -4 /etc/passwd | dsv\n root    x  0  0  root    /root      /bin/bash         \n daemon  x  1  1  daemon  /usr/sbin  /usr/sbin/nologin \n bin     x  2  2  bin     /bin       /usr/sbin/nologin \n sys     x  3  3  sys     /dev       /usr/sbin/nologin\n#+end_example\n \n    Show a DSV file as a fancy table with custom borders:\n#+begin_example shell\n$ head -4 /etc/passwd | dsv -b \"rs=-,cs=|,rj=+\"\n root   | x | 0 | 0 | root   | /root     | /bin/bash         \n--------+---+---+---+--------+-----------+-------------------\n daemon | x | 1 | 1 | daemon | /usr/sbin | /usr/sbin/nologin \n--------+---+---+---+--------+-----------+-------------------\n bin    | x | 2 | 2 | bin    | /bin      | /usr/sbin/nologin \n--------+---+---+---+--------+-----------+-------------------\n sys    | x | 3 | 3 | sys    | /dev      | /usr/sbin/nologin\n#+end_example\n\n    The same output but with box-drawing characters:\n#+begin_example shell\n$ head -4 /etc/passwd | dsv -b \"rs=─,cs=│,rj=┼\"\n root   │ x │ 0 │ 0 │ root   │ /root     │ /bin/bash         \n────────┼───┼───┼───┼────────┼───────────┼───────────────────\n daemon │ x │ 1 │ 1 │ daemon │ /usr/sbin │ /usr/sbin/nologin \n────────┼───┼───┼───┼────────┼───────────┼───────────────────\n bin    │ x │ 2 │ 2 │ bin    │ /bin      │ /usr/sbin/nologin \n────────┼───┼───┼───┼────────┼───────────┼───────────────────\n sys    │ x │ 3 │ 3 │ sys    │ /dev      │ /usr/sbin/nologin\n#+end_example\n\n*** Printing tables\n    There are table presets that can be used to draw tables with specified\n    border styles.  Some examples:\n\n**** ascii\n#+begin_example shell\n$ echo -e \"a,b,c\\na1,b1,c1\\na2,b2,c2\\n\" | dsv -b \"ascii\"\n.--------------.\n| a  | b  | c  |\n|----+----+----|\n| a1 | b1 | c1 |\n|----+----+----|\n| a2 | b2 | c2 |\n'--------------'\n\n$ echo -e \"a,b,c\\na1,b1,c1\\na2,b2,c2\\n\" | dsv -b \"ascii\" --with-header\n.--------------.\n| a  | b  | c  |\n|====+====+====|\n| a1 | b1 | c1 |\n|----+----+----|\n| a2 | b2 | c2 |\n'--------------'\n#+end_example\n\n**** graphic\n#+begin_example shell\n$ echo -e \"a,b,c\\na1,b1,c1\\na2,b2,c2\\n\" | dsv -b \"graphic\"\n┌────┬────┬────┐\n│ a  │ b  │ c  │\n├────┼────┼────┤\n│ a1 │ b1 │ c1 │\n├────┼────┼────┤\n│ a2 │ b2 │ c2 │\n└────┴────┴────┘\n$ echo -e \"a,b,c\\na1,b1,c1\\na2,b2,c2\\n\" | dsv -b \"graphic-bold\"\n┏━━━━┳━━━━┳━━━━┓\n┃ a  ┃ b  ┃ c  ┃\n┣━━━━╋━━━━╋━━━━┫\n┃ a1 ┃ b1 ┃ c1 ┃\n┣━━━━╋━━━━╋━━━━┫\n┃ a2 ┃ b2 ┃ c2 ┃\n┗━━━━┻━━━━┻━━━━┛\n$ echo -e \"a,b,c\\na1,b1,c1\\na2,b2,c2\\n\" | dsv -b \"graphic-double\"\n╔════╦════╦════╗\n║ a  ║ b  ║ c  ║\n╠════╬════╬════╣\n║ a1 ║ b1 ║ c1 ║\n╠════╬════╬════╣\n║ a2 ║ b2 ║ c2 ║\n╚════╩════╩════╝\n#+end_example\n\n**** org\nThis is the preset that allows to generate [[https://orgmode.org/][org-mode]] tables from CSV/DSV data.\n#+begin_example shell\n$ echo -e \"a,b,c\\na1,b1,c1\\na2,b2,c2\\n\" | dsv -b \"org\"\n| a  | b  | c  |\n| a1 | b1 | c1 |\n| a2 | b2 | c2 |\n$ echo -e \"a,b,c\\na1,b1,c1\\na2,b2,c2\\n\" | dsv -b \"org\" --with-header\n| a  | b  | c  |\n|----+----+----|\n| a1 | b1 | c1 |\n| a2 | b2 | c2 |\n#+end_example\n\n*** Guessing the delimiter for a file\n#+begin_example shell\n$ dsv -d /etc/passwd\n:\n#+end_example\n\n*** Getting the summary for a CSV/DSV file\n#+begin_example shell\n$ dsv -s /etc/passwd\nFile:      /etc/passwd\nFormat:    unix\nDelimiter: ':' (0x3a)\nRecords:   50\n\ncolumn       width       \n1            19          \n2            1           \n3            5           \n4            5           \n5            34          \n6            26          \n7            17\n#+end_example\n\n*** Converting files between formats\n    From Unix DSV to RFC4180:\n#+begin_example shell\n$ dsv -t rfc4180 /etc/passwd | head -4\nroot,x,0,0,root,/root,/bin/bash\ndaemon,x,1,1,daemon,/usr/sbin,/usr/sbin/nologin\nbin,x,2,2,bin,/bin,/usr/sbin/nologin\nsys,x,3,3,sys,/dev,/usr/sbin/nologin\n#+end_example\n\n    Convert delimiters:\n#+begin_example shell\n$ dsv -t unix -T \"|\" /etc/passwd | head -4\nroot|x|0|0|root|/root|/bin/bash\ndaemon|x|1|1|daemon|/usr/sbin|/usr/sbin/nologin\nbin|x|2|2|bin|/bin|/usr/sbin/nologin\nsys|x|3|3|sys|/dev|/usr/sbin/nologin\n#+end_example\n\n*** Apply an arbitrary Scheme code to each cell of a table\nWrap each table value in double quotes:\n#+begin_example shell\ndsv -m '(string-append \"\\\"\" $value \"\\\"\")' /etc/group\n#+end_example\n\n*** Table filtering\nRemove 2nd row from a table:\n#+begin_example shell\n$ dsv -f '(not (= $row 1))' /etc/passwd\n#+end_example\n\nRemove 2nd column from a table:\n#+begin_example shell\n$ dsv -f '(not (= $col 1))' /etc/passwd\n#+end_example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartyom-poptsov%2Fguile-dsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartyom-poptsov%2Fguile-dsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartyom-poptsov%2Fguile-dsv/lists"}