{"id":32164310,"url":"https://github.com/kellyfelkins/tabular","last_synced_at":"2026-02-20T16:01:23.256Z","repository":{"id":57555506,"uuid":"189689006","full_name":"kellyfelkins/tabular","owner":"kellyfelkins","description":"Convert ASCII table strings into lists of lists or lists of maps.","archived":false,"fork":false,"pushed_at":"2020-09-15T17:44:39.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-21T14:50:45.696Z","etag":null,"topics":["elixir","testing"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kellyfelkins.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-01T04:09:49.000Z","updated_at":"2020-09-15T17:44:41.000Z","dependencies_parsed_at":"2022-09-10T22:23:05.318Z","dependency_job_id":null,"html_url":"https://github.com/kellyfelkins/tabular","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kellyfelkins/tabular","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellyfelkins%2Ftabular","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellyfelkins%2Ftabular/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellyfelkins%2Ftabular/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellyfelkins%2Ftabular/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kellyfelkins","download_url":"https://codeload.github.com/kellyfelkins/tabular/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kellyfelkins%2Ftabular/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29656589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["elixir","testing"],"created_at":"2025-10-21T14:44:35.270Z","updated_at":"2026-02-20T16:01:23.240Z","avatar_url":"https://github.com/kellyfelkins.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"Tabular\n=======\n\nTabular is a **reader** for data in ascii table format and **test helpers** to facilitate\ntesting with ascii tables.\n\nReader\n------\n\nThe reader allows you to read string data formatted like this:\n\n\u003cpre\u003e\n+------------------+--------------------+\n| name             | dob                |\n+------------------+--------------------+\n| Malcolm Reynolds | September 20, 2468 |\n| Zoe Washburne    | February 15, 2484  |\n+------------------+--------------------+\n\u003c/pre\u003e\n\nYou can add row separators so that column values can wrap over multiple rows. This helps\nyou manage the width of tables.\n\n\u003cpre\u003e\n+-----------+--------------+\n| name      | dob          |\n+-----------+--------------+\n| Malcolm   | September 20,|\n| Reynolds  | 2468         |\n+-----------+--------------+\n| Zoe       | February 15, |\n| Washburne | 2484         |\n+-----------+--------------+\n\u003c/pre\u003e        \n        \nWrapped cells are folded--the two tables produce the same results.\n\nTest Helpers\n------------\n\nThe `compare`, `equal?`, and `assert_equal` functions compare two ascii tables. \n\n**`compare`** generates a matrix from two ascii tables indicating which cells are equal\n*and which are different. You can provide an optional list of per column comparators. When\n*a comparator is provided for a column it will be used to compare the values of the cells\n*for that column. See [test_support_test.exs][2] for examples that include comparators.\n\n[2]: https://github.com/kellyfelkins/tabular/blob/master/test/test_support_test.exs\n\n**`equal?`** takes the matrix generated by compare and returns a boolean indicating if\n*original ascii tables are, well, equal.\n\n**`assert_equal`** asserts that the results generated from `compare` indicate the tables\n*are equal, and, if not, generates a failure message showing the table with differences\n*marked.\n\nIn [Ascii Tables For Clearer Testing][1] I discuss using ascii tables to improve\ncomprehension of software tests.\n\n[1]: https://punctuatedproductivity.wordpress.com/2016/02/02/ascii-tables-for-clearer-testing/\n\nInstallation\n------------\n\nThe package can be installed by adding `tabular` to your list of dependencies in\n`mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:tabular, \"~\u003e 1.0\"}\n  ]\nend\n```\n\nUsage\n-----\n\nRows are returned as either lists of lists or lists of maps.\n\n\u003cpre\u003e\n+-----------------------+------------------------------+-----------------------------------+\n| **Ascii Table Value** | **Returned Value**           | **Notes**                         |\n+-----------------------+------------------------------+-----------------------------------+\n| Malcolm Reynolds      | \"Malcolm Reynolds\"           | Most values returned as string    |\n+-----------------------+------------------------------+-----------------------------------+\n| 123                   | \"123\"                        | including numbers                 |\n+-----------------------+------------------------------+-----------------------------------+\n| wrapped strings are   | \"wrapped strings are folded\" | Similar to yaml, wrapped          |\n| folded                |                              | strings are folded with a single  |\n|                       |                              | space replacing the new line      |\n+-----------------------+------------------------------+-----------------------------------+\n|                       | \"\"                           | an empty string is returned for   | \n|                       |                              | blank cells                       |\n+-----------------------+------------------------------+-----------------------------------+\n| nil                   | nil                          | nil, true, and false are          |\n|                       |                              | special values                    |\n+-----------------------+------------------------------+-----------------------------------+\n| true                  | true                         |                                   |\n+-----------------------+------------------------------+-----------------------------------+\n| false                 | false                        |                                   |\n+-----------------------+------------------------------+-----------------------------------+\n| :foo                  | :foo                         | Values beginning with a colon are |\n|                       |                              | returned as atoms                 |\n+-----------------------+------------------------------+-----------------------------------+\n\u003c/pre\u003e\n\n**Reading a String**\n\n```elixir\n  Tabular.to_list_of_lists(table)\n  |\u003e Enum.each(fn [col1, col2, col3] = row -\u003e\n    # use row or column data here...\n  end\n```\n\nMore examples can be found in the Examples of Testing With ASCII Tables\n[repo](https://github.com/kellyfelkins/examples_of_testing_with_ascii_tables).\n\nThe docs can be found at [https://hexdocs.pm/tabular](https://hexdocs.pm/tabular).\n\n## License\n\nBlue Oak Model license. Please see [LICENSE][license] for details.\n\n[LICENSE]: https://github.com/kellyfelkins/tabular/blob/master/LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkellyfelkins%2Ftabular","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkellyfelkins%2Ftabular","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkellyfelkins%2Ftabular/lists"}