Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sepandhaghighi/csv2yaml

🔧 Quick & Easy CSV To JSON, YAML & Pickle Converter
https://github.com/sepandhaghighi/csv2yaml

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

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        


CSV2YAML



Convert CSV File To JSON, YAML & Pickle



----------



Codecov


PyPI version

## Installation
### Source Code
- Download [Version 0.2](https://github.com/sepandhaghighi/csv2yaml/archive/v0.2.zip) or [Latest Source ](https://github.com/sepandhaghighi/csv2yaml/archive/master.zip)
- `pip3 install -r requirements.txt` or `pip install -r requirements.txt` (Need root access)
- `python3 setup.py install` or `python setup.py install`

### PyPI

- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
- `pip install csv2yaml` or `pip3 install csv2yaml` (Need root access)

## 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)](https://en.wikipedia.org/wiki/JSON)

```
{
"header_name": {
"data":[
{
"id" : "1",
"Key1": "Value11",
"Key2": "Value12",
.
.
.
"KeyN": "Value1N"
},

.
.
.

{
"id" : "N",
"Key1": "ValueN1",
"Key2": "ValueN2",
.
.
.
"KeyN": "ValueNN"
},
]
}
}
```

- [YAML(.yaml)](https://en.wikipedia.org/wiki/YAML)
```
header_name:
data:
- Key1: "Value11"
Key2: "Value12"
.
.
.
KeyN: "Value1N"
id : "1"

.
.
.

- Key1: "ValueN1"
Key2: "ValueN2"
.
.
.
KeyN: "ValueNN"
id : "N"

```

- [Pickle(.p)](https://docs.python.org/3.5/library/pickle.html) (Binary Format)
## TODO

- [x] Formats
- [x] JSON
- [x] YAML
- [x] Pickle

## Issues & Bug Reports

Just fill an issue and describe it. We'll check it ASAP!
or send an email to [[email protected]](mailto:[email protected] "[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