{"id":13587144,"url":"https://github.com/dbohdan/csv2html","last_synced_at":"2025-05-07T15:42:41.232Z","repository":{"id":7597532,"uuid":"8954475","full_name":"dbohdan/csv2html","owner":"dbohdan","description":"Convert CSV files to HTML tables","archived":false,"fork":false,"pushed_at":"2024-05-26T19:01:35.000Z","size":84,"stargazers_count":77,"open_issues_count":0,"forks_count":19,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-05T05:16:31.821Z","etag":null,"topics":["cli","command-line-tool","conversion","converter","csv","html","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/csv2html","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbohdan.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":"2013-03-22T15:09:45.000Z","updated_at":"2025-03-26T00:22:11.000Z","dependencies_parsed_at":"2024-05-22T12:51:56.411Z","dependency_job_id":null,"html_url":"https://github.com/dbohdan/csv2html","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbohdan%2Fcsv2html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbohdan%2Fcsv2html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbohdan%2Fcsv2html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbohdan%2Fcsv2html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbohdan","download_url":"https://codeload.github.com/dbohdan/csv2html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252908011,"owners_count":21823320,"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":["cli","command-line-tool","conversion","converter","csv","html","rust"],"created_at":"2024-08-01T15:06:02.782Z","updated_at":"2025-05-07T15:42:41.193Z","avatar_url":"https://github.com/dbohdan.png","language":"Rust","funding_links":[],"categories":["Rust","cli"],"sub_categories":[],"readme":"# csv2html\n\nThis command-line utility converts [CSV files](http://en.wikipedia.org/wiki/Comma-separated_values) to HTML tables and complete HTML documents.\nIt can use the first row of the CSV file as the [header](https://developer.mozilla.org/en/docs/Web/HTML/Element/th) of the table, and does so by default.\n\nThe original Python version of csv2html is preserved in the branch [`python`](https://github.com/dbohdan/csv2html/tree/python).\n\n\n## Installation\n\nPrebuilt Linux and Windows binaries are available.\nThey are attached to releases on the [\"Releases\"](https://github.com/dbohdan/csv2html/releases) page.\n\ncsv2html requires Rust 1.74 or later to build.\n\n### Installing with Cargo\n\n```sh\ncargo install csv2html\n```\n\n### Building on Debian and Ubuntu\n\nFollow the instructions to build a static Linux binary of csv2html from the source code on recent Debian and Ubuntu.\n\n1\\. Install [Rustup](https://rustup.rs/).\n    Through Rustup, add the stable musl libc target for your CPU.\n\n```sh\nrustup target add x86_64-unknown-linux-musl\n```\n\n2\\. Install the build and test dependencies.\n\n```sh\nsudo apt install build-essential musl-tools\ncargo install just\n```\n\n3\\. Clone this repository.\n    Build the binary.\n\n```sh\ngit clone https://github.com/dbohdan/csv2html\ncd csv2html\njust test\njust release-linux\n```\n\n### Cross-compiling for Windows\n\nFollow the instructions to build a 32-bit Windows binary of csv2html on recent Debian and Ubuntu.\n\n1\\. Install [Rustup](https://rustup.rs/).\n    Through Rustup, add the i686 GNU ABI Windows target.\n\n```sh\nrustup target add i686-pc-windows-gnu\n```\n\n2\\. Install the build dependencies.\n\n```sh\nsudo apt install build-essential mingw-w64\ncargo install just\n```\n\n3\\. Configure Cargo for cross-compilation.\n    Add the following in `~/.cargo/config`.\n\n```toml\n[target.i686-pc-windows-gnu]\nlinker = \"/usr/bin/i686-w64-mingw32-gcc\"\n```\n\n4\\. Clone this repository.\n    Build the binary.\n\n```sh\ngit clone https://github.com/dbohdan/csv2html\ncd csv2html\njust release-windows\n```\n\n## Command-line arguments\n\n```none\nConvert CSV files to HTML tables\n\nUsage: csv2html [OPTIONS] [input]\n\nArguments:\n  [input]  Input file\n\nOptions:\n  -o, --output \u003cOUTPUT\u003e    Output file\n  -t, --title \u003cTITLE\u003e      HTML document title\n  -d, --delimiter \u003cDELIM\u003e  Field delimiter character for CSV (',' by default)\n  -s, --start \u003cN\u003e          Skip the first N-1 rows; start at row N\n  -r, --renumber           Replace the first column with row numbers\n  -n, --no-header          Do not use the first row of the input as the header\n  -c, --complete-document  Output a complete HTML document instead of only a\ntable\n      --table \u003cATTRS\u003e      HTML attributes for the tag \u003ctable\u003e (e.g., --table\n'foo=\"bar\" baz' results in the output \u003ctable foo=\"bar\" baz\u003e...\u003c/table\u003e); it is\nup to the user to ensure the result is valid HTML\n      --tr \u003cATTRS\u003e         Attributes for \u003ctr\u003e\n      --th \u003cATTRS\u003e         Attributes for \u003cth\u003e\n      --td \u003cATTRS\u003e         Attributes for \u003ctd\u003e\n  -h, --help               Print help\n  -V, --version            Print version\n```\n\n## Use examples\n\nThis command reads data from `test/test.csv` and writes an HTML table to `test.html`:\n\n```sh\ncsv2html -o test.html tests/test.csv\n```\n\nThe following command takes semicolon-delimited data from `pub.csv`, starting with row 267.\nIt replaces the first column of the table with the row number starting at 1 (except in the header row, which is not changed).\nThe output is redirected to the file `pub.html`.\n\n```sh\ncsv2html pub.csv -d \\; -r -s 267 \u003e pub.html\n```\n\nThe same as above, but the output is a full HTML document instead of just the markup for the table:\n\n```sh\ncsv2html pub.csv -d \\; -r -s 267 -c \u003e pub.html\n```\n\nIf the input file is tab-delimited, use `\\t` as the deliminter argument.\n\n```sh\n# POSIX.\ncsv2html --delimiter '\\t' tests/test.tsv\n```\n\n```batch\nrem Windows.\ncsv2html-win32.exe --delimiter \\t tests/test.tsv\n```\n\n`\\t` is the only [backslash escape sequence](https://en.wikipedia.org/wiki/Escape_sequences_in_C) that is implemented.\n\n## License\n\nThree-clause (\"new\" or \"revised\") BSD.\nSee the file `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbohdan%2Fcsv2html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbohdan%2Fcsv2html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbohdan%2Fcsv2html/lists"}