Easy to use library and CLI utility to generate Go struct from CSV files.

Overview

csv2struct

Easy to use library and CLI utility to generate Go struct from CSV files. As a benefit, it's fully compatible with csvutil. So, structs generated by this utility can be used with that library.

Install

go get -u github.com/Koshqua/csv2struct

Usage

NAME:
   csv2struct - Converts csv files to golang structs compatible with https://github.com/jszwec/csvutil

USAGE:
   csv2struct [global options] command [command options] [arguments...]

AUTHOR:
   Ivan Malovanyi (https://github.com/Koshqua)

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --from value, -f value        specify which csv file to use
   --to value, -t value          specify the output .go file
   --typename value, --tn value  specify how to name output type
   --csvsep value, --cs value    specify the csv separator (default: ",")
   --casetype value, --ct value  specify the headers case type, possible values are: pascal, camel, kebab, snake, space (default: "pascal")
   --verbose, -v                 verbose logging (with debug) (default: false)
   --help, -h                    show help (default: false)

Example

csv2struct -f ./test.csv -t ./blah.go -tn Blah --casetype space  

Also, it's available as library. Will provide usage examples a bit later...

Contribution

Your contribution to the project is welcomed and appreciated.

Owner
Ivan Maliovaniy
Software Engineer. Working mostly with Go.
Ivan Maliovaniy
Go generator to copy values from type to type and fields from struct to struct. Copier without reflection.

Copygen is a command-line code generator that generates type-to-type and field-to-field struct code without adding any reflection or dependenc

SwitchUpCB 121 May 15, 2022
Go-file-downloader-ftctl - A file downloader cli built using golang. Makes use of cobra for building the cli and go concurrent feature to download files.

ftctl This is a file downloader cli written in Golang which uses the concurrent feature of go to download files. The cli is built using cobra. How to

Dipto Chakrabarty 2 Jan 2, 2022
Command-line tool to load csv and excel (xlsx) files and run sql commands

csv-sql supports loading and saving results as CSV and XLSX files with data processing with SQLite compatible sql commands including joins.

Dhamith Hewamullage 22 May 6, 2022
Automatically generate Go (golang) struct definitions from example JSON

gojson gojson generates go struct definitions from json or yaml documents. Example $ curl -s https://api.github.com/repos/chimeracoder/gojson | gojson

Aditya Mukerjee 2.5k May 18, 2022
A fast diff tool for comparing csv files

csvdiff A fast diff tool for comparing csv files. What is csvdiff? Csvdiff is a difftool to compute changes between two csv files. It is not a traditi

Aswin Karthik 369 May 14, 2022
A piece of software that shouldn't need to exist. Processes badly formatted outputs from Morgan Stanley Shareworks into usable CSV files.

Shareworks-munger: A program to process Shareworks reports into Something Usable "Shareworks" is a product of Morgan Stanley which tracks certain kind

Eric Myhre 7 Apr 28, 2022
Simple and easy to use command line application written in Go for cleaning unnecessary XCode files.

xcclear Say hello to a few extra gigabytes of space on your Mac with xcclear, a simple and easy to use command line application written in Go for clea

null 49 May 20, 2022
A tool to manage all your boilerplate from cli and generate files for you !

A tool to manage all your boilerplate from cli and generate files for you !

null 26 Apr 11, 2022
A GitHub CLI extension to view and generate license files.

gh-license A GitHub CLI extension to view and generate license files. All license information is obtained from the GitHub API. NOTE: The only purpose

Shresht 2 Mar 16, 2022
A simple script to run speedtest(offical) CLI tool and store the results in CSV

PeriodicBW A script made to run official speedtest.net binary periodically and store the results in a CSV file Installation Get the official speedtest

Abhinav Krishna C K 6 Aug 10, 2021
CLI tool to rank proposals according to Majority Judgment, from an input CSV

Majority Judgment CLI tool WORK IN PROGRESS Although the core mechanics are here and ranking does work, the features described in this README are not

Mieux Voter 2 Nov 20, 2021
CLI filters the contents of the csv file according to the filters from the another file.

filtercsv CLI filters the contents of the csv file according to the filters from the another file. Made to process big files by a lots of filters. By

null 0 Dec 2, 2021
Simple, lightweight, and easy to use gopacket wrapper cli

gniffer Simple, lightweight, and easy to use gopacket wrapper cli Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About

StrixEye 4 Dec 25, 2021
Use the command to convert arbitrary formats to Go Struct (including json, toml, yaml, etc.)

go2struct-tool Use the command to convert arbitrary formats to Go Struct (including json, toml, yaml, etc.) Installation Run the following command und

Afeyer 1 Dec 16, 2021
An easy to use menu structure for cli applications that prompts users to make choices.

WMenu Package wmenu creates menus for cli programs. It uses wlog for its interface with the command line. It uses os.Stdin, os.Stdout, and os.Stderr w

Will Dixon 161 May 5, 2022
An easy-to-use cli tool for downloading manga

mangodl Download and search manga right from the terminal! Report Bug || Request Feature Table of Contents About the Project Built With Getting Starte

null 128 May 18, 2022
Easy to use CLI for cryptography

EDH (Encryption, Decryption, Hashing) Utility that aims to improve efficiency of encryption, decryption and hashing by making a simple to use CLI Writ

null 2 Nov 4, 2021
Rem is a CLI trash which makes it ridiculously easy to recover files.

Rem is a CLI trash which makes it ridiculously easy to recover files. We've all had that moment when we've deleted something we realised we shouldn't have. It sucks. Let's fix that!

Ishan Goel 43 Mar 31, 2022