Created
June 25, 2013 14:45
-
-
Save jbspeakr/5859033 to your computer and use it in GitHub Desktop.
Check http://www.datahack.it for further conversion snippets!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import yaml | |
i = open('input.csv', 'r') | |
reader = csv.DictReader(i) | |
data = yaml.safe_dump([row for row in reader], canonical=False, | |
encoding='utf-8', allow_unicode=True, | |
default_flow_style=False) | |
o = open('output.yaml', 'w') | |
o.write(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment