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

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

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]

Properties

Versions0.1.0.0, 0.1.0.0, 0.2.0.0
Change logNone available
Dependenciesbase (>=4.7 && <5), protocol-buffers (>=2.4.11 && <3), protocol-buffers-descriptor (>=2.4.11 && <3) [details]
LicenseBSD-3-Clause
CopyrightCthulhu (c) 2018
AuthorCthulhu
Maintainercthulhu.den@gmail.com
CategoryData
Home pagehttps://github.com/CthulhuDen/gtfs-realtime#readme
Bug trackerhttps://github.com/CthulhuDen/gtfs-realtime/issues
Source repositoryhead: git clone https://github.com/CthulhuDen/gtfs-realtime
UploadedWed Dec 5 22:44:28 UTC 2018 by CthulhuDen

Modules

Downloads

Maintainers' 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.