Current section
Files
Jump to
Current section
Files
ptv_timetable
README.md
README.md
# PTV Timetable
An Elixir client for the [PTV](https://www.vic.gov.au/public-transport-timetable-api) timetable API using Finch.
## Installation
The package can be installed by adding `:ptv_timetable` to your `mix.exs`
```elixir
def deps do
[
{:ptv_timetable, "~> 0.1.0"}
]
end
```
## Quickstart
- You need a Developer ID and API Key, to request [one](https://www.vic.gov.au/public-transport-timetable-api)
All you need to do is start `PtvTimetable` in a supervision tree
```elixir
defmodule MyApp.Application do
use Application
def start(_type, _args) do
# . . .
children = [{PtvTimetable, api_key: ptv_api_key, user_id: ptv_devid }]
Supervisor.start_link(children, strategy: :one_for:one)
end
end
```
Then somewhere in your application:
```elixir
# . . .
PtvTimetable.request("/route", [])
# . . .
```
## License
The code in this repository is licensed under the Apache-2.0 license, you can find a copy in the local tree.