Skip to content

oybek/taxi4s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Taxi4s master Coverage Lines of Code Cats friendly

Comfortable interface for working with taxi service api

Usage

import YandexTaxiSyntax._

implicit val cfg = YandexTaxiSyntax.Cfg(clid="", apiKey="")
implicit val yandexTaxiApi = new YandexTaxiApiHttp4s[IO](client)

val user = Coord(56.841099f, 60.659566f)
val cinema = Coord(56.837791f, 60.598800f)

for {
  taxiInfo <- (user to cinema).request(Econom)
  rideOpt = taxiInfo
    .options
    .find(_.className == Econom)
  replyToUser =
    rideOpt.fold(
      "No econom tariffs for your path at current moment"
    )(ride =>
      s"""
         |Taxi arrives in ${ride.waitingTime.getOrElse("unknown")} seconds
         |Route will take ${taxiInfo.timeText.getOrElse("unknown")}
         |Price: ${ride.priceText}
         |""".stripMargin)
  ...
} yield ()

client could be any http4s backend (blaze, okhttp, finagle, etc)

Taxi services supported

About

pure yandex taxi api for scala

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages