Skip to content
simple impex generator
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Simpex – Ruby library for simple ImpEx generation

The impex torture is over guys! Enjoy your hybris projects with a nice ruby api for impex generation!

Simpex will make your life easier because:

  • it will remove the “csv noise” from your eyes
  • let you focus on the important stuff, building relationships between your impex tables
  • process any incoming format like xml, excel, csv with the power of ruby
  • do basic impex validations for you before hybris does it: asserting number of attributes and values, asserting the presense of macros
  • handle huge file sets and write to a file after 20000 entries in the whole tree ( set @memory_safe = true and setup the max_type_entries_in_tree all in the impex_result.rb)
  • generate the right files names with right index numbers so hyris can process them in the right order
  • simpex is bullet proof and was used and developed for a huge ecommerce project in cooperation with

Ready? Here it comes:

product_type =“Product”, %w{code[unique=true] name[lang=en] name[lang=de] unit(code) $catalogVersion supercategories(code)})

product =, %w{555 myproduct555 meinproduct555 pieces SimpexProducts:Online SampleCategory})

assert_equal “555”, product.code
assert_equal “pieces”, product.unit
assert_equal “SampleCategory”, product.supercategories

Never worry about the order of rows any more just create a hash specifying the attributes:

product2 =, {"code" => “333”, “name” => "MyName"})

Just use full string attribute names for ambigious attributes like

assert_equal “myproduct555”, product.get(“name[lang=en]”)
assert_equal “meinproduct555”, product.get(“name[lang=de]”)

Now lets build some real references:

catalog_type =“Catalog”, %w{id[unique=true] name[lang=de] name[lang=en] defaultCatalog})
#now create a catalog, by giving the type ‘catalog_type’ to the constructor, it will be registered for the future generation
catalog =, %w{simpex_catalog SimpexCatalog SimpexCatalog true})

catalog_version_type =“CatalogVersion”, %w{catalog(id)[unique=true] version[unique=true] active defaultCurrency(isocode)})
catalog_version =, [, “online”, “true”, “EUR”, “de,en”])

Now add averything to a main object managing the files creation:
result =“your/impex/folder”)

#Each type, containts all the entries for this type, so entries are listed there for generation, now you just have to add the types to the result
result << catalog_type
result << product_type

#now lets generated the result, memory leaks will be avoiaded by not exeeding more than 2000 entries in a type
result.impexify # => will write separate files for each type
result.impexify(“basic_setup.csv”) # => will write all tables to one file in the folder your/impex/folder

Thats it!


rvm install 1.9.1
cd to directory and run bundle install

ImpEx file generation

For now it only generates a dummy ImpEx file.
Run rake simpex:generate
You can find the generated file in ‘tmp/’

Run rake simpex:test to execute all tests

You can’t perform that action at this time.