Group
Extension

Matches 23

App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/Generic/Json.pm ( view source; MetaCPAN )
package App::PipeFilter::Generic::Json;
{
  $App::PipeFilter::Generic::Json::VERSION = '0.005';
}

use Moose;

extends 'App::PipeFilter::Generic';

with qw(
  App::PipeFilter::Role::Reader::Sysread
  
rint
  App::PipeFilter::Role::Input::Json
  App::PipeFilter::Role::Output::Json
);

1;

__END__

=pod

=head1 NAME

App::PipeFilter::Generic::Json - a generic JSON pipeline filter

=head1 VERSION

ver
::PipeFilter::JsonCat;

  use Moose;
  extends 'App::PipeFilter::Generic::Json';
  with 'App::PipeFilter::Role::Transform::None';

  1;

=head1 DESCRIPTION

App::PipeFilter::Generic::Json is a generic
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/Role/Output/Json.pm ( view source; MetaCPAN )
ole::Output::Json;
{
  $App::PipeFilter::Role::Output::Json::VERSION = '0.005';
}

use Moose::Role;

use JSON::XS;

sub encode_output {
  # Skips $self in $_[0].
  return map { encode_json($_) . "\n" 
E

App::PipeFilter::Role::Output::Json - serialize output as one JSON object per line

=head1 VERSION

version 0.005

=head1 SYNOPSIS

  package App::PipeFilter::JsonToYaml;

  use Moose;

  extends '
peFilter::Role::Input::Json
    App::PipeFilter::Role::Transform::None
    App::PipeFilter::Role::Output::Yaml
  );

  1;

=head1 DESCRIPTION

App::PipeFilter::Role::Output::Json provides an encode_ou
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/Role/Input/Json.pm ( view source; MetaCPAN )
Json;
{
  $App::PipeFilter::Role::Input::Json::VERSION = '0.005';
}

use Moose::Role;

use JSON::XS;

has _json => (
  is      => 'rw',
  isa     => 'JSON::XS',
  lazy    => 1,
  default => sub { JSON
) = $self->_json()->incr_parse($$buffer_ref);
  $$buffer_ref = "";
  return @return;
}

1;

__END__

=pod

=head1 NAME

App::PipeFilter::Role::Input::Json - parse input as a stream of JSON records

=h
ic::Json;

  use Moose;

  extends 'App::PipeFilter::Generic';

  with qw(
    App::PipeFilter::Role::Reader::Sysread
    App::PipeFilter::Role::Input::Json
    App::PipeFilter::Role::Output::Json
  )
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/JsonToYaml.pm ( view source; MetaCPAN )
package App::PipeFilter::JsonToYaml;
{
  $App::PipeFilter::JsonToYaml::VERSION = '0.005';
}

use Moose;
extends 'App::PipeFilter::Generic';

with (
  "App::PipeFilter::Role::Reader::Sysread",
  "App::
put::Json",
  "App::PipeFilter::Role::Transform::None",
  "App::PipeFilter::Role::Output::Yaml",
  "App::PipeFilter::Role::Writer::Print",
);

1;

__END__

=pod

=head1 NAME

App::PipeFilter::JsonToYa
f JSON objects into YAML

=head1 VERSION

version 0.005

=head1 SYNOPSIS

Here is the json2yaml(1) pipeline filter.

  #!/usr/bin/perl
  use App::PipeFilter::JsonToYaml;
  exit App::PipeFilter::JsonTo
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/MysqlToJson.pm ( view source; MetaCPAN )
package App::PipeFilter::MysqlToJson;
{
  $App::PipeFilter::MysqlToJson::VERSION = '0.005';
}

use Moose;

extends 'App::PipeFilter::Generic';
with qw(
  App::PipeFilter::Role::Reader::LineByLine
  Ap
p::PipeFilter::Role::Output::Json
  App::PipeFilter::Role::Transform::None
);

use JSON::XS;

has _fields => (
  is  => 'rw',
  isa => 'ArrayRef',
);

before filter_file => sub {
  my ($self, $ifh, $o
ysqlToJson - translate mysql batch output to JSON

=head1 VERSION

version 0.005

=head1 SYNOPSIS

Here is the mysql2json(1) pipeline filter.

  #!/usr/bin/perl
  use App::PipeFilter::MysqlToJson;
  e
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/JsonCut.pm ( view source; MetaCPAN )
::PipeFilter::JsonCut;
{
  $App::PipeFilter::JsonCut::VERSION = '0.005';
}

use Moose;
extends 'App::PipeFilter::Generic::Json';

# TODO - Refactor into a common role?  Duplicated in JsonToTsv.pm.

ha
Filter::JsonCut - return specified fields from a JSON stream

=head1 VERSION

version 0.005

=head1 SYNOPSIS

Here is the jcut(1) pipeline filter.

  #!/usr/bin/perl
  use App::PipeFilter::JsonCut;
  
exit App::PipeFilter::JsonCut->new_with_options()->run();

=head1 DESCRIPTION

App::PipeFilter::JsonCut implements the jcut(1) pipeline filter.  It's
modeled after the UNIX cut(1) utility.
Please see 
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/JsonPath.pm ( view source; MetaCPAN )
package App::PipeFilter::JsonPath;
{
  $App::PipeFilter::JsonPath::VERSION = '0.005';
}

use Moose;
extends 'App::PipeFilter::Generic::Json';

use JSON::Path;

has o => (
  is            => 'rw',
  is
[JSON::Path]',
  lazy          => 1,
  default       => sub {
    my $self = shift;
    return [ map { JSON::Path->new($_) } @{$self->o()} ];
  },
);

sub transform {
  my $self = shift();

  my @json
put;

  my $c = 0;
  foreach my $json_path (@json_paths) {
    my $r = 0;
    foreach my $json_value ($json_path->values($_[0])) {
      $output[$r++]{"col$c"} = $json_value;
    }
    ++$c;
  }

  re
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/JsonIpToUdp.pm ( view source; MetaCPAN )
package App::PipeFilter::JsonIpToUdp;
{
  $App::PipeFilter::JsonIpToUdp::VERSION = '0.005';
}

use Moose;
extends 'App::PipeFilter::Generic::Json';
with 'App::PipeFilter::Role::Transform::IpToUdp';

1
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/JsonToPcap.pm ( view source; MetaCPAN )
package App::PipeFilter::JsonToPcap;
{
  $App::PipeFilter::JsonToPcap::VERSION = '0.005';
}

use Moose;
extends 'App::PipeFilter::Generic';

with (
  "App::PipeFilter::Role::Reader::Sysread",
  "App::
PipeFilter::Role::Input::Json",
  "App::PipeFilter::Role::Transform::None",
	"App::PipeFilter::Role::Opener::PcapOutput",
  "App::PipeFilter::Role::Output::Pcap",
  "App::PipeFilter::Role::Writer::Pca
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter.pm ( view source; MetaCPAN )
like JSON rather than whitespace
separated fields.

For example, jcut is a simple version of cut(1) that understands JSON
objects rather than whitespace separated fields.

  % head -1 sample.json
  {"
node","channel":"#perl","nick":"dngor","karma":"120"}

  % jcut -o network -o channel < eg/sample.json | sort | uniq
  {"network":"efnet","channel":"#perl"}
  {"network":"efnet","channel":"#poe"}
  {"
channel":"#reflex"}

The jsonpath filter supports more complex expressions using
JSON::Path's variant of JSONPath.

  curl -s 'http://api.duckduckgo.com/?q=poe&o=json' |
  jsonpath -o '$..Topics.*.Fir
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/JsonEthernetToIp.pm ( view source; MetaCPAN )
package App::PipeFilter::JsonEthernetToIp;
{
  $App::PipeFilter::JsonEthernetToIp::VERSION = '0.005';
}

use Moose;
extends 'App::PipeFilter::Generic::Json';
with 'App::PipeFilter::Role::Transform::Et
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/JsonMap.pm ( view source; MetaCPAN )
package App::PipeFilter::JsonMap;
{
  $App::PipeFilter::JsonMap::VERSION = '0.005';
}

use Moose;
extends 'App::PipeFilter::Generic::Json';

has i => (
  is            => 'rw',
  isa           => 'Arr
lter::JsonMap - map input fields to output fields by renaming them

=head1 VERSION

version 0.005

=head1 SYNOPSIS

  #!/usr/bin/perl
  use App::PipeFilter::JsonMap;
  exit App::PipeFilter::JsonMap->n
ilter::JsonMap implements the jmap(1) pipeline filter.  It
renames JSON object fields by mapping input field names to new ones on
output.

This class subclasses L<App::PipeFilter::Generic::Json>.

=he
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/JsonSort.pm ( view source; MetaCPAN )
::JsonSort;
{
  $App::PipeFilter::JsonSort::VERSION = '0.005';
}

use Moose;
extends 'App::PipeFilter::Generic';
with qw(
  App::PipeFilter::Role::Reader::Sysread
  App::PipeFilter::Role::Input::Json
  App::PipeFilter::Role::Writer::Print
  App::PipeFilter::Role::Transform::None
);

use JSON::XS;

has k => (
  is            => 'rw',
  isa           => 'ArrayRef',
  default       => sub { die "requ
("\t", @sortable{@fields}, encode_json($_)) . "\n";
  } @_;
}

1;

__END__

=pod

=head1 NAME

App::PipeFilter::JsonSort - a sort(1)-like filter that understands JSON fields

=head1 VERSION

version 0
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/Role/Reader/LineByLine.pm ( view source; MetaCPAN )
pp::PipeFilter::MysqlToJson;

  use Moose;

  extends 'App::PipeFilter::Generic';
  with qw(
    App::PipeFilter::Role::Reader::LineByLine
    App::PipeFilter::Role::Output::Json
    App::PipeFilter::
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/Role/Output/Yaml.pm ( view source; MetaCPAN )
age App::PipeFilter::JsonToYaml;

  use Moose;

  extends 'App::PipeFilter::Generic';

  with qw(
    App::PipeFilter::Role::Reader::Sysread
    App::PipeFilter::Role::Input::Json
    App::PipeFilter:
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/Role/Reader/Sysread.pm ( view source; MetaCPAN )
ic::Json;

  use Moose;

  extends 'App::PipeFilter::Generic';

  with qw(
    App::PipeFilter::Role::Reader::Sysread
    App::PipeFilter::Role::Input::Json
    App::PipeFilter::Role::Output::Json
  )
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/JsonPcapToEthernet.pm ( view source; MetaCPAN )
package App::PipeFilter::JsonPcapToEthernet;
{
  $App::PipeFilter::JsonPcapToEthernet::VERSION = '0.005';
}

use Moose;
extends 'App::PipeFilter::Generic::Json';
with 'App::PipeFilter::Role::Transform
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/Role/Output/Tsv.pm ( view source; MetaCPAN )
kage App::PipeFilter::JsonToTsv;

  use Moose;

  extends 'App::PipeFilter::Generic';

  with qw(
    App::PipeFilter::Role::Reader::Sysread
    App::PipeFilter::Role::Input::Json
    App::PipeFilter:
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/Generic.pm ( view source; MetaCPAN )
END__

=pod

=abstract a generic pipeline filter.

=head1 SYNOPSIS

=for example App::PipeFilter::JsonToYaml

=head1 DESCRIPTION

App::PipeFilter::Generic is a generic shell pipeline filter.  It is
de
For example, L<App::PipeFilter::JsonToYaml> extends the generic
pipeline filter with a role to read data in large chunks, a role to
parse that input as a stream of JSON objects, a role that doesn't
al
.

This method is usually implemented by Input roles.

=for example App::PipeFilter::Role::Input::Json decode_input

=head2 encode_output ARRAY

encode_output() accepts an array of Perl data structure
App-PipeFilter ( R/RC/RCAPUTO/App-PipeFilter-0.005.tar.gz, RCAPUTO, 2012; MetaCPAN )
App-PipeFilter/lib/App/PipeFilter/JsonCat.pm ( view source; MetaCPAN )
package App::PipeFilter::JsonCat;
{
  $App::PipeFilter::JsonCat::VERSION = '0.005';
}

use Moose;
extends 'App::PipeFilter::Generic::Json';
with 'App::PipeFilter::Role::Transform::None';

1;

__END__
peFilter::JsonCat - useless use of cat(1) for JSON streams

=head1 VERSION

version 0.005

=head1 SYNOPSIS

Here is the jcat(1) pipeline filter.

  #!/usr/bin/perl
  use App::PipeFilter::JsonCat;
  ex
it App::PipeFilter::JsonCat->new_with_options()->run();

=head1 DESCRIPTION

App::PipeFilter::JsonCat implements the jcat(1) pipeline filter.
Please see jcat(1) for usage instructions.

This module su

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