[Erp5-dev] Proposal for CSV import/export enhancements

Jean-Paul Smets jp at nexedi.com
Wed Oct 17 14:43:41 CEST 2007


Jérome Perrin a écrit :
> Łukasz Nowak a écrit :
>   
>> Hello,
>>
>> While playing with production we are able to import BOMs and many
>> other useful information from various CAD/CAM/etc programs using CSV.
>>
>> As CSV is quite...hm...undefined, there are many problems. Many
>> programs use different implementation of CSV - some of them use ";" as
>> separator some ",". Some use '"' as quote mark, some "'". Some use
>> UTF-8 encoding, some other ASCII, and so on. So, IMHO, importing of
>> CSV might be two-phase system. First one upload file, second one
>> choose some attributes and provide user special listbox, which will
>> "simulate" how will system understand provided CSV. Something similar
>> to OpenOffice CSV import/export dialog.
>>     
>
> Hi,
>
> As you pointed out, despite looking simple, csv is in reality extremly 
> complex (you can look at python csv module implementation), that's one 
> more reason why we concentrate on importing from OpenOffice. It still 
> needs improvement, but here's what we have today:
>
> - Import of categories from a spreadsheet (Import/Export action from 
> portal_categories). This uses oood to convert this input file, if for 
> instance you upload a .xls file. I haven't try with CSV, I don't know if 
> oood can convert from CSV.
>   
>From what I know, import from categories uses sxc file as input.
>   - There is an interesting prototype on person module: "Import Persons 
> from OpenOffice Calc".
> This tool propose to map openoffice column to document properties. As 
> far as I know it doesn't work for categories, and probably have other 
> problems, but it's IMHO a good start.
>   
It should work for categories (ie. to map values to categories). I saw
it work 1 year ago.
I would be quite easy to add a step of conversion to ODS/SXC file

> As far as I know this is the current status of OOo import in ERP5. If we 
> want better csv support, one way might be to add more csv to ods / ods 
> to csv support directly in oood, by "normalizing" csv in python using 
> csv module. This is just an idea, I haven't tried it at all, and I'm not 
> sure that information like "this column is numeric" can be kept with csv 
> only anyway ...
>   
I recommend to add a call to oood in order to convert input files before
processing to the import. This way, the import tools become universal
and support all formats.

Maybe you shoudl also point to ODS export skin which includes some
universal export capability. It is interesting because it shows that it
can be very easy to add the feature of conversion to import / export
with oood.

Regards,

JPS.
> Jérome
> _______________________________________________
> Erp5-dev mailing list
> Erp5-dev at erp5.org
> http://mail.nexedi.com/mailman/listinfo/erp5-dev
>   


-- 
Jean-Paul Smets-Solanes, Nexedi CEO - Tel. +33(0)6 62 05 76 14
Nexedi: Consulting and Development of Libre / Open Source Software
http://www.nexedi.com
ERP5: Libre/ Open Source ERP Software for small and medium companies
http://www.erp5.org






More information about the Erp5-dev mailing list