[Bug 8376] New: Command line utility for exporting borrowers
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Priority: P5 - low Change sponsored?: --- Bug ID: 8376 Assignee: julian.maurice@biblibre.com Summary: Command line utility for exporting borrowers Severity: enhancement Classification: Unclassified OS: All Reporter: julian.maurice@biblibre.com Hardware: All Status: ASSIGNED Version: master Component: Command-line Utilities Product: Koha -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 10665 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10665&action=edit Bug 8376: New script to export borrowers misc/export_borrowers.pl This script prints to standard output what is returned by GetMemberDetails in CSV format. Exported fields can be specified with option -f. If no -f option is specified, all fields are exported. Usage: misc/export_borrowers.pl [--field=FIELD [--field=FIELD [...]]] [--show-header] misc/export_borrowers.pl -h -f, --field=FIELD Field to export. It is repeatable and has to match keys returned by the GetMemberDetails function. If no field is specified, then all fields will be exported. -H, --show-header Print field names on first row -h, --help Show this help -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 --- Comment #2 from Gaetan Boisson <gaetan.boisson@biblibre.com> --- Created attachment 10672 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10672&action=edit [SIGNED-OFF] Bug 8376: New script to export borrowers misc/export_borrowers.pl This script prints to standard output what is returned by GetMemberDetails in CSV format. Exported fields can be specified with option -f. If no -f option is specified, all fields are exported. Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Gaetan Boisson <gaetan.boisson@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |gaetan.boisson@biblibre.com --- Comment #3 from Gaetan Boisson <gaetan.boisson@biblibre.com> --- Tested various exciting possiblities : - Exporting borrowers with or without headers - Exporting data with commas inside the fields - Exporting a specified set of fields - Specifying a field that doesn't exist (you'll just get an empty column in the csv) It all works really well. Signing off! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Gaetan Boisson <gaetan.boisson@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10665|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |ASSIGNED CC| |robin@catalyst.net.nz --- Comment #4 from Robin Sheat <robin@catalyst.net.nz> --- Found an issue: if a record contains an invalid character (e.g. a newline), a blank line is output. It's possible to see that something went wrong by noting that $csv->string is empty/undefined. It's also possible to make it deal with these by putting {binary=>1} in the contructor for Text::CSV. I've added some code to improve handling of funny data, and announcing that something is wrong when it can't be handled. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 --- Comment #5 from Robin Sheat <robin@catalyst.net.nz> --- Created attachment 11033 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=11033&action=edit Bug 8376: New script to export borrowers misc/export_borrowers.pl This script prints to standard output what is returned by GetMemberDetails in CSV format. Exported fields can be specified with option -f. If no -f option is specified, all fields are exported. Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com> Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Amended with some code to better handle bad data. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |jonathan.druart@biblibre.co | |m --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- QA Comments: Works well, code clean. Marking as Passed QA. It would be great to specify a list of borrowernumber (or cardnumber) to export (with a file given in parameter for example). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10672|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |paul.poulain@biblibre.com Version|master |rel_3_10 --- Comment #7 from Paul Poulain <paul.poulain@biblibre.com> --- QA comment: passes perlcritic (In reply to comment #6)
It would be great to specify a list of borrowernumber (or cardnumber) to export (with a file given in parameter for example).
Other possible enhancements : * provide the separator in a parameter * add a WHERE clause to filter, for example, on a given zipcode, categorycode, email,... Another comment: we don't have a coding guideline for that, but I think we should: the help should be in POD, like what we have, for example, in: misc/maintenance/touch_all_biblios.pl use Pod::Usage; sub usage { pod2usage( -verbose => 2 ); exit; } i'll send a mail to koha-devel to propose this rule. Patch pushed, though -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- Ok in master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8376 Sophie MEYNIEUX <sophie.meynieux@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |9045 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org