{"id":26638070,"url":"https://github.com/c-seeger/csv2json","last_synced_at":"2026-04-21T05:35:07.988Z","repository":{"id":98770793,"uuid":"140403438","full_name":"c-seeger/csv2json","owner":"c-seeger","description":"csv2json converter written in go","archived":false,"fork":false,"pushed_at":"2021-08-16T12:36:42.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T17:28:37.844Z","etag":null,"topics":["csv","csv-parser","elk","elk-stack","json","json-export"],"latest_commit_sha":null,"homepage":null,"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/c-seeger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2018-07-10T08:43:49.000Z","updated_at":"2021-08-16T12:36:44.000Z","dependencies_parsed_at":"2023-05-25T07:00:16.932Z","dependency_job_id":null,"html_url":"https://github.com/c-seeger/csv2json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/c-seeger/csv2json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-seeger%2Fcsv2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-seeger%2Fcsv2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-seeger%2Fcsv2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-seeger%2Fcsv2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c-seeger","download_url":"https://codeload.github.com/c-seeger/csv2json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-seeger%2Fcsv2json/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266463446,"owners_count":23932900,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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","csv-parser","elk","elk-stack","json","json-export"],"created_at":"2025-03-24T17:25:05.007Z","updated_at":"2026-04-21T05:35:02.954Z","avatar_url":"https://github.com/c-seeger.png","language":"Go","readme":"# csv2json\n\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=VBXHBYFU44T5W\u0026source=url)\n[![GoDoc](https://img.shields.io/badge/godoc-reference-green.svg)](https://godoc.org/github.com/c-seeger/csv2json)\n[![Go Report Card](https://goreportcard.com/badge/github.com/c-seeger/csv2json)](https://goreportcard.com/report/github.com/c-seeger/csv2json)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/c-seeger/csv2json/blob/master/LICENSE)\n[![Build Status](https://travis-ci.com/c-seeger/csv2json.svg?branch=master)](https://travis-ci.com/c-seeger/csv2json)\n[![Built with Mage](https://magefile.org/badge.svg)](https://magefile.org)\n\nis a [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) to [JSON](https://en.wikipedia.org/wiki/JSON) converter inspired by the work of [CSV-To-JSON-Converter](https://github.com/Ahmad-Magdy/CSV-To-JSON-Converter).\n\nThis project was created by the intension to create json files from csv for importing the data into an ELK stack since JSON supports more options than CSV for ELK.\n\n## Features\n\n- convert csv to json\n- adding additional fields that are not in the original csv file\n- options PrettyPrint, QuoteEverything and LineWiseJSON\n\n## Installation\n\nIf you already installed GO on your system and configured it properly than its simply:\n\n```\ngo get github.com/c-seeger/csv2json\n```\n\nIf not follow [these instructions](https://nats.io/documentation/tutorials/go-install/).\n\n## Usage\n\n### Simple example\n\nThe following example reads a csv file defined by -c parameter and outputs to a file defined by -o\n\n```\nfunc main() {\n  // read and convert csv\n  f, err := os.Open(\"test/fixtures/data.csv\")\n  if err != nil {\n    log.Fatal(err)\n  }\n  defer f.Close()\n\n  // optional add additional fields\n  addFields := make(map[string]string)\n  addFields[\"addedField\"] = \"some data\"\n\n  bytes, err := csv2json.ReadCSV(f, addFields, csv2json.Options{\n    PrettyPrint:     true,\n    LineWiseJSON:    false,\n    QuoteEverything: false,\n  })\n  if err != nil {\n    log.Fatal(err)\n  }\n\n  fmt.Println(string(bytes))\n}\n\n```\n\n### Options\n\nThere are some options available in the `csv2json.Options` struct:\n\n```\ntype Options struct {\n        LineWiseJSON    bool\n        PrettyPrint     bool\n        QuoteEverything bool\n}\n```\n\n- LineWiseJSON\n  - creates a json line per csv line and concats all lines together in one file\n  - this feature is usefull if you want to generate JSON files from csv's as a data source for an ELK stack\n  - if this is set to false a jSON array with every line as an entry will be created\n- PrettyPrint\n  - more readable multiline version of json\n- QuoteEverything\n  - ignores any kind of datatypes and quotes everything\n\n## Contribution\n\nThank you for participating to this project.\nPlease see our [Contribution Guidlines](https://github.com/c-seeger/csv2json/blob/master/CONTRIBUTING.md) for more information.\n","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=VBXHBYFU44T5W\u0026source=url"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-seeger%2Fcsv2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc-seeger%2Fcsv2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-seeger%2Fcsv2json/lists"}