diff -Nru libcatmandu-marc-perl-1.254/Build.PL libcatmandu-marc-perl-1.271/Build.PL --- libcatmandu-marc-perl-1.254/Build.PL 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/Build.PL 2021-10-30 04:04:47.000000000 +0000 @@ -1,5 +1,5 @@ -# This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v6.008. +# This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v6.017. use strict; use warnings; @@ -15,10 +15,12 @@ }, "dist_abstract" => "Catmandu modules for working with MARC data", "dist_author" => [ - "Patrick Hochstenbach, C<< >>" + "Patrick Hochstenbach ", + "Carsten Klee", + "Johann Rolschewski" ], "dist_name" => "Catmandu-MARC", - "dist_version" => "1.254", + "dist_version" => "1.271", "license" => "perl", "module_name" => "Catmandu::MARC", "recursive_test_files" => 1, @@ -30,7 +32,7 @@ "MARC::File::MARCMaker" => "0.05", "MARC::File::MiJ" => "0.04", "MARC::File::XML" => "v1.0.5", - "MARC::Lint" => 0, + "MARC::Lint" => "== 1.52", "MARC::Parser::RAW" => 0, "MARC::Record" => "v2.0.6", "MARC::Schema" => "0.07", diff -Nru libcatmandu-marc-perl-1.254/Changes libcatmandu-marc-perl-1.271/Changes --- libcatmandu-marc-perl-1.254/Changes 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/Changes 2021-10-30 04:04:47.000000000 +0000 @@ -1,5 +1,17 @@ Revision history for Catmandu-MARC +1.271 2021-10-30 06:04:35 CEST + - Fixing the copyright and documentation of packages + +1.27 2021-10-29 08:22:16 CEST + - Adding the MARC Line importer and exporter [jorol] + +1.261 2021-10-14 08:42:38 CEST + - Removing unstable Lint test + +1.26 2021-10-13 19:24:47 CEST + - Making MARCMarker default in utf8 mode + 1.254 2019-10-17 14:30:11 CEST - Fixing dependencies [manwar] diff -Nru libcatmandu-marc-perl-1.254/cpanfile libcatmandu-marc-perl-1.271/cpanfile --- libcatmandu-marc-perl-1.254/cpanfile 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/cpanfile 2021-10-30 04:04:47.000000000 +0000 @@ -22,7 +22,7 @@ requires 'MARC::File::MARCMaker', '0.05'; requires 'MARC::File::MiJ' , '0.04'; requires 'MARC::Record', '2.0.6'; -requires 'MARC::Lint', '0'; +requires 'MARC::Lint', '==1.52'; requires 'MARC::Parser::RAW', '0'; requires 'MARC::Schema', '>=0.07'; requires 'MARC::Spec', '2.0.3'; diff -Nru libcatmandu-marc-perl-1.254/debian/changelog libcatmandu-marc-perl-1.271/debian/changelog --- libcatmandu-marc-perl-1.254/debian/changelog 2021-09-28 17:43:48.000000000 +0000 +++ libcatmandu-marc-perl-1.271/debian/changelog 2021-11-09 00:39:23.000000000 +0000 @@ -1,3 +1,13 @@ +libcatmandu-marc-perl (1.271-1) unstable; urgency=medium + + [ upstream ] + * new relase(s) + + [ Jonas Smedegaard ] + * update copyright info: update coverage + + -- Jonas Smedegaard Tue, 09 Nov 2021 01:39:23 +0100 + libcatmandu-marc-perl (1.254-1) unstable; urgency=medium [ upstream ] diff -Nru libcatmandu-marc-perl-1.254/debian/copyright libcatmandu-marc-perl-1.271/debian/copyright --- libcatmandu-marc-perl-1.254/debian/copyright 2021-09-12 10:12:06.000000000 +0000 +++ libcatmandu-marc-perl-1.271/debian/copyright 2021-11-09 00:38:42.000000000 +0000 @@ -5,7 +5,9 @@ Files: * Copyright: - 2019 Patrick Hochstenbach + 2012-2021 Carsten Klee + 2012-2021 Johann Rolschewski + 2012-2021 Patrick Hochstenbach License-Grant: This program is free software; you can redistribute it and/or modify it @@ -14,6 +16,7 @@ as published by the Free Software Foundation; or the Artistic License. License: Artistic or GPL-1+ +Reference: lib/Catmandu/MARC.pm Files: t/bu_bibs.mrc Copyright: @@ -26,7 +29,7 @@ Copyright: 2014-2021 Jonas Smedegaard License-Grant: - This program is free software: + This pakaging is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, diff -Nru libcatmandu-marc-perl-1.254/debian/copyright_hints libcatmandu-marc-perl-1.271/debian/copyright_hints --- libcatmandu-marc-perl-1.254/debian/copyright_hints 2021-09-28 17:43:48.000000000 +0000 +++ libcatmandu-marc-perl-1.271/debian/copyright_hints 2021-11-09 00:34:18.000000000 +0000 @@ -24,6 +24,7 @@ lib/Catmandu/Exporter/MARC/ALEPHSEQ.pm lib/Catmandu/Exporter/MARC/Base.pm lib/Catmandu/Exporter/MARC/ISO.pm + lib/Catmandu/Exporter/MARC/Line.pm lib/Catmandu/Exporter/MARC/MARCMaker.pm lib/Catmandu/Exporter/MARC/MiJ.pm lib/Catmandu/Exporter/MARC/XML.pm @@ -53,6 +54,7 @@ lib/Catmandu/Importer/MARC/ALEPHSEQ.pm lib/Catmandu/Importer/MARC/Decoder.pm lib/Catmandu/Importer/MARC/ISO.pm + lib/Catmandu/Importer/MARC/Line.pm lib/Catmandu/Importer/MARC/Lint.pm lib/Catmandu/Importer/MARC/MARCMaker.pm lib/Catmandu/Importer/MARC/MiJ.pm @@ -66,6 +68,7 @@ t/Catmandu/Exporter/MARC/ALEPHSEQ.t t/Catmandu/Exporter/MARC/Base.t t/Catmandu/Exporter/MARC/ISO.t + t/Catmandu/Exporter/MARC/Line.t t/Catmandu/Exporter/MARC/MARCMaker.t t/Catmandu/Exporter/MARC/MiJ.t t/Catmandu/Exporter/MARC/XML.t @@ -98,6 +101,7 @@ t/Catmandu/Importer/MARC/ALEPHSEQ.t t/Catmandu/Importer/MARC/Decoder.t t/Catmandu/Importer/MARC/ISO.t + t/Catmandu/Importer/MARC/Line.t t/Catmandu/Importer/MARC/Lint.t t/Catmandu/Importer/MARC/MARCMaker.t t/Catmandu/Importer/MARC/MiJ.t @@ -112,6 +116,7 @@ t/camel.mrc t/camel.mrk t/camel9.mrc + t/code4lib.line t/deprecate.t t/dollar_subfields.mrc t/inline-fix.t @@ -124,6 +129,7 @@ t/marc_spec2.t t/old-new-internal-syntax.t t/old_new.json + t/oschrift_me.mrc t/rug01.aleph t/sample1.lif t/test.fix @@ -133,18 +139,22 @@ License: UNKNOWN FIXME -Files: README - lib/Catmandu/Fix/marc_copy.pm +Files: lib/Catmandu/Fix/marc_copy.pm lib/Catmandu/Fix/marc_cut.pm lib/Catmandu/Fix/marc_paste.pm - lib/Catmandu/MARC.pm Copyright: NONE License: GPL FIXME +Files: README + lib/Catmandu/MARC.pm +Copyright: 2012 +License: GPL + FIXME + Files: LICENSE Copyright: 1989, Free Software Foundation, Inc. - 2019, Patrick Hochstenbach. + 2021, Patrick Hochstenbach, Carsten Klee , Johann Rolschewski. License: Artistic-1.0 and/or GPL-1 and/or Perl FIXME diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/ALEPHSEQ.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/ALEPHSEQ.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/ALEPHSEQ.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/ALEPHSEQ.pm 2021-10-30 04:04:47.000000000 +0000 @@ -62,7 +62,7 @@ use List::Util; use Moo; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Exporter', 'Catmandu::Exporter::MARC::Base'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/Base.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/Base.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/Base.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/Base.pm 2021-10-30 04:04:47.000000000 +0000 @@ -3,7 +3,7 @@ use MARC::Record; use MARC::Field; -our $VERSION = '1.254'; +our $VERSION = '1.271'; sub _raw_to_marc_record { my ($self,$data) = @_; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/ISO.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/ISO.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/ISO.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/ISO.pm 2021-10-30 04:04:47.000000000 +0000 @@ -60,7 +60,7 @@ use MARC::Field; use MARC::File::USMARC; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Exporter', 'Catmandu::Exporter::MARC::Base'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/Line.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/Line.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/Line.pm 1970-01-01 00:00:00.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/Line.pm 2021-10-30 04:04:47.000000000 +0000 @@ -0,0 +1,125 @@ +=head1 NAME + +Catmandu::Exporter::MARC::Line - Exporter for MARC records to Index Data's MARC Line format + +=head1 SYNOPSIS + + # From the command line + $ catmandu convert MARC to MARC --type Line < t/camel.mrc + + # From Perl + use Catmandu; + + my $importer = Catmandu->importer('MARC', file => "t/camel.mrc", type => 'ISO'); + my $exporter = Catmandu->exporter('MARC', file => "camel.line", type => 'Line' ); + + $exporter->add($importer); + $exporter->commit; + +=head1 CONFIGURATION + +=over + +=item file + +Write output to a local file given by its path or file handle. Alternatively a +scalar reference can be passed to write to a string and a code reference can be +used to write to a callback function. + +=item fh + +Write the output to an L. If not specified, +L is used to create the output +handle from the C argument or by using STDOUT. + +=item fix + +An ARRAY of one or more fixes or file scripts to be applied to exported items. + +=item encoding + +Binmode of the output stream C. Set to "C<:utf8>" by default. + +=back + +=head1 METHODS + +See L, L, L, +L, and L for a full list of methods. + +=head1 AUTHOR + +Johann Rolschewski, Ejorol at cpanE + +=head1 SEE ALSO + +L + +=cut + +package Catmandu::Exporter::MARC::Line; +use Catmandu::Sane; +use Moo; + +our $VERSION = '1.271'; + +with 'Catmandu::Exporter', 'Catmandu::Exporter::MARC::Base'; + +has record => (is => 'ro', default => sub {'record'}); +has record_format => (is => 'ro', default => sub {'raw'}); + +sub add { + my ($self, $data) = @_; + + if ($self->record_format eq 'MARC-in-JSON') { + $data = $self->_json_to_raw($data); + } + + for my $field (@{$data->{record}}) { + my ($field, $ind1, $ind2, @sf) = @$field; + + if (!defined($ind1) || $ind1 =~ /^\s*$/) {$ind1 = ' '} + if (!defined($ind2) || $ind2 =~ /^\s*$/) {$ind2 = ' '} + + next unless ($field =~ /^(LDR|\d{3})/); + + my @sf_map = (); + + for (my $i = 0; $i < @sf; $i += 2) { + if ($field eq 'LDR' || $field < 10) { + push @sf_map, $sf[$i + 1] if (defined($sf[$i + 1])); + } + else { + push @sf_map, '$' . $sf[$i], $sf[$i + 1] + if (defined($sf[$i + 1])); + } + } + + my $sf_str = join(" ", @sf_map); + + my $line; + + if ($field =~ /^\d{3}$/ && $field >= 10) { + $line = "$field $ind1$ind2 $sf_str\n"; + } + elsif ($field eq 'LDR') { + $line = "$sf_str\n"; + } + else { + $line = "$field $sf_str\n"; + } + + $self->fh->print($line); + } + + $self->fh->print("\n"); +} + +sub commit { + my ($self) = @_; + $self->fh->flush; + + 1; +} + +1; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/MARCMaker.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/MARCMaker.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/MARCMaker.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/MARCMaker.pm 2021-10-30 04:04:47.000000000 +0000 @@ -54,13 +54,9 @@ =cut package Catmandu::Exporter::MARC::MARCMaker; use Catmandu::Sane; -use Catmandu::Util qw(xml_escape is_different :array :is); use Moo; -use MARC::Record; -use MARC::Field; -use MARC::File::MARCMaker; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Exporter', 'Catmandu::Exporter::MARC::Base'; @@ -74,9 +70,42 @@ $data = $self->_json_to_raw($data); } - my $marc = $self->_raw_to_marc_record($data->{$self->record}); + for my $field (@{$data->{record}}) { + my ($field,$ind1,$ind2,@sf) = @$field; - $self->fh->print(MARC::File::MARCMaker::encode($marc)); + if (!defined($ind1) || $ind1 =~ /^\s*$/) { $ind1 = '/'} + if (!defined($ind2) || $ind2 =~ /^\s*$/) { $ind2 = '/'} + + next unless ($field =~ /^(LDR|\d{3})/); + + my @sf_map = (); + + for (my $i = 0 ; $i < @sf ; $i += 2) { + if ($field eq 'LDR' || $field < 10) { + push @sf_map , $sf[$i+1] if (defined($sf[$i+1])); + } + else { + push @sf_map + , "\$" . $sf[$i] + , $sf[$i+1] if (defined($sf[$i+1])); + } + } + + my $sf_str = join("",@sf_map); + + my $maker_field; + + if ($field =~ /^\d{3}$/ && $field >= 10) { + $maker_field = "=$field $ind1$ind2$sf_str\n"; + } + else { + $maker_field = "=$field $sf_str\n"; + } + + $self->fh->print($maker_field); + } + + $self->fh->print("\n"); } sub commit { diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/MiJ.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/MiJ.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/MiJ.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/MiJ.pm 2021-10-30 04:04:47.000000000 +0000 @@ -115,7 +115,7 @@ use MARC::Field; use MARC::File::MiJ; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Exporter', 'Catmandu::Exporter::MARC::Base'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/XML.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/XML.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC/XML.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC/XML.pm 2021-10-30 04:04:47.000000000 +0000 @@ -3,7 +3,7 @@ use Catmandu::Util qw(xml_escape is_different :array :is); use Moo; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Exporter', 'Catmandu::Exporter::MARC::Base', 'Catmandu::Buffer'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Exporter/MARC.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Exporter/MARC.pm 2021-10-30 04:04:47.000000000 +0000 @@ -3,7 +3,7 @@ use Catmandu::Util; use Moo; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has type => (is => 'ro' , default => sub { 'ISO' }); has skip_errors => (is => 'ro'); @@ -98,13 +98,14 @@ =item type -The MARC format to parse. The following MARC parsers are available: +The MARC format to export. The following MARC exporters are available: - ISO: L (default) - a strict ISO 2709 exporter - ALEPHSEQ: L - an exporter for Ex Libris Aleph sequential files - MARCMaker: L - an exporter for MARCMaker/MARCBreaker records - MiJ: L (MARC in JSON) - an export for the MARC-in-JSON format - XML: L - an exporter for the MARC XML format + ISO: L (default) - a strict ISO 2709 exporter + ALEPHSEQ: L - an exporter for Ex Libris Aleph sequential files + Line: L - an exporter for Index Data's MARC Line format + MARCMaker: L - an exporter for MARCMaker/MARCBreaker records + MiJ: L (MARC in JSON) - an export for the MARC-in-JSON format + XML: L - an exporter for the MARC XML format =item skip_errors diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Bind/marc_each.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Bind/marc_each.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Bind/marc_each.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Bind/marc_each.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ use Catmandu::Fix::Has; use namespace::clean; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has var => (fix_opt => 1); has __marc => (is => 'lazy'); diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Condition/marc_all_match.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Condition/marc_all_match.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Condition/marc_all_match.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Condition/marc_all_match.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ use Moo; use Catmandu::Fix::Has; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Fix::Condition'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Condition/marc_any_match.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Condition/marc_any_match.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Condition/marc_any_match.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Condition/marc_any_match.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ use Moo; use Catmandu::Fix::Has; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Fix::Condition'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Condition/marc_has_many.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Condition/marc_has_many.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Condition/marc_has_many.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Condition/marc_has_many.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ use Moo; use Catmandu::Fix::Has; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Fix::Condition'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Condition/marc_has.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Condition/marc_has.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Condition/marc_has.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Condition/marc_has.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ use Moo; use Catmandu::Fix::Has; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Fix::Condition'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Condition/marc_match.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Condition/marc_match.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Condition/marc_match.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Condition/marc_match.pm 2021-10-30 04:04:47.000000000 +0000 @@ -2,7 +2,7 @@ use Moo; -our $VERSION = '1.254'; +our $VERSION = '1.271'; extends 'Catmandu::Fix::Condition::marc_all_match'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Inline/marc_add.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Inline/marc_add.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Inline/marc_add.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Inline/marc_add.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ @EXPORT_OK = qw(marc_add); %EXPORT_TAGS = (all => [qw(marc_add)]); -our $VERSION = '1.254'; +our $VERSION = '1.271'; sub marc_add { my ($data,$marc_path,@subfields) = @_; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Inline/marc_map.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Inline/marc_map.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Inline/marc_map.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Inline/marc_map.pm 2021-10-30 04:04:47.000000000 +0000 @@ -65,7 +65,7 @@ @EXPORT_OK = qw(marc_map); %EXPORT_TAGS = (all => [qw(marc_map)]); -our $VERSION = '1.254'; +our $VERSION = '1.271'; sub marc_map { my ($data,$marc_path,%opts) = @_; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Inline/marc_remove.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Inline/marc_remove.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Inline/marc_remove.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Inline/marc_remove.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ @EXPORT_OK = qw(marc_remove); %EXPORT_TAGS = (all => [qw(marc_remove)]); -our $VERSION = '1.254'; +our $VERSION = '1.271'; sub marc_remove { my ($data,$marc_path) = @_; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Inline/marc_set.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Inline/marc_set.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/Inline/marc_set.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/Inline/marc_set.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ @EXPORT_OK = qw(marc_set); %EXPORT_TAGS = (all => [qw(marc_set)]); -our $VERSION = '1.254'; +our $VERSION = '1.271'; sub marc_set { my ($data,$marc_path,$value) = @_; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_add.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_add.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_add.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_add.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ with 'Catmandu::Fix::Inlineable'; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has marc_path => (fix_arg => 1); has subfields => (fix_arg => 'collect'); diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_append.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_append.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_append.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_append.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ with 'Catmandu::Fix::Inlineable'; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has marc_path => (fix_arg => 1); has value => (fix_arg => 1); diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_decode_dollar_subfields.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_decode_dollar_subfields.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_decode_dollar_subfields.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_decode_dollar_subfields.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ with 'Catmandu::Fix::Inlineable'; -our $VERSION = '1.254'; +our $VERSION = '1.271'; sub fix { my ($self,$data) = @_; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_in_json.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_in_json.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_in_json.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_in_json.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ with 'Catmandu::Fix::Inlineable'; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has reverse => (fix_opt => 1); diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_map.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_map.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_map.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_map.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ with 'Catmandu::Fix::Base'; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has marc_path => (fix_arg => 1); has path => (fix_arg => 1); diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_paste.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_paste.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_paste.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_paste.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ with 'Catmandu::Fix::Inlineable'; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has path => (fix_arg => 1); has at => (fix_opt => 1); diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_remove.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_remove.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_remove.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_remove.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ with 'Catmandu::Fix::Inlineable'; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has marc_path => (fix_arg => 1); diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_replace_all.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_replace_all.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_replace_all.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_replace_all.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ with 'Catmandu::Fix::Inlineable'; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has marc_path => (fix_arg => 1); has regex => (fix_arg => 1); diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_set.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_set.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_set.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_set.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ with 'Catmandu::Fix::Inlineable'; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has marc_path => (fix_arg => 1); has value => (fix_arg => 1); diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_sort.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_sort.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_sort.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_sort.pm 2021-10-30 04:04:47.000000000 +0000 @@ -4,7 +4,7 @@ use Moo; use Catmandu::MARC; -our $VERSION = '1.254'; +our $VERSION = '1.271'; sub fix { my ( $self, $data ) = @_; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_spec.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_spec.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_spec.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_spec.pm 2021-10-30 04:04:47.000000000 +0000 @@ -7,7 +7,7 @@ with 'Catmandu::Fix::Base'; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has spec => ( fix_arg=> 1 ); has path => ( fix_arg=> 1 ); diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_xml.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_xml.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Fix/marc_xml.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Fix/marc_xml.pm 2021-10-30 04:04:47.000000000 +0000 @@ -2,7 +2,7 @@ use Catmandu::Sane; -our $VERSION = '1.254'; +our $VERSION = '1.271'; use Moo; use namespace::clean; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/ALEPHSEQ.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/ALEPHSEQ.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/ALEPHSEQ.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/ALEPHSEQ.pm 2021-10-30 04:04:47.000000000 +0000 @@ -64,7 +64,7 @@ use Catmandu::Sane; use Moo; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Importer'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/Decoder.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/Decoder.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/Decoder.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/Decoder.pm 2021-10-30 04:04:47.000000000 +0000 @@ -3,7 +3,7 @@ use Catmandu::Sane; use Moo; -our $VERSION = '1.254'; +our $VERSION = '1.271'; sub fake_marc_file { my ($self,$fh,$class) = @_; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/ISO.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/ISO.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/ISO.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/ISO.pm 2021-10-30 04:04:47.000000000 +0000 @@ -70,7 +70,7 @@ use MARC::File::USMARC; use Catmandu::Importer::MARC::Decoder; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Importer'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/Line.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/Line.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/Line.pm 1970-01-01 00:00:00.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/Line.pm 2021-10-30 04:04:47.000000000 +0000 @@ -0,0 +1,158 @@ +=head1 NAME + +Catmandu::Importer::MARC::Line - Package that imports Index Data's MARC Line records + +=head1 SYNOPSIS + + # From the command line + $ catmandu convert MARC --type Line --fix 'marc_map("245a","title")' < t/code4lib.line + $ catmandu convert MARC --type Line to MARC --type XML < t/code4lib.line + + + # From perl + use Catmandu; + + # import records from file + my $importer = Catmandu->importer('MARC',file => 't/code4lib.line' , type => 'Line'); + my $fixer = Catmandu->fixer("marc_map('245a','title')"); + + $importer->each(sub { + my $item = shift; + ... + }); + + # or using the fixer + + $fixer->fix($importer)->each(sub { + my $item = shift; + printf "title: %s\n" , $item->{title}; + }); + +=head1 CONFIGURATION + +=over + +=item file + +Read input from a local file given by its path. Alternatively a scalar +reference can be passed to read from a string. + +=item fh + +Read input from an L. If not specified, L is used to +create the input stream from the C argument or by using STDIN. + +=item encoding + +Binmode of the input stream C. Set to C<:utf8> by default. + +=item fix + +An ARRAY of one or more fixes or file scripts to be applied to imported items. + +=back + +=head1 METHODS + +Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. + +=head1 AUTHOR + +Johann Rolschewski, Ejorol at cpanE + +=head1 SEE ALSO + +L, +L + +=cut + +package Catmandu::Importer::MARC::Line; +use Catmandu::Sane; +use Moo; + +our $VERSION = '1.271'; + +with 'Catmandu::Importer'; + +sub generator { + my ($self) = @_; + sub { + state $fh = $self->fh; + state $count = 0; + + # set input record separator to paragraph mode + local $/ = ''; + + # get next record + while (defined(my $data = $fh->getline)) { + $count++; + my @record; + my $id; + chomp $data; + + # split record into fields + my @fields = split /\n/, $data; + + # first field should be the MARC leader + my $leader = shift @fields; + if (length $leader == 24 && $leader =~ m/^\d{5}.*4500/) { + push @record, ['LDR', ' ', ' ', '_', $leader]; + } else { + warn "not a valid MARC leader: $leader"; + } + for my $field (@fields) { + + # process control fields + if ($field =~ m/^00.\s/) { + my ($tag, $value) = $field =~ m/^(\d{3})\s(.*)/; + push @record, [$tag, ' ', ' ', '_', $value]; + + # get record id + if ($tag eq '001') { + $id = $value; + } + } + + # process variable data fields + else { + my ($tag, $ind1, $ind2, $sf) + = $field =~ m/^(\d{3})\s([a-z0-9\s])([a-z0-9\s])\s(.*)/; + + # check if field has content + if ($sf) { + # get subfield codes by pattern + my @sf_codes = $sf =~ m/\s?\$([a-z0-9])\s/g; + + # split string by subfield code pattern + my @sf_values + = grep {length $_} split /\s?\$[a-z0-9]\s/, $sf; + + if (scalar @sf_codes != scalar @sf_values) { + warn + 'different number of subfield codes and values'; + next; + } + + push @record, + [ + $tag, $ind1, + $ind2, map {$_, shift @sf_values} @sf_codes + ]; + } + + # skip empty fields + else { + warn "field $tag has no content"; + next; + } + + } + } + return {_id => defined $id ? $id : $count, record => \@record}; + } + return; + }; +} + +1; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/Lint.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/Lint.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/Lint.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/Lint.pm 2021-10-30 04:04:47.000000000 +0000 @@ -79,7 +79,7 @@ use MARC::Lint; use Catmandu::Importer::MARC::Decoder; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Importer'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/MARCMaker.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/MARCMaker.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/MARCMaker.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/MARCMaker.pm 2021-10-30 04:04:47.000000000 +0000 @@ -70,7 +70,7 @@ use MARC::File::MARCMaker; use Catmandu::Importer::MARC::Decoder; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Importer'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/MicroLIF.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/MicroLIF.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/MicroLIF.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/MicroLIF.pm 2021-10-30 04:04:47.000000000 +0000 @@ -70,7 +70,7 @@ use MARC::File::MicroLIF; use Catmandu::Importer::MARC::Decoder; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Importer'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/MiJ.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/MiJ.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/MiJ.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/MiJ.pm 2021-10-30 04:04:47.000000000 +0000 @@ -55,7 +55,7 @@ use Catmandu::Importer::MARC::Decoder; use MARC::File::MiJ; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Importer'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/RAW.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/RAW.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/RAW.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/RAW.pm 2021-10-30 04:04:47.000000000 +0000 @@ -69,7 +69,7 @@ use Moo; use MARC::Parser::RAW; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Importer'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/Record.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/Record.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/Record.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/Record.pm 2021-10-30 04:04:47.000000000 +0000 @@ -55,7 +55,7 @@ use Catmandu::Importer::MARC::Decoder; use Moo; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Importer'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/XML.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/XML.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC/XML.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC/XML.pm 2021-10-30 04:04:47.000000000 +0000 @@ -70,7 +70,7 @@ use Catmandu::Importer::MARC::Decoder; use MARC::File::XML (BinaryEncoding => 'UTF-8', DefaultEncoding => 'UTF-8', RecordFormat => 'MARC21'); -our $VERSION = '1.254'; +our $VERSION = '1.271'; with 'Catmandu::Importer'; diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Importer/MARC.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Importer/MARC.pm 2021-10-30 04:04:47.000000000 +0000 @@ -3,7 +3,7 @@ use Catmandu::Util; use Moo; -our $VERSION = '1.254'; +our $VERSION = '1.271'; has type => (is => 'ro' , default => sub { 'ISO' }); has skip_errors => (is => 'ro'); @@ -163,6 +163,7 @@ ISO: L (default) - a strict ISO 2709 parser RAW: L - a loose ISO 2709 parser that skips faulty records ALEPHSEQ: L - a parser for Ex Libris Aleph sequential files + Line: L - a parser for Index Data's MARC Line format Lint: L - a MARC syntax checker MicroLIF: L - a parser for the MicroLIF format MARCMaker: L - a parser for MARCMaker/MARCBreaker records diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/MARC.pm libcatmandu-marc-perl-1.271/lib/Catmandu/MARC.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/MARC.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/MARC.pm 2021-10-30 04:04:47.000000000 +0000 @@ -15,7 +15,7 @@ memoize('parse_marc_spec'); memoize('_get_index_range'); -our $VERSION = '1.254'; +our $VERSION = '1.271'; sub marc_map { my $self = $_[0]; @@ -1438,44 +1438,80 @@ =item * L +=item * L + +=item * L + +=item * L + +=item * L + +=item * L + +=item * L + +=item * L + +=item * L + +=item * L + +=item * L + =item * L -=item * L +=item * L -=item * L +=item * L + +=item * L + +=item * L + +=item * L + +=item * L =item * L =item * L -=item * L +=item * L -=item * L +=item * L -=item * L +=item * L =item * L -=item * L +=item * L -=item * L +=item * L -=item * L +=item * L -=item * L +=item * L -=item * L +=item * L =item * L +=item * L + +=item * L + =item * L -=item * L +=item * L + +=item * L =item * L =item * L +=item * L + =item * L =item * L @@ -1484,6 +1520,8 @@ =item * L +=item * L + =back =head1 DESCRIPTION @@ -1527,12 +1565,16 @@ =back -=head1 LICENSE AND COPYRIGHT +=head1 COPYRIGHT + +Copyright 2012- Patrick Hochstenbach , Carsten Klee, Johann Rolschewski + +=head1 LICENSE 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. +See L for more information. =cut diff -Nru libcatmandu-marc-perl-1.254/lib/Catmandu/Validator/MARC.pm libcatmandu-marc-perl-1.271/lib/Catmandu/Validator/MARC.pm --- libcatmandu-marc-perl-1.254/lib/Catmandu/Validator/MARC.pm 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/lib/Catmandu/Validator/MARC.pm 2021-10-30 04:04:47.000000000 +0000 @@ -4,7 +4,7 @@ use MARC::Schema; use Moo; -our $VERSION = '1.254'; +our $VERSION = '1.271'; with qw(Catmandu::Validator); @@ -109,4 +109,8 @@ =back +=head1 AUTHOR + +Johann Rolschewski, Ejorol at cpanE + =cut diff -Nru libcatmandu-marc-perl-1.254/LICENSE libcatmandu-marc-perl-1.271/LICENSE --- libcatmandu-marc-perl-1.254/LICENSE 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/LICENSE 2021-10-30 04:04:47.000000000 +0000 @@ -1,4 +1,4 @@ -This software is copyright (c) 2019 by Patrick Hochstenbach. +This software is copyright (c) 2021 by Patrick Hochstenbach, Carsten Klee , Johann Rolschewski. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,7 +12,7 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2019 by Patrick Hochstenbach. +This software is Copyright (c) 2021 by Patrick Hochstenbach, Carsten Klee , Johann Rolschewski. This is free software, licensed under: @@ -272,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2019 by Patrick Hochstenbach. +This software is Copyright (c) 2021 by Patrick Hochstenbach, Carsten Klee , Johann Rolschewski. This is free software, licensed under: diff -Nru libcatmandu-marc-perl-1.254/MANIFEST libcatmandu-marc-perl-1.271/MANIFEST --- libcatmandu-marc-perl-1.254/MANIFEST 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/MANIFEST 2021-10-30 04:04:47.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.008. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.017. Build.PL Changes LICENSE @@ -13,6 +13,7 @@ lib/Catmandu/Exporter/MARC/ALEPHSEQ.pm lib/Catmandu/Exporter/MARC/Base.pm lib/Catmandu/Exporter/MARC/ISO.pm +lib/Catmandu/Exporter/MARC/Line.pm lib/Catmandu/Exporter/MARC/MARCMaker.pm lib/Catmandu/Exporter/MARC/MiJ.pm lib/Catmandu/Exporter/MARC/XML.pm @@ -45,6 +46,7 @@ lib/Catmandu/Importer/MARC/ALEPHSEQ.pm lib/Catmandu/Importer/MARC/Decoder.pm lib/Catmandu/Importer/MARC/ISO.pm +lib/Catmandu/Importer/MARC/Line.pm lib/Catmandu/Importer/MARC/Lint.pm lib/Catmandu/Importer/MARC/MARCMaker.pm lib/Catmandu/Importer/MARC/MiJ.pm @@ -59,6 +61,7 @@ t/Catmandu/Exporter/MARC/ALEPHSEQ.t t/Catmandu/Exporter/MARC/Base.t t/Catmandu/Exporter/MARC/ISO.t +t/Catmandu/Exporter/MARC/Line.t t/Catmandu/Exporter/MARC/MARCMaker.t t/Catmandu/Exporter/MARC/MiJ.t t/Catmandu/Exporter/MARC/XML.t @@ -91,6 +94,7 @@ t/Catmandu/Importer/MARC/ALEPHSEQ.t t/Catmandu/Importer/MARC/Decoder.t t/Catmandu/Importer/MARC/ISO.t +t/Catmandu/Importer/MARC/Line.t t/Catmandu/Importer/MARC/Lint.t t/Catmandu/Importer/MARC/MARCMaker.t t/Catmandu/Importer/MARC/MiJ.t @@ -106,6 +110,7 @@ t/camel.mrc t/camel.mrk t/camel9.mrc +t/code4lib.line t/deprecate.t t/dollar_subfields.mrc t/inline-fix.t @@ -118,6 +123,7 @@ t/marc_spec2.t t/old-new-internal-syntax.t t/old_new.json +t/oschrift_me.mrc t/rug01.aleph t/sample1.lif t/test.fix diff -Nru libcatmandu-marc-perl-1.254/META.json libcatmandu-marc-perl-1.271/META.json --- libcatmandu-marc-perl-1.254/META.json 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/META.json 2021-10-30 04:04:47.000000000 +0000 @@ -1,10 +1,12 @@ { "abstract" : "Catmandu modules for working with MARC data", "author" : [ - "Patrick Hochstenbach, C<< >>" + "Patrick Hochstenbach ", + "Carsten Klee", + "Johann Rolschewski" ], "dynamic_config" : 0, - "generated_by" : "Dist::Milla version v1.0.17, Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150005", + "generated_by" : "Dist::Milla version v1.0.20, Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], @@ -36,7 +38,7 @@ }, "develop" : { "requires" : { - "Dist::Milla" : "v1.0.17", + "Dist::Milla" : "v1.0.20", "Test::Pod" : "1.41" } }, @@ -49,7 +51,7 @@ "MARC::File::MARCMaker" : "0.05", "MARC::File::MiJ" : "0.04", "MARC::File::XML" : "v1.0.5", - "MARC::Lint" : "0", + "MARC::Lint" : "== 1.52", "MARC::Parser::RAW" : "0", "MARC::Record" : "v2.0.6", "MARC::Schema" : "0.07", @@ -90,20 +92,24 @@ "web" : "https://github.com/LibreCat/Catmandu-MARC" } }, - "version" : "1.254", + "version" : "1.271", "x_contributors" : [ "Carsten Klee ", "Carsten Klee ", "Chris Cormack ", + "Debabrata Deka <60925700+ddeka2910@users.noreply.github.com>", "Jakob Voss ", + "Johann Rolschewski ", "Johann Rolschewski ", "Johann Rolschewski ", "Mohammad S Anwar ", "Nicolas Franck ", "Nicolas Steenlant ", - "Patrick Hochstenbach ", "Robin Sheat " ], - "x_serialization_backend" : "Cpanel::JSON::XS version 4.02" + "x_generated_by_perl" : "v5.24.0", + "x_serialization_backend" : "Cpanel::JSON::XS version 4.25", + "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later", + "x_static_install" : 0 } diff -Nru libcatmandu-marc-perl-1.254/META.yml libcatmandu-marc-perl-1.271/META.yml --- libcatmandu-marc-perl-1.254/META.yml 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/META.yml 2021-10-30 04:04:47.000000000 +0000 @@ -1,7 +1,9 @@ --- abstract: 'Catmandu modules for working with MARC data' author: - - 'Patrick Hochstenbach, C<< >>' + - 'Patrick Hochstenbach ' + - 'Carsten Klee' + - 'Johann Rolschewski' build_requires: Module::Build: '0.4229' Pod::Simple::HTML: '3.23' @@ -17,7 +19,7 @@ configure_requires: Module::Build: '0.28' dynamic_config: 0 -generated_by: 'Dist::Milla version v1.0.17, Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150005' +generated_by: 'Dist::Milla version v1.0.20, Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -39,7 +41,7 @@ MARC::File::MARCMaker: '0.05' MARC::File::MiJ: '0.04' MARC::File::XML: v1.0.5 - MARC::Lint: '0' + MARC::Lint: '== 1.52' MARC::Parser::RAW: '0' MARC::Record: v2.0.6 MARC::Schema: '0.07' @@ -55,17 +57,21 @@ bugtracker: https://github.com/LibreCat/Catmandu-MARC/issues homepage: https://github.com/LibreCat/Catmandu-MARC repository: https://github.com/LibreCat/Catmandu-MARC.git -version: '1.254' +version: '1.271' x_contributors: - 'Carsten Klee ' - 'Carsten Klee ' - 'Chris Cormack ' + - 'Debabrata Deka <60925700+ddeka2910@users.noreply.github.com>' - 'Jakob Voss ' + - 'Johann Rolschewski ' - 'Johann Rolschewski ' - 'Johann Rolschewski ' - 'Mohammad S Anwar ' - 'Nicolas Franck ' - 'Nicolas Steenlant ' - - 'Patrick Hochstenbach ' - 'Robin Sheat ' -x_serialization_backend: 'YAML::Tiny version 1.69' +x_generated_by_perl: v5.24.0 +x_serialization_backend: 'YAML::Tiny version 1.73' +x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' +x_static_install: 0 diff -Nru libcatmandu-marc-perl-1.254/README libcatmandu-marc-perl-1.271/README --- libcatmandu-marc-perl-1.254/README 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/README 2021-10-30 04:04:47.000000000 +0000 @@ -42,44 +42,80 @@ * Catmandu::Importer::MARC + * Catmandu::Importer::MARC::ALEPHSEQ + + * Catmandu::Importer::MARC::ISO + + * Catmandu::Importer::MARC::Line + + * Catmandu::Importer::MARC::Lint + + * Catmandu::Importer::MARC::MARCMaker + + * Catmandu::Importer::MARC::MicroLIF + + * Catmandu::Importer::MARC::MiJ + + * Catmandu::Importer::MARC::RAW + + * Catmandu::Importer::MARC::Record + + * Catmandu::Importer::MARC::XML + * Catmandu::Exporter::MARC - * Catmandu::Fix::marc_map + * Catmandu::Exporter::MARC::ALEPHSEQ - * Catmandu::Fix::marc_spec + * Catmandu::Exporter::MARC::ISO + + * Catmandu::Exporter::MARC::Line + + * Catmandu::Exporter::MARC::MARCMaker + + * Catmandu::Exporter::MARC::MiJ + + * Catmandu::Exporter::MARC::XML * Catmandu::Fix::marc_add * Catmandu::Fix::marc_append - * Catmandu::Fix::marc_replace_all + * Catmandu::Fix::marc_copy - * Catmandu::Fix::marc_remove + * Catmandu::Fix::marc_cut - * Catmandu::Fix::marc_xml + * Catmandu::Fix::marc_decode_dollar_subfields * Catmandu::Fix::marc_in_json - * Catmandu::Fix::marc_decode_dollar_subfields + * Catmandu::Fix::marc_map - * Catmandu::Fix::marc_set + * Catmandu::Fix::marc_paste - * Catmandu::Fix::marc_copy + * Catmandu::Fix::marc_remove - * Catmandu::Fix::marc_cut + * Catmandu::Fix::marc_replace_all - * Catmandu::Fix::marc_paste + * Catmandu::Fix::marc_set * Catmandu::Fix::marc_sort + * Catmandu::Fix::marc_spec + + * Catmandu::Fix::marc_xml + * Catmandu::Fix::Bind::marc_each - * Catmandu::Fix::Condition::marc_match + * Catmandu::Fix::Condition::marc_all_match + + * Catmandu::Fix::Condition::marc_any_match * Catmandu::Fix::Condition::marc_has * Catmandu::Fix::Condition::marc_has_many + * Catmandu::Fix::Condition::marc_match + * Catmandu::Fix::Condition::marc_spec_has * Catmandu::Fix::Inline::marc_map @@ -88,6 +124,8 @@ * Catmandu::Fix::Inline::marc_remove + * Catmandu::Fix::Inline::marc_set + DESCRIPTION With Catmandu, LibreCat tools abstract digital library and research @@ -123,7 +161,11 @@ * Carsten Klee, klee at cpan.org -LICENSE AND COPYRIGHT +COPYRIGHT + + Copyright 2012- Patrick Hochstenbach , Carsten Klee, Johann Rolschewski + +LICENSE 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 diff -Nru libcatmandu-marc-perl-1.254/t/Catmandu/Exporter/MARC/Line.t libcatmandu-marc-perl-1.271/t/Catmandu/Exporter/MARC/Line.t --- libcatmandu-marc-perl-1.254/t/Catmandu/Exporter/MARC/Line.t 1970-01-01 00:00:00.000000000 +0000 +++ libcatmandu-marc-perl-1.271/t/Catmandu/Exporter/MARC/Line.t 2021-10-30 04:04:47.000000000 +0000 @@ -0,0 +1,93 @@ +#!perl + +use strict; +use warnings; +use Test::More; +use Test::Exception; +use Catmandu::Exporter::MARC; +use Catmandu::Importer::MARC; + +my $pkg; + +BEGIN { + $pkg = 'Catmandu::Exporter::MARC::Line'; + use_ok $pkg; +} + +require_ok $pkg; + +my $marcline = undef; + +note('Exporting to MARC/Line'); +{ + my $exporter = Catmandu::Exporter::MARC->new(file => \$marcline, type=> 'Line'); + + ok $exporter , 'got an MARC/Line exporter'; + + ok $exporter->add({ + '_id' => '987874829', + 'record' => [ + [ 'LDR', ' ', ' ', '_', '00251nas a2200121 c 4500' ], + [ '001', ' ', ' ', '_', '987874829' ], + [ '007', ' ', ' ', '_', 'cr||||||||||||' ], + [ '022', ' ', ' ', 'a', '1940-5758' ], + [ '041', ' ', ' ', 'a', 'eng' ], + [ 245, '0', '0', 'a', 'Code4Lib journal', 'b', 'C4LJ' ], + [ 246, '3', ' ', 'a', 'C4LJ' ], + [ 362, '0', ' ', 'a', '1.2007 -' ], + [ 856, '4', ' ', 'u', 'http://journal.code4lib.org/' ] + ]}) , 'add'; + + ok $exporter->commit , 'commit'; + + my $expected = <<'EOF'; +00251nas a2200121 c 4500 +001 987874829 +007 cr|||||||||||| +022 $a 1940-5758 +041 $a eng +245 00 $a Code4Lib journal $b C4LJ +246 3 $a C4LJ +362 0 $a 1.2007 - +856 4 $u http://journal.code4lib.org/ + +EOF + + + is $marcline, $expected, 'got the expected result'; + +} + + +note('Roundtripping'); +{ + my $importer_iso = Catmandu::Importer::MARC->new(file => 't/camel.mrc', type=> 'ISO'); + + ok $importer_iso , 'got an MARC/ISO importer'; + + my $records_iso = $importer_iso->to_array; + + ok @$records_iso == 10, 'got all records'; + + my $marcline; + + my $exporter = Catmandu::Exporter::MARC->new(file => \$marcline, type=> 'Line'); + + ok $exporter , 'got an MARC/Line exporter'; + + ok $exporter->add_many($records_iso) , 'add records'; + + ok $exporter->commit , 'commit'; + + my $importer_line = Catmandu::Importer::MARC->new(file => \$marcline, type=> 'Line'); + + ok $importer_line , 'got an MARC/Line importer'; + + my $records_line = $importer_line->to_array; + + ok @$records_line == 10, 'got all records'; + + is_deeply $records_iso, $records_line, 'got expected result'; +} + +done_testing; diff -Nru libcatmandu-marc-perl-1.254/t/Catmandu/Exporter/MARC/MARCMaker.t libcatmandu-marc-perl-1.271/t/Catmandu/Exporter/MARC/MARCMaker.t --- libcatmandu-marc-perl-1.254/t/Catmandu/Exporter/MARC/MARCMaker.t 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/t/Catmandu/Exporter/MARC/MARCMaker.t 2021-10-30 04:04:47.000000000 +0000 @@ -5,6 +5,7 @@ use Test::More; use Test::Exception; use Catmandu::Exporter::MARC; +use Catmandu::Importer::MARC; my $pkg; @@ -17,27 +18,59 @@ my $marcmaker = undef; -my $exporter = Catmandu::Exporter::MARC->new(file => \$marcmaker, type=> 'MARCMaker'); +note("Exporting to MARCMaker"); +{ + my $exporter = Catmandu::Exporter::MARC->new(file => \$marcmaker, type=> 'MARCMaker'); + + ok $exporter , 'got an MARC/MARCMaker exporter'; + + ok $exporter->add({ + _id => '1' , + record => [ + ['FMT', undef, undef, '_', 'BK'], + ['001', undef, undef, '_', 'rec001'], + ['100', ' ', ' ', 'a', 'Davis, Miles' , 'c' , 'Test'], + ['245', ' ', ' ', + 'a', 'Sketches in Blue' , + ], + ['500', ' ', ' ', 'a', undef], + ['501', ' ', ' ' ], + ['502', ' ', ' ', 'a', undef, 'b' , 'ok'], + ['503', ' ', ' ', 'a', ''], + ['CAT', ' ', ' ', 'a', 'test'], + ] + }) , 'add'; -ok $exporter , 'got an MARC/MARCMaker exporter'; + ok $exporter->commit , 'commit'; +} + +note("Roundtripping"); +{ + my $importer = Catmandu::Importer::MARC->new(file => 't/oschrift_me.mrc', type=> 'ISO'); + + ok $importer , 'got an MARC/MARCMaker importer'; + + my $records = $importer->to_array; + + ok @$records == 1; + + my $marcmaker; + + my $exporter = Catmandu::Exporter::MARC->new(file => \$marcmaker, type=> 'MARCMaker'); -ok $exporter->add({ - _id => '1' , - record => [ - ['FMT', undef, undef, '_', 'BK'], - ['001', undef, undef, '_', 'rec001'], - ['100', ' ', ' ', 'a', 'Davis, Miles' , 'c' , 'Test'], - ['245', ' ', ' ', - 'a', 'Sketches in Blue' , - ], - ['500', ' ', ' ', 'a', undef], - ['501', ' ', ' ' ], - ['502', ' ', ' ', 'a', undef, 'b' , 'ok'], - ['503', ' ', ' ', 'a', ''], - ['CAT', ' ', ' ', 'a', 'test'], - ] -}) , 'add'; + ok $exporter->add($records->[0]) , 'commit'; -ok $exporter->commit , 'commit'; + ok $exporter->commit , 'commit'; + + my $importer2 = Catmandu::Importer::MARC->new(file => \$marcmaker, type=> 'MARCMaker'); + + ok $importer2 , 'got an MARC/MARCMaker importer'; + + my $records2 = $importer2->to_array; + + ok @$records2 == 1; + + is_deeply $records->[0] , $records2->[0]; +} done_testing; diff -Nru libcatmandu-marc-perl-1.254/t/Catmandu/Importer/MARC/Line.t libcatmandu-marc-perl-1.271/t/Catmandu/Importer/MARC/Line.t --- libcatmandu-marc-perl-1.254/t/Catmandu/Importer/MARC/Line.t 1970-01-01 00:00:00.000000000 +0000 +++ libcatmandu-marc-perl-1.271/t/Catmandu/Importer/MARC/Line.t 2021-10-30 04:04:47.000000000 +0000 @@ -0,0 +1,71 @@ +#!perl + +use strict; +use warnings; +use Test::More; +use Test::Exception; +use Catmandu::Importer::MARC; +use utf8; + +my $pkg; + +BEGIN { + $pkg = 'Catmandu::Importer::MARC::Line'; + use_ok $pkg; +} + +require_ok $pkg; + +my $record =<<'EOF'; +00251nas a2200121 c 4500 +001 987874829 +007 cr|||||||||||| +022 $a 1940-5758 +041 $a eng +245 00 $a Code4Lib journal $b C4LJ +246 3 $a C4LJ +362 0 $a 1.2007 - +856 4 $u http://journal.code4lib.org/ + +EOF + +my $expected = { + '_id' => '987874829', + 'record' => [ + ['LDR', ' ', ' ', '_', '00251nas a2200121 c 4500'], + ['001', ' ', ' ', '_', '987874829'], + ['007', ' ', ' ', '_', 'cr||||||||||||'], + ['022', ' ', ' ', 'a', '1940-5758'], + ['041', ' ', ' ', 'a', 'eng'], + [245, '0', '0', 'a', 'Code4Lib journal', 'b', 'C4LJ'], + [246, '3', ' ', 'a', 'C4LJ'], + [362, '0', ' ', 'a', '1.2007 -'], + [856, '4', ' ', 'u', 'http://journal.code4lib.org/'] + ] +}; + +note('Importing from MARC/Line inline'); +{ + my $importer = Catmandu::Importer::MARC->new( file => \$record, type => 'Line' ); + + ok $importer , 'got an MARC/Line importer'; + + my $result = $importer->first; + + ok $result , 'got a record'; + + is_deeply $result , $expected , 'got expected result'; +} + +note('Importing from MARC/Line file'); +{ + my $importer = Catmandu::Importer::MARC->new( file => 't/code4lib.line', type => "Line" ); + + ok $importer , 'got an MARC/Line importer'; + + my $result = $importer->first; + + is_deeply $result, $expected , 'got expected result'; +} + +done_testing; diff -Nru libcatmandu-marc-perl-1.254/t/Catmandu/Importer/MARC/Lint.t libcatmandu-marc-perl-1.271/t/Catmandu/Importer/MARC/Lint.t --- libcatmandu-marc-perl-1.254/t/Catmandu/Importer/MARC/Lint.t 2019-10-17 12:30:14.000000000 +0000 +++ libcatmandu-marc-perl-1.271/t/Catmandu/Importer/MARC/Lint.t 2021-10-30 04:04:47.000000000 +0000 @@ -31,6 +31,4 @@ ok $records->[9]->{lint} , 'got lint'; -like $records->[9]->{lint}->[0] , qr/Indicator 1 must be 0/ , 'got lit information'; - done_testing; diff -Nru libcatmandu-marc-perl-1.254/t/code4lib.line libcatmandu-marc-perl-1.271/t/code4lib.line --- libcatmandu-marc-perl-1.254/t/code4lib.line 1970-01-01 00:00:00.000000000 +0000 +++ libcatmandu-marc-perl-1.271/t/code4lib.line 2021-10-30 04:04:47.000000000 +0000 @@ -0,0 +1,9 @@ +00251nas a2200121 c 4500 +001 987874829 +007 cr|||||||||||| +022 $a 1940-5758 +041 $a eng +245 00 $a Code4Lib journal $b C4LJ +246 3 $a C4LJ +362 0 $a 1.2007 - +856 4 $u http://journal.code4lib.org/ diff -Nru libcatmandu-marc-perl-1.254/t/oschrift_me.mrc libcatmandu-marc-perl-1.271/t/oschrift_me.mrc --- libcatmandu-marc-perl-1.254/t/oschrift_me.mrc 1970-01-01 00:00:00.000000000 +0000 +++ libcatmandu-marc-perl-1.271/t/oschrift_me.mrc 2021-10-30 04:04:47.000000000 +0000 @@ -0,0 +1 @@ +03579cam a22003138i 45000010017000000030009000170050017000260060019000430070015000620080041000770200018001180350015001360400013001511100060001642450351002242600037005753000025006125202060006376500027026976500015027246500016027396500010027556500026027657100020027917100034028117750211028457750145030568560064032019789264310032-arFR-PaOEC20201001000000.0a o d i cr || |||m|n||181201s2019 ||| o i|0| 0 ara d a9789264310032 a(FR-PaOEC) aFR-PaOEC2 aOrganisation for Economic Co-operation and Development.10aمنطقة الشرق الأوسط وشمال أفريقيا المتوسطية 2018h[electronic resource]:bالتقييم المرحلي للإصلاحات المتعلقة بالمشاريع الصغيرة والمتوسطة الحجم /cOrganisation for Economic Co-operation and Development, European Union and European Training Foundation aParis :bOECD Publishing,c2019. a148 p. ;c21 x 28cm.3 aيقدم هذا التقرير تحليلاً معمقاً للإصلاحات الرئيسية التي أجريت بين 2014 و2018 التي تهدف إلى تشجيع تنمية المشاريع المتناهية الصغر والصغيرة والمتوسطة الحجم في الجزائر ومصر وإسرائيل والأردن ولبنان والمغرب والأراضي الفلسطينية وتونس. يركز التقرير على خمس مجالات استراتيجية لصياغة سياسات المشاريع الصغيرة والمتوسطة الحجم: تعاريف المشاريع الصغيرة والمتوسطة الحجم والإحصاءات والمؤسسات المتعلقة بها؛ تحسين بيئات العمل للمشاريع الصغيرة والمتوسطة الحجم ورواد الأعمال؛ تعزيز الوصول إلى التمويل؛ رعاية نمو الشركات الناشئة والمشاريع الصغيرة والمتوسطة الحجم؛ وتنمية رأس المال البشري الريادي. يهدف التقرير إلى عرض الممارسات الجيدة والإشارة إلى المناطق التي تحتاج إلى بذل المزيد من الجهود. ويوفر إرشادات قيمة للحكومات ومنظمات القطاع الخاص والهيئات المتعددة الأطراف وغيرها من أصحاب المصلحة لتكثيف الجهود لدعم المشاريع الصغيرة والمتوسطة الحجم كأدوات أساسية لخلق الوظائف والقدرة التنافسية. ويكتسي ذلك أهمية خاصة في منطقة تسعى إلى تعزيز التنوع الاقتصادي وخلق فرص العمل وإشراك الشباب والنساء في الاقتصاد. إن التقرير هو نتيجة لعملية تعاون وثيق بين الحكومات، ومنظمة التعاون والتنمية الاقتصادية، ومؤسسة التدريب الأوروبية والمفوضية الأوروبية 4aFinance and Investment 4aGovernance 4aDevelopment 4aTrade 4aIndustry and Services2 aEuropean Union.2 aEuropean Training Foundation.0 tPolitiques en faveur des PME : Moyen-Orient méditerranéen et Afrique du Nord 2018 : Évaluation intermédiaire des principales réformes en faveur des PMEz9789264307612z9789264308305z9789264308299efre0 tThe Mediterranean Middle East and North Africa 2018: Interim Assessment of Key SME Reformsz9789264304161z9789264306653z9789264306646eeng40aoecd-ilibrary.orguhttps://doi.org/10.1787/9789264310032-ar \ No newline at end of file