Skip to content
 
 

Latest commit

 

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jinja-csv

Use Jinja2 templates to format data from CSV files.

Installation

Works on Python 3.4+.

pip3 install https://github.com/gabihodoroaga/jinja-csv/releases/download/v0.2/jinja_csv-0.2-py3-none-any.whl

or

git clone https://github.com/gabihodoroaga/jinja-csv.git

cd jinja-csv

python3 setup.py install

Example usage

Simple usage with output

jinja-csv -i example/users.csv -t example/users.j2 -o example/users.sql

If you don't specify the output argument then you can pipe the result to another command.

jinja-csv -i example/users.csv -t example/users.j2 | mysql -u root -p testdb

Arguments

-i, --inputfile     The input csv file.
-t, --template      The Jinja template file
-o, --output        The output file, or the output folder when --file argument is present
-f, --files         Generate one file per row
-r, --row           Index of the row to be used for the name of the file
-e, --ext           The file extension to be used

Build

python3 setup.py build
python3 setup.py sdist

Authors

  • Raymond Chee (original author)
  • Gabriel Hodoroaga

Acknowledgments

Forked from github.com/rjchee/jinja-csv, fixed some issues and created the setup.

About

Use Jinja2 templates to format data from CSV files.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages