Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yageek/tpggo
:bus: API for TPG
https://github.com/yageek/tpggo
api golang opendata tpg
Last synced: about 2 months ago
JSON representation
:bus: API for TPG
- Host: GitHub
- URL: https://github.com/yageek/tpggo
- Owner: yageek
- License: mit
- Created: 2018-12-13T19:23:43.000Z (about 6 years ago)
- Default Branch: develop
- Last Pushed: 2019-02-19T15:44:19.000Z (almost 6 years ago)
- Last Synced: 2024-10-14T20:59:21.179Z (3 months ago)
- Topics: api, golang, opendata, tpg
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tpggo
An http client for the TPG Open Data.
For more explanation: [TPG Open Data](http://www.tpg.ch/fr/web/open-data/mode-d-emploi)
## Installation
```shell
go get github.com/gophersch/tpggo
```## Usage
```go
package mainimport (
"fmt""github.com/gophersch/tpggo"
)const (
apiKey = "MY_KEY"
)func main() {
client := tpggo.NewClient(apiKey)
// Get all the stops
if resp, err := client.GetStops(); err != nil {
panic(err)
} else {
for _, stop := range resp.Stops {
fmt.Printf("Stop Name: %s | Code: %s \n", stop.Code, stop.Name)
}
}
}
```