Group
Extension

Matches 35358

Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Exporter/MARC/Line.pm ( view source; MetaCPAN )


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 ($fiel
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Exporter/MARC/MARCMaker.pm ( view source; MetaCPAN )
 );

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 ($fiel
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Exporter/MARC/MiJ.pm ( view source; MetaCPAN )
=head1 NAME

Catmandu::Exporter::MARC::MiJ - Exporter for MARC records to MARC in JSON

=head1 SYNOPSIS

    # From the command line
    $ catmandu convert MARC --type XML to MARC --type MiJ < /foo/ba
le => "/foo/bar.xml" , type => 'XML');
    my $exporter = Catmandu->exporter('MARC', file => "bar.json", type => 'MiJ' );

    $exporter->add($importer);
    $exporter->commit;

=head1 CONFIGURATION

tmandu::Counter>, and L<Catmandu::Logger> for a full list of methods.

=head1 FORMAT

The MARC-in-JSON record format contains two fields:

   * 'leader' - the MARC leader
   * 'fields' - an array of M
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Exporter/MARC/ALEPHSEQ.pm ( view source; MetaCPAN )
;

sub add {
    my ($self,$data) = @_;

    if ($self->record_format eq 'MARC-in-JSON') {
        $data = $self->_json_to_raw($data);
    }

    my $id_str = $data->{_id};
    $id_str    =~ s{\D}{0}g
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Exporter/MARC/ISO.pm ( view source; MetaCPAN )
ata) = @_;

    if (keys %$data) {
        if ($self->record_format eq 'MARC-in-JSON') {
            $data = $self->_json_to_raw($data);
        }

        if ($data->{$self->record}) {
            my
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Exporter/MARC/Base.pm ( view source; MetaCPAN )
nd1, $ind2, @data);
            $marc->append_fields($field);
        }
    }

    $marc;
}

sub _json_to_raw {
    my ($self,$data) = @_;
    my @record = ();

    push (@record , [ 'LDR', ' ', ' ', 
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Exporter/MARC/XML.pm ( view source; MetaCPAN )
my $indent = $self->collection ? 1 : 0;

    if ($self->record_format eq 'MARC-in-JSON') {
        $data = $self->_json_to_raw($data);
    }

    if ($self->collection) {
        $self->_line($indent,
 record (default: 'record')

=item record_format

Optionally set to 'MARC-in-JSON' when the input format is in MARC-in-JSON

=item collection

add a marc:collection header when true (default: true)

=
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Validator/MARC.pm ( view source; MetaCPAN )
or load custom MARC schema
    my $validator = Catmandu::Validator::MARC->new( schema => 'schema.json' );

    my $importer = Catmandu::Importer::MARC->new(
        file => 't/camel.mrc',
       
ma.json')


=head1 DESCRIPTION

This L<Catmandu::Validator> can be used to check MARC records against an MARC21 schema. For more information see L<MARC::Schema> and L<"MARC21 structure in JSON"|h
ttps://pkiraly.github.io/2018/01/28/marc21-in-json/>.

See also L<Catmandu::Fix::validate>, and L<Catmandu::Fix::Condition::valid> for usage of validators in Catmandu Fix language.

=head1 CONFIGU
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Importer/MARC/MiJ.pm ( view source; MetaCPAN )
ckage that imports MARC-in-JSON records

=head1 SYNOPSIS

    # From the command line
    $ catmandu convert MARC --type MiJ --fix "marc_map('245a','title')" < /foo/bar.json

    # From perl
    use C
u;

    # import records from file
    my $importer = Catmandu->importer('MARC',file => '/foo/bar.json', type => 'MiJ');
    my $fixer    = Catmandu->fixer("marc_map('245a','title')");

    $importer-
Mojo-Leds ( E/EB/EBRUNI/Mojo-Leds-1.18.tar.gz, EBRUNI, 2024; MetaCPAN )
Mojo-Leds/lib/Mojo/Leds/Rest.pm ( view source; MetaCPAN )

use Mojo::Base 'Mojo::Leds::Page';
use Mojo::Util qw(decamelize class_to_path);
use Mojo::JSON qw(decode_json);

has table => sub {
    return decamelize(
        ( split( /\//, class_to_path( ref sh
3 ) if $c->ro;
    my $rec = $c->_json_from_body;
    return unless ($rec);
    $rec = $c->_create($rec);
    return unless ($rec);
    $c->render_json( $c->_rec2json($rec) );
}

sub delete {
    my $
n $c->_raise_error( 'Element not found', 404 ) unless $rec;
    $c->_delete($rec);
    $c->render_json( undef, 204 );
}

sub list {
    my $c     = shift;
    my $query = $c->param('query');
    retur
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Fix/Inline/marc_set.pm ( view source; MetaCPAN )
teral value
 my $data  = marc_set($data,'245[1]a', 'value');

 # Set to a copy of a deeply nested JSON path
 my $data  = marc_set($data,'245[1]a', '$.my.deep.field');

 =head1 DEPRECATED

 This module
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Fix/Inline/marc_add.pm ( view source; MetaCPAN )
al value
 my $data  = marc_add($data, '245',  a => 'value');

 # Set to a copy of a deeply nested JSON path
 my $data  = marc_add($data, '245',  a => '$.my.deep.field');

=head1 DEPRECATED

This modul
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/Importer/MARC.pm ( view source; MetaCPAN )
Package that imports MARC data

=head1 SYNOPSIS

    # On the command line

    # Convert MARC to JSON (default)
    $ catmandu convert MARC < /foo/bar.mrc

    # Convert MARC to MARC
    $ catmandu c
or MARCMaker/MARCBreaker records
  MiJ: L<Catmandu::Importer::MARC::MiJ> (MARC in JSON) - a parser for the MARC-in-JSON format
  XML: L<Catmandu::Importer::MARC::XML> - a parser for the MARC XML forma
Catmandu-MARC ( H/HO/HOCHSTEN/Catmandu-MARC-1.33.tar.gz, HOCHSTEN, 2024; MetaCPAN )
Catmandu-MARC/lib/Catmandu/MARC/Tutorial.pod ( view source; MetaCPAN )
characters:

  $ iconv -c -f UTF-8 -t UTF-8 marc21.utf8.raw | catmandu convert MARC --type RAW to JSON

=head2 Convert a decomposed UTF-8 file to a combined UTF-8 file and vice versa

For example, the
t

=head1 READING

=head2 Convert MARC21 records into JSON

The command below converts file data.mrc into JSON:

   $ catmandu convert MARC to JSON < data.mrc

=head2 Convert MARC21 records into MARC-
onvert UNIMARC records into JSON, XML, ...

To read UNIMARC records use the RAW parser to get the correct character
encoding.

   $ catmandu convert MARC --type RAW to JSON < data.mrc
   $ catmandu co
Test-Dependencies ( E/EH/EHUELS/Test-Dependencies-0.34.tar.gz, EHUELS, 2024; MetaCPAN )
Test-Dependencies/lib/Test/Dependencies.pm ( view source; MetaCPAN )
8' forward_compatible => 1;

    my $meta = CPAN::Meta->load_file('META.json'); # or META.yml
    plan skip_all => 'No META.json' if ! $meta;

    my @files = File::Find::Rule::Perl->perl_files->in('.
g_dep = $@;
    }
    die $missing_dep if $missing_dep;

    my $meta;
    for my $file (qw/ META.json META.yml /) {
        if (-r $file) {
            $tb->ok(1, "$file is present and readable");
  

        }
    }

    if (! $meta) {
        $tb->level(2);
        $tb->ok(0, "Missing META.{yml,json} file for dependency checking");
        $tb->diag("Use the non-legacy invocation to provide the 
Blockchain-Ethereum-Keystore ( R/RE/REFECO/Blockchain-Ethereum-Keystore-0.011.tar.gz, REFECO, 2024; MetaCPAN )
Blockchain-Ethereum-Keystore/lib/Blockchain/Ethereum/Keystore/Keyfile.pm ( view source; MetaCPAN )
TY
our $VERSION   = '0.011';          # VERSION

use Carp;
use File::Slurp;
use JSON::MaybeXS qw(decode_json encode_json);
use Crypt::PRNG;
use Net::SSH::Perl::Cipher;

use Blockchain::Ethereum::Keyst
ub id {
    shift->{id};
}

sub private_key {
    shift->{private_key};
}

sub _json {
    return shift->{json} //= JSON::MaybeXS->new(utf8 => 1);
}

sub import_file {
    my ($self, $file_path, $pass
word) = @_;

    my $content = read_file($file_path);
    my $decoded = $self->_json->decode(lc $content);

    return $self->_from_object($decoded, $password);
}

sub _from_object {
    my ($self, $o
DBIx-Class-Helpers ( W/WE/WESM/DBIx-Class-Helpers-2.037000.tar.gz, WESM, 2024; MetaCPAN )
DBIx-Class-Helpers/lib/DBIx/Class/Helper/Row/NumifyGet.pm ( view source; MetaCPAN )
  => 'integer',
       is_nullable       => 0,
       is_numeric        => 1,
    },
 );

 sub TO_JSON {
    return {
       foo => $self->foo,  # this becomes 0 instead of "0" due to context
    }
 }
XTP ( D/DY/DYLIBSO/XTP-0.001.tar.gz, DYLIBSO, 2024; MetaCPAN )
XTP/lib/XTP/Client.pm ( view source; MetaCPAN )
use 5.016;
use warnings;
use Carp qw(croak carp);
use Date::Parse;
use Extism;
use JSON::PP qw(decode_json encode_json);
use LWP::UserAgent;

sub __request {
    my ($self, $path, $opt) = @_;
    $opt
   $res->content
}

sub _json_request {
    my ($self, $path, $opt) = @_;
    $opt //= {};
    if (exists $opt->{body}) {
        $opt->{body} = eval {
            encode_json($opt->{body})
        };
 to json\n";
        }
        $opt->{headers}{'Content-Type'} //= 'application/json; charset=utf-8';
    }
    my $res = $self->__request($path, $opt);
    my $content = eval {
        decode_json($r
Mojo-Leds ( E/EB/EBRUNI/Mojo-Leds-1.18.tar.gz, EBRUNI, 2024; MetaCPAN )
Mojo-Leds/lib/Mojo/Leds/Page.pm ( view source; MetaCPAN )
rmat );

    $s->respond_to(
        html => sub { $s->render_pm },
        json => sub { $s->render( json => $s->render_json ) },
        css  => sub { $s->render_static_file },
        js   => sub {
ly->not_found;
}

sub render_html {
    my $c = shift;

    # needed for recursive calls (html -> json as an example)
    my $query = $c->req->params->to_hash;
    while ( my ( $k, $v ) = each %$query
$k => $v );
    }
    return { template => class_to_path( ref($c) ) =~ s/\.pm//r };
}

sub render_json {
    my $c = shift;
    return {};
}

sub render_static_file {
    my $c = shift;

    # optiona
Mojo-Leds ( E/EB/EBRUNI/Mojo-Leds-1.18.tar.gz, EBRUNI, 2024; MetaCPAN )
Mojo-Leds/lib/Mojo/Leds/Rest/DBIx.pm ( view source; MetaCPAN )
ror( 'Element duplicated', 409 )
      unless ( $rec->in_storage );

    return $rec;
}

sub _rec2json() {
    my $c   = shift;
    my $rec = shift || $c->stash( $c->_class_name . '::record' );
    re
ec);

    # annullo tutti i campi
    $rec->$_(undef) foreach ( grep !/^${pk}$/, keys %{ $c->_rec2json } );
    while ( my ( $k, $v ) = each %$set ) {
        $rec->$k($v);
    }

    $rec->update;
  
$c->_rec2json($_);
    }
    if ($rc) {
        $recs = { count => $rec->pager->total_entries, recs => $recs };
    }

    return $recs;
}

sub _listupdate {
    my $c    = shift;
    my $json = shift

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.