Skip to content

Map any csv to any other csv format. It comes with useful helper to fill columns with static files, or map even values. Specifically used to import csv data from multiple files with filter and modifier.

License

Notifications You must be signed in to change notification settings

grafzahl-io/csv-mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A csv mapping script

It is build to map any csv to any other csv format. It comes with useful helper to fill columns with static files, or map even values

csv-mapper.py

csv-static-mappings.json can contain field keys and values that are applied to every row in the product csv source file csv-field-mappings.json defines the field mappings from the source file to the defined destination file for the destination format

if a field is not defined here (which is present in the dataheader list below), it is automatically fetched from the 'csv-static-mappings.json'

The file 'csv-list-mappings.json' can be used to map list / dictionary values of the source fields. e.g. category in source file with IDs are mapped by defining the destination field key (category_id) in this file and adding an object as value and map key=source value=destination destination would be the destination category key

quick start:

make install
source env/bin/activate
python ./csv-mapper.py ./source/source_file.csv ./dist/destination_file.csv --imagepath="https://yourhost.com/images/" --imagefield="image"
~ deactivate

improvement plans

  • needs to be improved an parametrized at many points
  • add new layers to make current hardcoded data configurable
    • e.g. fields that are compiled with different parts of the source data
    • e.g. the automatic search for available images found by specified name pattern
  • add more conditions for filters

About

Map any csv to any other csv format. It comes with useful helper to fill columns with static files, or map even values. Specifically used to import csv data from multiple files with filter and modifier.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published