{"id":22265991,"url":"https://github.com/qcif/labrys-csv2html","last_synced_at":"2025-10-08T19:49:56.406Z","repository":{"id":70159356,"uuid":"322493812","full_name":"qcif/labrys-csv2html","owner":"qcif","description":"Converts CSV records into HTML, with the output controlled by a template.","archived":false,"fork":false,"pushed_at":"2021-01-29T03:22:59.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-25T14:21:38.145Z","etag":null,"topics":["csv"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/qcif.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-12-18T05:02:17.000Z","updated_at":"2021-04-11T21:59:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"34375ed8-3fa6-425b-bec7-6289b4a59691","html_url":"https://github.com/qcif/labrys-csv2html","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/qcif/labrys-csv2html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qcif%2Flabrys-csv2html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qcif%2Flabrys-csv2html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qcif%2Flabrys-csv2html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qcif%2Flabrys-csv2html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qcif","download_url":"https://codeload.github.com/qcif/labrys-csv2html/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qcif%2Flabrys-csv2html/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000671,"owners_count":26082806,"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-10-08T02:00:06.501Z","response_time":56,"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"],"created_at":"2024-12-03T10:17:24.868Z","updated_at":"2025-10-08T19:49:56.391Z","avatar_url":"https://github.com/qcif.png","language":"Dart","readme":"# CSV to HTML converter\n\nFormats a Comma Separated Variables (CSV) data file into HTML.  Each\nrow is a record and the columns are properties.  A template is used to\ncontrol how the records and properties are displayed.\n\nSee the _examples_ directory for an example generated HTML file.\n\n## Installing\n\n### Download binaries\n\nPre-compiled native binaries may be available on the project's GitHub\nrepository under [releases](https://github.com/qcif/csv2html/releases).\n\n### Building from source\n\nThis program is written in [Dart](https://dart.dev).\n\nTo run it using the Dart interpreter, install the Dart SDK and run:\n\n```sh\ndart pub get\ndart bin/csv2html.dart\n```\n\nTo compile it into a native binary, install the Dart SDK and run:\n\n```sh\ndart pub get\ndart compile exe bin/csv2html.dart\n```\n\n## Usage\n\n```sh\n\ncsv2html [options] csv-data.csv\n\n```\n\nOptions:\n\n- `-o FILE` or `--output FILE` write generated HTML to named file (default: write to stdout).\n\n- `-t FILE` or `--template FILE` specifies the template to use.\n\n- `-e` or `--exclude-other` exclude other properties from property summary.\n\n- `-i` or `--include-hidden` include hidden properties in property summary.\n\n- `-q` or `--quiet` do not print out warnings.\n\n- `-h` or `--help`  show a brief help message and exits.\n\n\n## Overview\n\n### Data input\n\nThe data in the CSV file is treated as a sequence of records, where\neach record has a set of property values. Rows are records; columns\nare properties.\n\nThe first row contains the **property names**. The fields in the\ncolumn under the property name, are the **property values**.  All\nfields in the first row must contain a value (i.e. a property name\ncannot be empty).\n\nEach subsequent row is a **record**. The fields in a record row are\nthe _property values_ for the corresponding property of the record.\nIf a record row contains fewer fields than the number of property\nnames, the remaining property values are assigned the empty\nstring. Record rows cannot contain more fields than the number of\nproperties named in the first row.\n\nAll fields are treated as strings, with leading and trailing\nwhitespace removed.\n\n### HTML output\n\nThe HTML produced contains two main sections: records and properties.\n\nThe records section show every record from the input data. That is,\nthe values from a row in the input CSV. By default, a table of\ncontents is also shown before the records, with links to each of the\nrecords.\n\nThe properties section show every property from the input data. That\nis, the values from a column in the input CSV. By default, an index of\nthe properties is shown after the properties, with links to each of\nthe properties. By default, other properties (those indicated by\n`_OTHER`) are included and hidden properties (those indicated by\n`_HIDE`) are not: that behaviour can be changed by using command line\noptions.\n\n## Templates\n\nThe template defines which properties are included in the record, and\nhow they are displayed.\n\nThe template is specified by a CSV file. The rows are either\n\n- template items;\n- commands; or\n- comments\n\nThe first row in the template CSV is always ignored. This is for\nconsistency with how data files are processed.\n\nIn both template items and commands, it is an error to reference a\nproperty name that does not appear in the data file.\n\nAll fields are treated as strings, with leading and trailing\nwhitespace removed.\n\n### Template items\n\nRows for template items contain up to four columns, representing:\n\n- display text;\n- property name;\n- enumeration; and\n- notes.\n\nThe notes will be displayed in the properties section of the HTML.\n\nThe notes can contain multiple lines. If the field in the CSV starts\nand ends with a double-quote, there can be new line characters (0x0A)\ninside the value. Alternatively, the Unicode _line separator_\ncharacter (U+2028) can also be used.\n\nThe order in which the template items appear in the template is the\norder in which they are shown in the record.\n\nTemplates should have a template item for every property in the data\nfile, or identify the property with either the _OTHER or _HIDE\ncommands.  A warning will be given for properties that appear in the\ndata but not in the template.\n\n#### Scalars\n\nA scalar is a template item for displaying a single property.\n\nIt is specified by a row with non-blank property name.\n\nIt maps the property name into the display text for the property's\nlabel. The display text cannot start with an underscore (otherwise the\nrow will be treated as a command).\n\nThe display text can be empty. This only makes sense for\nsub-properties of a group, so no sub-label is displayed for the\nproperty.\n\n```\nCommon name, cn\n```\n\nIf there is an enumeration, it is used to map the property values into\ntext that appears for the property's value.\n\nThe enumeration field contains a set of semicolon separated key-value\npairs, where the key and value are separated by an equal sign.\n\n```\nMachine status,  status,  0=off; 1=sleep ;2=on\n```\n\nOnly scalar items and ignored properties can have an enumeration.\n\n#### Groups\n\nA group is a template item for displaying multiple properties\ntogether. The properties in the group are shown with sub-labels under\na single group label.\n\nIt is specified by a row with a non-blank display text and a blank\nproperty name. The display text is used as the group label.\nScalar items in the following rows are members of the group.\nThe group is terminated by an empty row (a row where all the\nfields are blank).\n\n```\nLocation\nBuilding name,bldg\nStreet Address,address\nSuburb,suburb\n,,\n```\n\n### Commands\n\nRows where the first column has a value that starts with a \"_\" are\ntreated as commands. The second colum will be used as the parameter to\nthe command.\n\n#### _TITLE\n\nThe parameter is used as the HTML document's title.\n\n```\n_TITLE,My Books\n```\n\n#### _SUBTITLE\n\nThe parameter is used as the HTML document's subtitle.\n\n```\n_SUBTITLE,\"Some books from my library\"\n```\n\n#### _SORT\n\nThe parameter is used as a property used to order the\nrecords.\n\n```\n_SORT,  title\n_SORT,  subtitle\n```\n\nMultiple sort properties can be specified with multiple sort commands.\nThe records are sorted by the first sort property, with subsequent\nsort properties used if the first values are equal.\n\nIf no sort properties are defined in the template, the records are ordered\nin the same order as the rows in the CSV file.\n\n#### _IDENTIFIER\n\nThe parameter is a property used for the link to the record (e.g. in\nthe table of contents).\n\n```\n_IDENTIFIER, title\n```\n\nMultiple identifiers can be specified with multiple identifier\ncommands. Each is displayed in its own column.\n\nIf no identifiers are defined in the template, the first scalar\nproperty in the template is used as the identifier.\n\n#### _OTHER\n\nThe property named in the parameter is not displayed in the records,\nbut is included in the properties section.\n\nBut it can be excluded from the properties section with the\n`--exclude-other` command line option. That option makes this behave\nlike _HIDE.\n\n```\n_OTHER,  isbn\n_OTHER,  dimensions\n```\n\n#### _HIDE\n\nThe property named in the paramater is not displayed at all (neither\nin the records section or the properties section).\n\nBut it can be included in the properties section with the\n`--include-hidden` command line option. That option makes this behave\nlike _OTHER.\n\n```\n_HIDE,  internal_price\n```\n\nThis command is used to indicate the template knows about the\nproperty, but is deliberately not displaying it in the record.\n\n#### _SHOW\n\nSemicolon separate list of one or more of these values:\n\n- `records` - show the records\n- `contents` - show the table of contents (only if `records` are shown)\n- `properties` - show the properties\n- `index` - show the index of properties (only if `properties` are shown)\n- `all` - show all the above.\n\n```\n_SHOW, records;contents\n```\n\nIf there is now _SHOW command, it is the same as showing \"all\".\n\n\n### Comments\n\nRows where the value in the first column starts with a \"#\" are\ncomments. The entire comment row is ignored.\n\nNote: empty rows are also ignored, except when they are used to\nindicate the end of a group. Comment rows do not indicate the end of a\ngroup.\n\n### Example template\n\nA simple example template:\n\n```\nDisplay text,   Property,       Enumeration,    Notes\n\n# An example template\n\n_TITLE,         My Books\n_SUBTITLE,      An example\n\n_SORT,          title\n_SORT,          subtitle\n\n_IDENTIFIER,    title\n\nBook title,     title\nSubtitle,       subtitle\n\nAuthor,         ,               ,               Start of a group\nGiven name,     author_givenname\nFamily name,    author_familyname\n\nPublisher,      publisher_name\nFormat,         format,         , hc=Hard cover;pb=Paperback\n_OTHER,         isbn\n_OTHER,         dimensions\n_HIDE,          internal_price\n```\n\n### Default template\n\nIf no template is supplied, a default template is generated from the\ndata.\n\nThe default template contains a scalar item for every property, with\nthe display text being the same as the property name.  They appear in\nthe same order as the property names appear in the first line of the\nCSV.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqcif%2Flabrys-csv2html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqcif%2Flabrys-csv2html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqcif%2Flabrys-csv2html/lists"}