Skip to content

🔧 Quick & Easy CSV To JSON, YAML & Pickle Converter

License

Notifications You must be signed in to change notification settings

sepandhaghighi/csv2yaml

Repository files navigation

CSV2YAML

Convert CSV File To JSON, YAML & Pickle


Installation

Source Code

  • Download Version 0.2 or Latest Source
  • pip3 install -r requirements.txt or pip install -r requirements.txt (Need root access)
  • python3 setup.py install or python setup.py install

PyPI

Usage

Command Line

  • Run csv2yaml with file as argument python3 -m csv2yaml file.csv header_optional or python -m csv2yaml file.csv header_optional on Mac,Linux or Windows
  • Run python3 -m csv2yaml all header_optional or python -m csv2yaml all header_optional to convert all csv files in folder
  • Default Header : Filename
csv2yaml usage

Automated Build

Linux Windows

Input File Format

	Key1,Key2,...,KeyN
	Value11,Value12,...,Value1N
	.
	.
	.
	ValueN1,ValueN2,...,ValueNN

Output File Format

  • JSON(.json)

     	{
     	"header_name": {
     			"data":[
     			{
     				"id"  : "1",
     				"Key1": "Value11",
     				"Key2": "Value12",
     				.
     				.
     				.
     				"KeyN": "Value1N"
     			},
    
     			.
     			.
     			.
    
     			{
     				"id"  : "N",
     				"Key1": "ValueN1",
     				"Key2": "ValueN2",
     				.
     				.
     				.
     				"KeyN": "ValueNN"
     			},
     			]
     		}
     	}
    
  • YAML(.yaml)

     	header_name:
     		data:
     		- Key1: "Value11"
     	  	Key2: "Value12"
     	  	.
             .
             .
     		KeyN: "Value1N"
     		id  : "1"
     	
     		.
     		.
     		.
    
     		- Key1: "ValueN1"
     	  	Key2: "ValueN2"
     	  	.
             .
             .
     		KeyN: "ValueNN"
     		id  : "N"
    
    
  • Pickle(.p) (Binary Format)

TODO

  • Formats
    • JSON
    • YAML
    • Pickle

Issues & Bug Reports

Just fill an issue and describe it. We'll check it ASAP! or send an email to sepand@qpage.ir.

Contribution

You can fork the repository, improve or fix some part of it and then send the pull requests back if you want to see them here. I really appreciate that. ❤️

Remember to write a few tests for your code before sending pull requests.

Donate to our project

If you feel like our project is important can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do.

Bitcoin :

1XGr9qbZjBpUQJJSB6WtgBQbDTgrhPLPA

Payping (For Iranian citizens) :

License