gtfs-realtime: GTFS RealTime protobafs library (autogenerated from .proto file)

[ bsd3, data, library ] [ Propose Tags ]

Please see the README on GitHub at https://github.com/CthulhuDen/gtfs-realtime#readme or https://hackage.haskell.org/package/gtfs-realtime


[Skip to Readme]
Versions 0.1.0.0, 0.2.0.0
Dependencies base (>=4.7 && <5), protocol-buffers (==2.4.11.*), protocol-buffers-descriptor (==2.4.11.*) [details]
License BSD-3-Clause
Copyright Cthulhu (c) 2018
Author Cthulhu
Maintainer cthulhu.den@gmail.com
Revised Revision 1 made by CthulhuDen at Thu Dec 6 07:56:10 UTC 2018
Category Data
Home page https://github.com/CthulhuDen/gtfs-realtime#readme
Bug tracker https://github.com/CthulhuDen/gtfs-realtime/issues
Source repo head: git clone https://github.com/CthulhuDen/gtfs-realtime
Uploaded by CthulhuDen at Wed Dec 5 22:45:14 UTC 2018
Distributions NixOS:0.2.0.0
Downloads 50 total (50 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2018-12-05 [all 2 reports]
Hackage Matrix CI

Modules

  • GTFS
    • RealTime
      • GTFS.RealTime.Protobuf
        • GTFS.RealTime.Protobuf.Alert
          • GTFS.RealTime.Protobuf.Alert.Cause
          • GTFS.RealTime.Protobuf.Alert.Effect
        • GTFS.RealTime.Protobuf.EntitySelector
        • GTFS.RealTime.Protobuf.FeedEntity
        • GTFS.RealTime.Protobuf.FeedHeader
          • GTFS.RealTime.Protobuf.FeedHeader.Incrementality
        • GTFS.RealTime.Protobuf.FeedMessage
        • GTFS.RealTime.Protobuf.Position
        • GTFS.RealTime.Protobuf.TimeRange
        • GTFS.RealTime.Protobuf.TranslatedString
          • GTFS.RealTime.Protobuf.TranslatedString.Translation
        • GTFS.RealTime.Protobuf.TripDescriptor
          • GTFS.RealTime.Protobuf.TripDescriptor.ScheduleRelationship
        • GTFS.RealTime.Protobuf.TripUpdate
          • GTFS.RealTime.Protobuf.TripUpdate.StopTimeEvent
          • GTFS.RealTime.Protobuf.TripUpdate.StopTimeUpdate
            • GTFS.RealTime.Protobuf.TripUpdate.StopTimeUpdate.ScheduleRelationship
        • GTFS.RealTime.Protobuf.VehicleDescriptor
        • GTFS.RealTime.Protobuf.VehiclePosition
          • GTFS.RealTime.Protobuf.VehiclePosition.CongestionLevel
          • GTFS.RealTime.Protobuf.VehiclePosition.OccupancyStatus
          • GTFS.RealTime.Protobuf.VehiclePosition.VehicleStopStatus

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees


Readme for gtfs-realtime-0.1.0.0

[back to package description]

GTFS RealTime

Haskell protobuf definitions for GTFS RealTime feed data. Autogenerated by and supposed to be used with protocol-buffers.

Usage example

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}

module Main where

import qualified Data.ByteString.Lazy as LBS
import           Data.Function
import           GTFS.RealTime.Protobuf.FeedMessage
import           Network.HTTP.Simple (Request, setRequestQueryString, httpLBS, getResponseBody)
import qualified Text.ProtocolBuffers as Protobuf

main :: IO ()
main = do
  resp <- httpLBS $ "http://transport.orgp.spb.ru/Portal/transport/internalapi/gtfs/realtime/vehicle"
                      & setRequestQueryString [("routeIDs", Just "1843")]

  msg <- case Protobuf.messageGet $ getResponseBody resp of
    Left err                       -> fail err
    Right (msg :: FeedMessage, "") -> pure msg
    _                              -> fail "parse incomplete"

  -- | You now have FeedMessage parsed
  print msg

Source proto file

This transport.proto file was used to generate the modules, it is the same as provided here, only with modified package name.