Coder Social home page Coder Social logo

goefa's Introduction

goEFA

package goefa implements a Go client library to access data of public transport services, which provide an EFA interface. You can search for a stop, query for upcoming departures and request a route / trip itinerary.

goefa

Installation

Make sure you have a working Go environment (Go 1.3 or higher is required). See the install instructions.

To install goEFA, simply run:

go get github.com/muesli/goefa

To compile it from source:

cd $GOPATH/src/github.com/muesli/goefa
go get -u -v
go build && go test -v

Usage

Simple example on how to verify a stop and get the departures:

// create a new EFAProvider
provider := goefa.NewProvider("https://efa.mvv-muenchen.de/mvv/", true)

// Find a stop by name
stops, err := provider.FindStop("Königsplatz")

// Get the 5 next departures for a stop
deps, err := stops[0].Departures(time.Now(), 5)

// Plan a trip between two stops
routes, err := provider.Route(originStop.ID, destinationStop.ID, time.Now())
...

Available Providers

City Provider Base URL
Augsburg AVV https://efa.avv-augsburg.de/avv/
Munich MVV https://efa.mvv-muenchen.de/mvv/

The german wikipedia article on EFA contains more information about EFA and available providers.

GoDoc Build Status Coverage Status Go ReportCard

goefa's People

Contributors

michiwend avatar muesli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

goefa's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.