DOKK / manpages / debian 12 / libcatmandu-perl / Catmandu.3pm.en
Catmandu(3pm) User Contributed Perl Documentation Catmandu(3pm)

Catmandu - a data toolkit

    # From the command line
    # Convert data from one format to another
    $ catmandu convert JSON to CSV  < data.json
    $ catmandu convert CSV  to YAML < data.csv
    $ catmandu convert MARC to YAML < data.mrc
    # Fix data, add, delete, change fields
    $ catmandu convert JSON --fix 'move_field(title,my_title)' < data.json
    $ catmandu convert JSON --fix all_my_fixes.txt < data.json
    # Use a moustache preprocessor on the fix script
    $ catmandu convert JSON --fix all_my_fixes.txt --var opt1=foo --var opt2=bar < data.json
    # run a fix script
    $ catmandu run myfixes.fix
    # or, create an executable fix script
    $ cat myfixes.fix
    #!/usr/local/bin/catmandu run
    do importer(OAI,url:"http://biblio.ugent.be/oai")
        retain(_id)
    end
    $ chmod 755 myfixes.fix
    $ ./myfixes.fix

Catmandu provides a command line tools for the conversion of various data formats including: JSON, YAML, RDF, CSV, TSV, XML and even Excel. Using extension modules, specialized conversions for metadata formats using in libraries, archives and museums is also supports. We provide support for MARC, MAB, MODS, OAI-PMH, PICA, PNX, RIS, LIDO, SRU and Z39.50.

Specialized conversions require a mapping language. This is implemented in Catmandu using the `Fix` language. For a short introduction read Catmandu::Introduction. Online tutorials can be found at the end of this document.

    # Clone the directory
    git clone https://github.com/LibreCat/Catmandu
    # Build
    cd Catmandu
    cpanm -n -q --installdeps --skip-satisfied .
    perl Build.PL && ./Build && ./Build install

    docker build -t librecat/catmandu .
    
    # Run catmandu with access to you local files at <YourDrive>
    docker run -v <YourDrive>:/home/catmandu/Home  -it librecat/catmandu
    # E.g.
    docker run -v C:\Users\alice:/home/catmandu/Home -it librecat/catmandu

    cpanm install <PackageName>
    # E.g.
    cpanm install Catmandu::MARC

Catmandu::Breaker

Catmandu::Identifier

Catmandu::MARC

Catmandu::OAI

Catmandu::PICA

Catmandu::RDF

Catmandu::SRU

Catmandu::Stat

Catmandu::Template

Catmandu::Validator

Catmandu::XLS

Catmandu::XSD

Catmandu::Z3950

Catmandu::Introduction
<http://librecat.org/>
<https://librecatproject.wordpress.com/>
<https://librecatproject.wordpress.com/2014/12/01/day-1-getting-catmandu/>
catmandu
Catmandu::PerlAPI

Nicolas Steenlant, "<nicolas.steenlant at ugent.be>"

Patrick Hochstenbach, "patrick.hochstenbach at ugent.be"

Nicolas Franck, "nicolas.franck at ugent.be"

Johann Rolschewski, "jorol at cpan.org"

Vitali Peil, "vitali.peil at uni-bielefeld.de"

Jakob Voss, "nichtich at cpan.org"

Magnus Enger, "magnus at enger.priv.no"

Christian Pietsch, "christian.pietsch at uni-bielefeld.de"

Dave Sherohman, "dave.sherohman at ub.lu.se"

Snorri Briem, "snorri.briem at ub.lu.se"

Pieter De Praetere, "pieter.de.praetere at helptux.be"

Doug Bell

Upsana, "me at upasana.me"

Stefan Weil

Tom Hukins

For any questions on the use of our modules please join our mailing list at:

    librecat-dev@lists.uni-bielefeld.de

or send in your bug reports or feature requests to our issue tracker at:

    https://github.com/LibreCat/Catmandu/issues

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See <http://dev.perl.org/licenses/> for more information.

2023-03-03 perl v5.36.0