Coder Social home page Coder Social logo

sepandhaghighi / csv2yaml Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 2.0 339 KB

๐Ÿ”ง Quick & Easy CSV To JSON, YAML & Pickle Converter

License: MIT License

Python 100.00%
csv pickle json csv2json csv2yaml yaml csv2pickle converter conversion python python3 script json-data

csv2yaml's Introduction

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 [email protected].

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.