juliano / randomuser-scala   0.1.0

MIT License GitHub

RandomUser API Scala client

Scala versions: 3.x

Scala/ZIO Random User Generator Client

Scala 3 client implementation for the Random User Generator API, built using ZIO and Sttp.

Getting Started

Add the following to your build.sbt:

libraryDependencies += "io.github.juliano" % "random-user_3" % "0.1.0"

Usage

Here's a basic example of how to use the client:

import io.github.juliano.randomuser.*
import zio.*

object Example extends ZIOAppDefault:
  def run = 
    val program = for
      content <- Client.fetch()
      _ <- Console.printLine(s"Random user: ${content.results.head}")
      _ <- Console.printLine(s"API info: ${content.info}")
    yield ()

    program.provide(Client.default)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments