.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "CATMANDU 1p" .TH CATMANDU 1p "2019-01-29" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" catmandu \- LibreCat command line tools .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& catmandu [\-D|\-D2|\-D3] [\-I path] [\-L path] [COMMAND] [\-?hqv] [long options...] [ARGS] \& \& catmandu \-\-version \& \& catmandu help \& \& # convert \& catmandu convert JSON to YAML < file.json \& catmandu convert YAML to JSON < file.yaml \& catmandu convert YAML < file.yaml # \*(Aqto JSON\*(Aq is implicit \& catmandu convert MARC < records.mrc \& catmandu convert MARC \-\-fix \*(Aqmarc_map(245,title)\*(Aq < records.mrc \& catmandu convert MARC \-\-fix myfixes.txt < records.mrc \& catmandu convert OAI \-\-url https://biblio.ugent.be/oai \& catmandu convert SRU \-\-base http://www.unicat.be/sru \-\-query dna \& \& # import \& catmandu import JSON to MongoDB \-\-database_name mydb < records.json \& catmandu import MARC to MongoDB \-\-database_name mydb < records.mrc \& catmandu import MARC to ElasticSearch \-\-index_name mydb < records.mrc \& catmandu import MARC to ElasticSearch \-\-index_name mydb \-\-fix \*(Aqmarc_map("245a","title")\*(Aq < records.mrc \& \& # export \& catmandu export MongoDB \-\-database_name mydb \-\-bag data to JSON \& catmandu export MongoDB \-\-database_name mydb \-\-bag data to JSON \-\-fix \*(Aqretain("_id")\*(Aq \& catmandu export Solr \-\-url http://localhost:8983/solr to JSON \& catmandu export ElasticSearch \-\-index_name mydb to JSON \& \& # copy \& catmandu copy MongoDB \-\-database_name mydb to ElasticSearch \-\-index_name mydb \& \& # show the contents of catmandu.yml \& catmandu config \& \& # count items in a store \& catmandu count test1 \& \& # delete items from store \& catmandu delete test1 \-q \*(Aqtitle:"My Rabbit"\*(Aq \& \& # 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 \& \& # configuration \& $ cat catmandu.yml \& \-\-\- \& store: \& test1: \& package: MongoDB \& options: \& database_name: mydb \& catmandu import JSON to test1 < records.json \& \& # show installed commands \& $ catmandu info \& $ catmandu info \-\-namespace XML .Ve .SH "COMMANDS" .IX Header "COMMANDS" .SS "help \s-1COMMAND\s0" .IX Subsection "help COMMAND" Documentation about command line options. .SS "config" .IX Subsection "config" Display the contents of the catmandu.yml files in your project. .SS "convert \s-1IMPORTER\s0 [\s-1OPTIONS\s0] [[\-\-fix \s-1FIX\s0]] to \s-1EXPORTER\s0 [\s-1OPTIONS\s0]" .IX Subsection "convert IMPORTER [OPTIONS] [[--fix FIX]] to EXPORTER [OPTIONS]" Convert data from one format to another format with help of Catmandu::Importers and Catmandu::Exporters. All options given on the command line will be send to the Importer or Exporter as initialization parameters. E.g. .PP .Vb 3 \& catmandu convert OAI \-\-url BASEURL \-\-metadataPrefx PREFIX \e \& to \e \& CSV \-\-header 1 \-\-sep_char \*(Aq|\*(Aq .Ve .PP Look at the documentation of all the importers and exporters to see which options are available. .PP All importers accept one or more \-\-fix options with the name of a fix file or file command. .PP .Vb 2 \& catmandu convert JSON \-\-fix fixes.txt \& catmandu convert JSON \-\-fix \*(Aqremove_field(abc)\*(Aq .Ve .PP The \s-1JSON\s0 exporter is implicit and is optional. .PP .Vb 2 \& catmandu convert YAML to JSON \& catmandu convert YAML # shorter .Ve .SS "copy \s-1STORE\s0 [\s-1OPTIONS\s0] [\-q \s-1QUERY\s0] [\-\-limit \s-1LIMIT\s0] [[\-\-fix \s-1FIX\s0]] to \s-1STORE\s0 [\s-1OPTIONS\s0]" .IX Subsection "copy STORE [OPTIONS] [-q QUERY] [--limit LIMIT] [[--fix FIX]] to STORE [OPTIONS]" Copy items from one Catmandu::Store to another. All options given on the command line will be send to the Stores as initialization parameters. Optionally a \s-1QUERY\s0 and \s-1LIMIT\s0 can be provided to selectively export items from the Store. Optionally a \s-1FIX\s0 can be provided to be executed on all the items before they are stored. .SS "count \s-1STORE\s0 [\s-1OPTIONS\s0]" .IX Subsection "count STORE [OPTIONS]" Count the number of items in a Catmandu::Store. All options given on the command line will be send to the store as initialization parameters. E.g. .PP .Vb 1 \& catmandu count MongoDB \-\-database_name mydb \-\-bag data .Ve .SS "delete \s-1STORE\s0 [\s-1OPTIONS\s0] [\-q \s-1QUERY\s0]" .IX Subsection "delete STORE [OPTIONS] [-q QUERY]" Delete items from a Catmandu::Store. All options given on the command line will be send to the store as initialization parameters. Optionally a \s-1QUERY\s0 can be provided to select the items to delete. E.g. .PP .Vb 1 \& catmandu delete MongoDB \-\-database_name mydb \-\-bag data \-q "title:Delete me" .Ve .SS "export \s-1STORE\s0 [\s-1OPTIONS\s0] [\-q \s-1QUERY\s0] [\-\-limit \s-1LIMIT\s0] [[\-\-fix \s-1FIX\s0]] to \s-1EXPORTER\s0 [\s-1OPTIONS\s0]" .IX Subsection "export STORE [OPTIONS] [-q QUERY] [--limit LIMIT] [[--fix FIX]] to EXPORTER [OPTIONS]" Export items from a Catmandu::Store using a Catmandu::Exporter. All options given on the command line will be send to the Store or Exporter as initialization parameters. Optionally a \s-1QUERY\s0 and \s-1LIMIT\s0 can be provided to selectively export items from the Store. Optionally a \s-1FIX\s0 can be provided to be executed on all the items before they are exporter by the exporter. .PP E.g. .PP .Vb 1 \& catmandu export MongoDB \-\-database_name mydb \-\-bag data \-q "title:Perl" .Ve .SS "import \s-1IMPORTER\s0 [\s-1OPTIONS\s0] [[\-\-fix \s-1FIX\s0]] to \s-1STORE\s0 [\s-1OPTIONS\s0]" .IX Subsection "import IMPORTER [OPTIONS] [[--fix FIX]] to STORE [OPTIONS]" Import items from a Catmandu::Importer to a Catmandu::Store. All options given on the command line will be send to the Importer or Store as initialization parameters. Optionally a \s-1FIX\s0 can be provided to be executed on all the items before they are stored into the Store. .PP .Vb 1 \& catmandu import JSON to MongoDB \-\-database_name mydb < records.json .Ve .SS "info [\s-1OPTIONS\s0]" .IX Subsection "info [OPTIONS]" List installed Catmandu modules (importers, exporters, stores, and fixes). .SS "run [\s-1FIX\s0]" .IX Subsection "run [FIX]" Execute a fix script or run an interactive Fix shell. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\-v" 4 .IX Item "-v" Verbose output. This includes progress of operations. .IP "\-h" 4 .IX Item "-h" .PD 0 .IP "\-?" 4 .IP "\-\-lib\-path \s-1PATH\s0" 4 .IX Item "--lib-path PATH" .IP "\-I" 4 .IX Item "-I" .PD Specifies Perl library include paths, like perl's \-I option. This option is repeatable. .IP "\-\-load\-path \s-1PATH\s0" 4 .IX Item "--load-path PATH" .PD 0 .IP "\-L \s-1PATH\s0" 4 .IX Item "-L PATH" .PD Search upwards from this path for configuration files and accompanying lib directories. This option is repeatable. .IP "\-\-var [\s-1NAME\s0]=[\s-1VALUE\s0]" 4 .IX Item "--var [NAME]=[VALUE]" Catmandu such as convert, import and export accept command line variables that can be read by any fix script provided. For instance, if provenance information need to be added to the output, then this can be provided via the command line: .Sp .Vb 1 \& $ catmandu convert MARC \-\-fix myfixes.txt \-\-var source=Springer \-\-var date=2016 < data.mrc .Ve .Sp with myfixes.txt a file like: .Sp .Vb 3 \& add_field(source,{{source}}) \& add_field(data,{{date}}) \& ...(other fixes)... .Ve .IP "\-\-debug [\s-1LEVEL\s0]" 4 .IX Item "--debug [LEVEL]" .PD 0 .IP "\-D[\s-1LEVEL\s0]" 4 .IX Item "-D[LEVEL]" .PD Set the debugging level for Catmandu. \s-1LEVEL\s0 is one of: .Sp .Vb 3 \& 1 \- WARN messages \& 2 \- INFO messages \& 3 \- DEBUG messages .Ve .Sp Requires an installation of Log::Log4perl and Log::Any::Adapter::Log4perl. By default an internal log4perl configuration file is used that sends all debug messages to stderr. Optionally in the catmandu.yml the path to a log4perl configuration file can be set. E.g. .Sp .Vb 1 \& catmandu.yml: \& \& log4perl: /etc/log4perl.conf \& \& or \& \& log4perl: " \& log4perl.category.Catmandu=$level,$appender \& \& log4perl.appender.STDOUT=Log::Log4perl::Appender::Screen \& log4perl.appender.STDOUT.stderr=0 \& log4perl.appender.STDOUT.utf8=1 \& \& log4perl.appender.STDOUT.layout=PatternLayout \& log4perl.appender.STDOUT.layout.ConversionPattern=%d [%P] \- %p %l %M time=%r : %m%n \& \& log4perl.appender.STDERR=Log::Log4perl::Appender::Screen \& log4perl.appender.STDERR.stderr=0 \& log4perl.appender.STDERR.utf8=1 \& \& log4perl.appender.STDERR.layout=PatternLayout \& log4perl.appender.STDERR.layout.ConversionPattern=%d [%P] \- %l : %m%n \& " .Ve .Sp See also Catmandu::Logger to enable logging for your own Catmandu packages. .SH "DATA OPTIONS" .IX Header "DATA OPTIONS" .IP "\-\-fix \s-1EXPRESSION\s0" 4 .IX Item "--fix EXPRESSION" .PD 0 .IP "\-\-fix \s-1FILE\s0" 4 .IX Item "--fix FILE" .PD When exporting or storing apply a fix \s-1EXPRESSION\s0 or all the fixes in \s-1FILE\s0 on each item. This option is repeatable. .IP "\-\-start \s-1NUM\s0" 4 .IX Item "--start NUM" When exporting or storing data skip the first \s-1NUM\s0 items. .IP "\-\-total \s-1NUM\s0" 4 .IX Item "--total NUM" When exporting of storing data process only a total \s-1NUM\s0 of items. .IP "\-\-replace" 4 .IX Item "--replace" When storing data first delete all the items in the Store or Bag. .IP "\-\-query \s-1QUERY\s0" 4 .IX Item "--query QUERY" .PD 0 .IP "\-\-cql\-query \s-1QUERY\s0 | \-q \s-1QUERY\s0" 4 .IX Item "--cql-query QUERY | -q QUERY" .PD When a Store is searchable execute and return the results. Using the \-\-cql\-query or \-q option the \s-1CQL\s0 query language can be used (if supported). .IP "\-\-sort \s-1SORT\s0" 4 .IX Item "--sort SORT" .PD 0 .IP "\-\-sru\-sortkeys \s-1SORT\s0" 4 .IX Item "--sru-sortkeys SORT" .PD Set the sort order for the results returned from a searchable Store. \-\-sru\-sortkeys is only available if the Store supports \s-1CQL.\s0 .IP "\-\-limit \s-1NUM\s0" 4 .IX Item "--limit NUM" Limit the number of results returned from the searchable results to \s-1NUM.\s0 .IP "\-\-count" 4 .IX Item "--count" Report the number of items processed. .IP "\-\-version" 4 .IX Item "--version" Return the installed version of Catmandu. .SH "SEE ALSO" .IX Header "SEE ALSO" Catmandu::Importer Catmandu::Exporter Catmandu::Store Catmandu::MARC Catmandu::OAI Catmandu::MongoDB Catmandu::Solr Catmandu::ElasticSearch