Announce: csv_xs.py

S

Skip Montanaro

Christian> i had developed my own csv class which is inspired by perls
Christian> csv_xs module.

Can you explain what you liked about Perl's csv_xz package and/or didn't
like about Python's csv module that motivated you to write your own class?

Thx,

Skip
 
C

Christian Meissner

Can you explain what you liked about Perl's csv_xz package and/or didn't
like about Python's csv module that motivated you to write your own class?

Thx,

Skip

I'm a native perl speaker, but at my last work i had to learn python, to
edit some zope thinks (quite difficult).

Now i wanna learn python for me and i often work with csv files with perl
but now i wanna develop some python programs for csv file working.
In this task i would extend the csv module for my needs but there i get any
errors, so it was easier for me to develop a class which is like the perl
one.

hope it is ok
Chris
 
I

Istvan Albert

Christian said:
I had developed my own csv class which is inspired by perls csv_xs module.

What you do is not csv parsing!

You are just splitting the rows by
the separator character (a triviality).
But this character may be inside the field
enclosed within quotation characters.


Istvan.
 
C

Christian Meissner

What you do is not csv parsing!
You are just splitting the rows by
the separator character (a triviality).
But this character may be inside the field
enclosed within quotation characters.


Istvan.

atm it is work in progress, so i will extends it if it is nessesary ...
 
S

Skip Montanaro

Chris> ... i will extends it if it is nessesary ...

Trust me, you will eventually find it to be necessary. ;-)

Skip
 
J

John Machin

Christian Meissner said:
I'm a native perl speaker, but at my last work i had to learn python, to
edit some zope thinks (quite difficult).

Now i wanna learn python for me and i often work with csv files with perl
but now i wanna develop some python programs for csv file working.
In this task i would extend the csv module for my needs

What are your needs, that are not covered by Python's csv module?
You have this comment near the beginning of your source file:
"This File contains classes, which enable you to get mor efficient
access to
csv - files."
How do you define efficiency? Speed of reading files? Last time I
looked, the guts of the Python csv module was written in C. Memory
footprint? Try sucking in a file with a few million records with your
module and check the memory usage.

but there i get any
errors,

What errors did you get when you tried to use the Python module?
so it was easier for me to develop a class which is like the perl
one.

hope it is ok

Istvan has already covered this topic.
 
Y

Y2KYZFR1

Christian Meissner said:
I'm a native perl speaker, but at my last work i had to learn python, to
edit some zope thinks (quite difficult).

Now i wanna learn python for me and i often work with csv files with perl
but now i wanna develop some python programs for csv file working.
In this task i would extend the csv module for my needs but there i get any
errors, so it was easier for me to develop a class which is like the perl
one.

hope it is ok
Chris

to a hammer everything looks like a nail!
 
M

Mike Meyer

I'm a native perl speaker, but at my last work i had to learn python, to
edit some zope thinks (quite difficult).

Now i wanna learn python for me and i often work with csv files with perl
but now i wanna develop some python programs for csv file working.
In this task i would extend the csv module for my needs but there i get any
errors, so it was easier for me to develop a class which is like the perl
one.

hope it is ok
Chris

If I interpret this correctly as "get many errors", then you're
throwing away one of the benefits Python has over Perl. Perl silently
does something implicit with errors in your data. Python requires that
they be dealt with explicitly. It may be that Perl does the right
thing for you. But in many cases, Perl *doesn't* do the right
thing. Python lets you decide how to deal with them, and makes that
explicit.

<mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top