An open API service indexing awesome lists of open source software.

https://github.com/attron/amtrak

simple amtrak data wrapper for go
https://github.com/attron/amtrak

amtrak api go golang tracking-api train trains trains-information wrapper

Last synced: 3 months ago
JSON representation

simple amtrak data wrapper for go

Awesome Lists containing this project

README

          

# AMTRAK
An unoffical train status wrapper for use with Amtrak!
This package uses the data available from [amtrak](https://maps.amtrak.com/services/MapDataService/trains/getTrainsData) and converts it into usable train information.

## Usage
```bash
go get -u "github.com/ATTron/amtrak"
```

```go
import (
"fmt"
"github.com/ATTron/amtrak"
)

func main() {
fmt.Println("SHOWING TRAIN 95: ", amtrak.GetTrain(95))
}
```

#### Functions
Currently this only has 2 functions. Return a specific train or return every train.

```go
import (
"github.com/ATTron/amtrak"
)
func main() {
allTrains := amtrak.GetAllTrains()
myTrain := amtrak.GetTrain(95)
}
```

#### Additional Docs
Full documentation can be found on [pkg.go.dev](https://pkg.go.dev/github.com/ATTron/amtrak)