https://github.com/ehanlin/csv-map-converter
It is csv converter to be able to get multi-values.
https://github.com/ehanlin/csv-map-converter
Last synced: 11 months ago
JSON representation
It is csv converter to be able to get multi-values.
- Host: GitHub
- URL: https://github.com/ehanlin/csv-map-converter
- Owner: eHanlin
- License: mit
- Created: 2017-02-21T09:56:07.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-16T09:04:16.000Z (over 3 years ago)
- Last Synced: 2025-01-31T11:12:32.732Z (over 1 year ago)
- Language: Python
- Size: 20.5 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
csv_map_converter
=========================================================
[](https://travis-ci.org/eHanlin/csv-map-converter)
It's able to convert csv data when you need get model from csv.
## Install
```sh
pip install csv-map-converter
```
## Usage
```py
import csv
import io
import csv_map_converter
from csv_map_converter.models.fields import *
class User():
enabled = BooleanField()
account = StringField()
password = StringField()
csv_data = io.StringIO(u"""enabled, account, password
1,tomcat,1234
0,apache,1234
""")
rows = [row for row in csv.reader(csv_data)]
result = csv_map_converter.convert(rows, User)
print(result.models)
```
## Test
```sh
tox
```