https://github.com/vector-hector/fptf
Go bindings for fptf
https://github.com/vector-hector/fptf
fptf golang golang-package gtfs open-data public-transport transport
Last synced: 6 months ago
JSON representation
Go bindings for fptf
- Host: GitHub
- URL: https://github.com/vector-hector/fptf
- Owner: Vector-Hector
- License: mit
- Created: 2021-03-29T01:28:16.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-22T17:55:51.000Z (over 2 years ago)
- Last Synced: 2024-06-20T06:38:51.721Z (about 2 years ago)
- Topics: fptf, golang, golang-package, gtfs, open-data, public-transport, transport
- Language: Go
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# fptf
Go bindings
of [fptf](https://github.com/public-transport/friendly-public-transport-format/blob/1.2.1/spec/readme.md).
This package is just a collection of types and (un)marshall functions, really.
But since fptf requires some optional stuff (e.g. stops can be objects or strings),
you'd kind of have to add a lot of functions to your types. \
This package takes care of that.
## Usage
Import the stuff:
```go
package main
import (
"encoding/json"
"github.com/Vector-Hector/fptf"
)
func main() {
// ...find some data called dat
var journey fptf.Journey
err := json.Unmarshal(dat, &journey)
if err != nil {
panic(err)
}
}
```
All the types specified in the [specs](https://github.com/public-transport/friendly-public-transport-format/blob/1.2.1/spec/readme.md)
can be accessed through this package. \
Just capitalize the first letter and write fptf. in front of it ^^