Skip to content
Fake data generator
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
cats-effect/src/main/scala/phony/cats/effect Separate RandomUtility and Locale Jul 12, 2019
core/src Separate RandomUtility and Locale Jul 12, 2019
project Enable scalac flags Jul 7, 2019
.gitignore Change the strcuture (#6) Jun 27, 2019
.scalafmt.conf Init commit Feb 9, 2019
.travis.yml Enable code coverage Jul 4, 2019
LICENSE Change License Jul 7, 2019 Update Version Jul 12, 2019
build.sbt Update Version Jul 12, 2019
version.sbt Update Version Jul 12, 2019


Phony is fake data generate with cats library.

Build Status codecov

Quick Start

To use Phony in an existing SBT project with Scala 2.11 and 2.12, add the following dependency to your build.sbt:

resolvers += "phony" at ""

libraryDependencies += "com.github.alirezameskin" %% "phony-core" % "0.3.1"


  import phony.Phony
  import scala.util.Try
  import phony.instances.try_.languages.ENGLISH
  import phony.instances.try_._

  val bio = Phony[Try].lorem.text
  import phony.Phony
  import phony.instances.either.languages.ENGLISH
  import phony.instances.either._

  type EitherA[A] = Either[Throwable, A]
  val bio = Phony[EitherA].lorem.text

Using with cats-effect

resolvers += "phony" at ""

libraryDependencies += "com.github.alirezameskin" %% "phony-cats-effect" % "0.3.0-snapshot"
  import cats.effect.IO
  import phony.Phony

  val bio = Phony[IO].lorem.text

Using with fs2

  import cats.effect.IO
  import fs2._
  import phony.Phony

  case class Contact(firstName :String, lastName : String, age:Int)

  val contact = for {
    firstName <- Phony[IO].name.firstName
    lastName  <- Phony[IO].name.lastName
    age       <- Phony[IO].alphanumeric.number(18, 68)
  } yield Contact(firstName, lastName, age)

  val stream = Stream.eval(contact)



  def char: F[Char]
  def boolean: F[Boolean]
  def float: F[Float]
  def number: F[Int]
  def number(max: Int)
  def number(min: Int, max: Int): F[Int]
  def custom(format: String) //format replace # with random number and replace ? with random character
  def hash: F[String]
  def hash(length: Int): F[String]


  def year: F[Int]
  def day: F[String]
  def month: F[String]
  def time24h: F[String]
  def time12h: F[String]
  def date: F[Date]
  def date(format: String = "yyyy-MM-dd"): F[Date]
  def iso8601:F[String]
  def timezone: F[String]


  def firstName: F[String]
  def lastName: F[String]
  def prefix: F[String]
  def suffix: F[String]
  def fullName: F[String]
  def fullName(withPrefix: Boolean = false, withSuffix: Boolean = false): F[String]
  def username: F[String]
  def phone: F[String]
  def cellPhone: F[String]


  def uuid: F[String]
  def email: F[String]
  def password: F[String]
  def domain: F[String]
  def hostname: F[String]
  def protocol: F[String]
  def url: F[String]
  def ip: F[String]
  def ipv6: F[String]
  def hashtag: F[String]


  def word: F[String]
  def words: F[List[String]]
  def words(length: Int): F[List[String]]
  def sentence: F[String]
  def text: F[String]
  def sentence(size: Int): F[String]
  def text(lines: Int): F[String]


  def latitude: F[String]
  def longitude: F[String]
  def country: F[]
  def countryName: F[String]
  def countryCode: F[String]
  def postalCode: F[String]
You can’t perform that action at this time.