Opendata-GTFS-Feed

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Dist::Iller::Config::Author::CSSON" : "0.0309"
         }
      },
      "runtime" : {
         "recommends" : {
            "Text::CSV_XS" : "0"
         },
         "requires" : {
            "Archive::Extract" : "0",
            "Archive::Zip" : "0",
            "File::BOM" : "0",
            "File::Temp" : "0",
            "Lingua::EN::Inflect" : "0",
            "List::Util" : "1.42",
            "List::UtilsBy" : "0.04",
            "Moose" : "2.1405",
            "Moose::Role" : "0",
            "MooseX::AttributeDocumented" : "0.1003",
            "MooseX::AttributeShortcuts" : "0.028",
            "Path::Tiny" : "0.072",
            "Text::CSV" : "0",

META.yml  view on Meta::CPAN

    file: lib/Opendata/GTFS/Type/Trip.pm
    version: '0.0202'
  Types::Opendata::GTFS:
    file: lib/Types/Opendata/GTFS.pm
    version: '0.0202'
recommends:
  Text::CSV_XS: '0'
requires:
  Archive::Extract: '0'
  Archive::Zip: '0'
  File::BOM: '0'
  File::Temp: '0'
  Lingua::EN::Inflect: '0'
  List::Util: '1.42'
  List::UtilsBy: '0.04'
  Moose: '2.1405'
  Moose::Role: '0'
  MooseX::AttributeDocumented: '0.1003'
  MooseX::AttributeShortcuts: '0.028'
  Path::Tiny: '0.072'
  Text::CSV: '0'

Makefile.PL  view on Meta::CPAN

  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "Opendata-GTFS-Feed",
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.010000",
  "NAME" => "Opendata::GTFS::Feed",
  "PREREQ_PM" => {
    "Archive::Extract" => 0,
    "Archive::Zip" => 0,
    "File::BOM" => 0,
    "File::Temp" => 0,
    "Lingua::EN::Inflect" => 0,
    "List::Util" => "1.42",
    "List::UtilsBy" => "0.04",
    "Moose" => "2.1405",
    "Moose::Role" => 0,
    "MooseX::AttributeDocumented" => "0.1003",
    "MooseX::AttributeShortcuts" => "0.028",
    "Path::Tiny" => "0.072",
    "Text::CSV" => 0,

Makefile.PL  view on Meta::CPAN

  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Archive::Extract" => 0,
  "Archive::Zip" => 0,
  "ExtUtils::MakeMaker" => 0,
  "File::BOM" => 0,
  "File::Spec" => 0,
  "File::Temp" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "Lingua::EN::Inflect" => 0,
  "List::Util" => "1.42",
  "List::UtilsBy" => "0.04",
  "Moose" => "2.1405",
  "Moose::Role" => 0,
  "MooseX::AttributeDocumented" => "0.1003",

cpanfile  view on Meta::CPAN

# This file was auto-generated from iller.yaml by Dist::Iller on 2016-02-25 15:12:37 UTC.

on runtime => sub {
    requires 'Archive::Extract' => '0';
    requires 'Archive::Zip' => '0';
    requires 'File::BOM' => '0';
    requires 'File::Temp' => '0';
    requires 'Lingua::EN::Inflect' => '0';
    requires 'List::Util' => '1.42';
    requires 'List::UtilsBy' => '0.04';
    requires 'Moose' => '2.1405';
    requires 'Moose::Role' => '0';
    requires 'MooseX::AttributeDocumented' => '0.1003';
    requires 'MooseX::AttributeShortcuts' => '0.028';
    requires 'Path::Tiny' => '0.072';
    requires 'Text::CSV' => '0';

dist.ini  view on Meta::CPAN

Test::NoTabs = 1.4
Test::Warnings = 0.026

[Prereqs / DevelopSuggests]
Dist::Iller = 0.1408
Dist::Iller::Config::Author::CSSON = 0.0309

[Prereqs / RuntimeRequires]
Archive::Extract = 0
Archive::Zip = 0
File::BOM = 0
File::Temp = 0
Lingua::EN::Inflect = 0
List::Util = 1.42
List::UtilsBy = 0.04
Moose = 2.1405
Moose::Role = 0
MooseX::AttributeDocumented = 0.1003
MooseX::AttributeShortcuts = 0.028
Path::Tiny = 0.072
Text::CSV = 0

dist.ini  view on Meta::CPAN

; authordep Dist::Zilla::Plugin::Test::Compile = 2.054
; authordep Dist::Zilla::Plugin::Test::EOF = 0.0501
; authordep Dist::Zilla::Plugin::Test::EOL = 0.18
; authordep Dist::Zilla::Plugin::Test::Kwalitee::Extra = v0.2.1
; authordep Dist::Zilla::Plugin::Test::NoTabs = 0.15
; authordep Dist::Zilla::Plugin::Test::ReportPrereqs = 0.021
; authordep Dist::Zilla::Plugin::Test::Version = 1.05
; authordep Dist::Zilla::Plugin::TestRelease = 0
; authordep Dist::Zilla::Plugin::TravisYML = 1.15
; authordep Dist::Zilla::Plugin::UploadToCPAN = 0
; authordep File::BOM = 0
; authordep File::Temp = 0
; authordep Lingua::EN::Inflect = 0
; authordep List::Util = 1.42
; authordep List::UtilsBy = 0.04
; authordep Moose = 2.1405
; authordep Moose::Role = 0
; authordep MooseX::AttributeDocumented = 0.1003
; authordep MooseX::AttributeShortcuts = 0.028
; authordep Path::Tiny = 0.072
; authordep Pod::Elemental::Transformer::List = 0

iller.yaml  view on Meta::CPAN

      - List::Util
      - List::UtilsBy: 0.04
      - namespace::autoclean
      - Types::Standard
      - Types::Path::Tiny
      - Types::URI
      - Type::Tiny
      - Path::Tiny
      - Archive::Zip
      - Archive::Extract
      - File::BOM
      - File::Temp
      - Lingua::EN::Inflect
      - Text::CSV
    recommends:
      - Text::CSV_XS
  test:
    requires:
      - Test::RequiresInternet: 0.02
      - Try::Tiny

lib/Opendata/GTFS/Feed.pm  view on Meta::CPAN


# ABSTRACT: Parse General Transit Feeds (GTFS)
our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY
our $VERSION = '0.0202';

use Opendata::GTFS::Feed::Elk;
use Archive::Extract;
use File::Temp;
use Text::CSV;
use Lingua::EN::Inflect;
use File::BOM;

use Opendata::GTFS::Type::Agency;
use Opendata::GTFS::Type::Calendar;
use Opendata::GTFS::Type::CalendarDate;
use Opendata::GTFS::Type::FareAttribute;
use Opendata::GTFS::Type::FareRule;
use Opendata::GTFS::Type::Frequency;
use Opendata::GTFS::Type::Route;
use Opendata::GTFS::Type::Shape;
use Opendata::GTFS::Type::Stop;

lib/Opendata/GTFS/Feed.pm  view on Meta::CPAN

sub parse_file {
    my $self = shift;
    my $type = shift;
    my $filename = shift;

    my $method = sprintf 'add_%s', type_to_singular($type);
    my $class = sprintf 'Opendata::GTFS::Type::%s', $type->name;

    my $csv = Text::CSV->new( { binary => 1 } );
    my $fh;
    File::BOM::open_bom($fh, $self->directory->child($filename), ':utf8');

    my $column_names = $csv->getline($fh);
    if(!defined $column_names) {
        die sprintf "Can't read the first line of the file. Check %s for errors.", $self->directory->child($filename);
    }
    my @column_names = @{ $column_names };

    # Google's example feed (https://developers.google.com/transit/gtfs/examples/gtfs-feed / https://developers.google.com/transit/gtfs/examples/sample-feed.zip)
    # has a (reported) bug. This fixes that.
    if($type->name eq 'StopTime' && any { $_ eq 'drop_off_time' } @column_names) {

t/00-report-prereqs.dd  view on Meta::CPAN

                                      'Dist::Iller::Config::Author::CSSON' => '0.0309'
                                    }
                    },
       'runtime' => {
                      'recommends' => {
                                        'Text::CSV_XS' => '0'
                                      },
                      'requires' => {
                                      'Archive::Extract' => '0',
                                      'Archive::Zip' => '0',
                                      'File::BOM' => '0',
                                      'File::Temp' => '0',
                                      'Lingua::EN::Inflect' => '0',
                                      'List::Util' => '1.42',
                                      'List::UtilsBy' => '0.04',
                                      'Moose' => '2.1405',
                                      'Moose::Role' => '0',
                                      'MooseX::AttributeDocumented' => '0.1003',
                                      'MooseX::AttributeShortcuts' => '0.028',
                                      'Path::Tiny' => '0.072',
                                      'Text::CSV' => '0',



( run in 0.567 second using v1.01-cache-2.11-cpan-e9daa2b36ef )