lta-rs
lta-rs is a lta datamall client library written in pure safe rust. lta-rs is used to interact with the lta-datamall
lta-rust in action
Cargo.toml setup
[]
# for now, I will add to crates.io once its ready
= { = "https://github.com/BudiNverse/lta-rs", = "0.1" }
API key setup
You can get your API key from here
extern crate lta;
use ;
Examples
Getting bus timings
use bus_arrival;
Getting anything else
// All the APIs in this library are designed to be used like this
// `module::get_something`
// All of them return Result<Vec<T>, Error>
// The example below is bus::get_bus_services()
// and traffic::get_erp_rates()
// Do note that the API is similar across all the APIs except for
// bus::get_bus_arrival
use get_bus_services;
Getting help
- Take a look at the docs on docs.rs
- You can get help via github issues. I will try my best to respond to your queries :smile:
Design decisions
- Made sure that Rust structs are as close to the original response as possible to make sure that people can reference the original docs if there are any issues
- Simple and no additional baggage. Only the client is included. E.g If anyone wants to add concurrency, they have to do it their own
Changelog
Version 0.1
- All endpoints that are available from lta datamall website
- Configuration using API
License
lta-rs is licensed under MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
Frequently Asked Questions
Where do I get the official docs from lta?
You can get them here
Why are some of the datatypes different from the lta documentation?
Some of the datatypes returned are not ideal such as returning lat and lang as string rather than number. Some of the types are also converted to enums to reduce the number of stringly typed stuff
My application panicked.
Check if your API key is valid, if not create a github issue
Is this project affiliated to LTA or any government bodies?
No