{"id":34743616,"url":"https://github.com/kpym/csvplate","last_synced_at":"2026-05-25T03:34:37.465Z","repository":{"id":324420715,"uuid":"1096019000","full_name":"kpym/csvplate","owner":"kpym","description":"Command-line utility that turns rows from a CSV file into rendered Go templates.","archived":false,"fork":false,"pushed_at":"2025-11-15T17:29:56.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-15T19:21:37.642Z","etag":null,"topics":["csv","template"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kpym.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-13T20:40:58.000Z","updated_at":"2025-11-15T17:29:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kpym/csvplate","commit_stats":null,"previous_names":["kpym/csvplate"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/kpym/csvplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpym%2Fcsvplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpym%2Fcsvplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpym%2Fcsvplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpym%2Fcsvplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kpym","download_url":"https://codeload.github.com/kpym/csvplate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpym%2Fcsvplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28019466,"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-12-25T02:00:05.988Z","response_time":58,"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","template"],"created_at":"2025-12-25T04:28:10.689Z","updated_at":"2026-05-25T03:34:37.436Z","avatar_url":"https://github.com/kpym.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csvplate\r\n\r\ncsvplate is a command-line utility that turns rows from a CSV file into rendered Go templates. You can generate a single aggregated output or one file per row.\r\n\r\n## Usage\r\n\r\n```text\r\n\u003e csvplate -h\r\ncsvplate (version: --): a CSV templated file generator\r\n\r\nUsage: csvplate [options]\r\nOptions:\r\n  -i, --csv string        Path to input CSV file, or the CSV content itself\r\n  -t, --template string   Path to Go template file, or the template content itself\r\n  -o, --out string        Output file path (may include template expressions)\r\n  -c, --counter string    The field name to use for the row counter (default \"_index_\")\r\n  -n, --noheader          Treat CSV as having no header row\r\n  -s, --skip string       Number of lines to skip or regex to match the first (header) line\r\n  -f, --force             Overwrite existing output files\r\n  -d, --csv-sep string    CSV field separator (default \",\")\r\n\r\nMode of operation:\r\n  If the output file name contains template expressions ({{...}}), one file per row\r\n  will be created, else a single file will be created with all rows.    \r\n  In single file mode, the dot (.) in the template is a slice of objects (one per row).\r\n  In per-row mode, the dot (.) in the template is a single object (the current row).\r\n  The first line of the CSV is assumed to be the header line and will be used as field names,\r\n  except if the --noheader flag is set in which case the fields will be named C1, C2, ...\r\n  The field name specified with --counter will contain the row number (starting at 1).\r\n  If --csv or --template is omitted or empty, stdin is used.\r\n  If --out is omitted or empty, stdout is used in single file mode.     \r\n  If the output file already exists, an error is returned unless --force is set.\r\n  If --csv or --template is not an existing file, it is treated as the actual content.\r\n  The template functions from Sprout are available in the templates.    \r\n\r\nExamples:\r\n  csvplate --csv data.csv --template template.txt --out output.txt      \r\n  csvplate -f -i data.csv -t template.txt -o output_{{.Name}}.txt       \r\n  csvplate -i data.csv -d ';' -s 2 -t template.txt\r\n  cat data.csv | csvplate -n -t template.txt\r\n```\r\n\r\n## Template data model\r\n\r\n- Each CSV row becomes a `map[string]string` keyed by column headers (or `C1`, `C2`, ... when `--noheader` is used).\r\n- The special key defined by `--counter` provides a 1-based row index as a string.\r\n- For single-output mode, the template receives a slice of those maps. In per-row mode the template receives the map for the current row.\r\n- All [sprout](https://docs.atom.codes/sprout/registries/list-of-all-registries) template functions are available.\r\n\r\n## Examples\r\n\r\nRender a single file containing all rows:\r\n\r\n```shell\r\ncsvplate -i sample.csv -t all_rows.tmpl -o output/all.txt -f\r\n```\r\n\r\nRender one file per CSV row using a dynamic file name:\r\n\r\n```shell\r\ncsvplate -i sample.csv -t per_row.tmpl -o \"output/{{ .Name }}.txt\" -f\r\n```\r\n\r\nRender a semicolon-delimited CSV by providing an explicit separator and skipping the first line:\r\n\r\n```shell\r\ncsvplate --csv french.csv --csv-sep ';' --skip 1 --template all_rows.tmpl --out output/fr_all.txt --force\r\n```\r\n\r\nYou can check the `example/` folder to see the provided examples and templates.\r\n\r\n## Installation\r\n\r\n### Precompiled executables\r\n\r\nYou can download the executable for your platform from the [releases](https://github.com/kpym/csvplate/releases).\r\n\r\n### Compile it yourself\r\n\r\n```shell\r\ngo install github.com/kpym/csvplate@latest\r\n```\r\n\r\n## License\r\n\r\nReleased under the [MIT License](LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpym%2Fcsvplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkpym%2Fcsvplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpym%2Fcsvplate/lists"}