https://github.com/muesli/goefa
A Go client for EFA APIs (Elektronische Fahrplan Auskunft)
https://github.com/muesli/goefa
hacktoberfest
Last synced: about 1 month ago
JSON representation
A Go client for EFA APIs (Elektronische Fahrplan Auskunft)
- Host: GitHub
- URL: https://github.com/muesli/goefa
- Owner: muesli
- License: agpl-3.0
- Created: 2018-01-25T04:58:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-07T04:04:52.000Z (almost 6 years ago)
- Last Synced: 2025-03-31T03:03:44.497Z (3 months ago)
- Topics: hacktoberfest
- Language: Go
- Size: 134 KB
- Stars: 18
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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.
## Installation
Make sure you have a working Go environment (Go 1.3 or higher is required).
See the [install instructions](http://golang.org/doc/install.html).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:
```go
// 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](https://de.wikipedia.org/wiki/Elektronische_Fahrplanauskunft_%28Software%29)
contains more information about EFA and available providers.## Links
[](https://godoc.org/github.com/muesli/goefa)
[](https://travis-ci.org/muesli/goefa)
[](https://coveralls.io/github/muesli/goefa?branch=master)
[](http://goreportcard.com/report/muesli/goefa)