scala-faker

Scala fake data generator library

License

License

Categories

Categories

Scala Languages
GroupId

GroupId

com.github.stevenchen3
ArtifactId

ArtifactId

scala-faker_2.11
Last Version

Last Version

0.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

scala-faker
Scala fake data generator library
Project URL

Project URL

https://github.com/stevenchen3/scala-faker
Project Organization

Project Organization

Steven Chen
Source Code Management

Source Code Management

https://github.com/stevenchen3/scala-faker

Download scala-faker_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.stevenchen3/scala-faker_2.11/ -->
<dependency>
    <groupId>com.github.stevenchen3</groupId>
    <artifactId>scala-faker_2.11</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.stevenchen3/scala-faker_2.11/
implementation 'com.github.stevenchen3:scala-faker_2.11:0.1.1'
// https://jarcasting.com/artifacts/com.github.stevenchen3/scala-faker_2.11/
implementation ("com.github.stevenchen3:scala-faker_2.11:0.1.1")
'com.github.stevenchen3:scala-faker_2.11:jar:0.1.1'
<dependency org="com.github.stevenchen3" name="scala-faker_2.11" rev="0.1.1">
  <artifact name="scala-faker_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.stevenchen3', module='scala-faker_2.11', version='0.1.1')
)
libraryDependencies += "com.github.stevenchen3" % "scala-faker_2.11" % "0.1.1"
[com.github.stevenchen3/scala-faker_2.11 "0.1.1"]

Dependencies

compile (7)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12
io.circe : circe-core_2.11 jar 0.11.0
io.circe : circe-generic_2.11 jar 0.11.0
io.circe : circe-parser_2.11 jar 0.11.0
joda-time : joda-time jar 2.10.1
org.joda : joda-convert jar 2.2.0
com.typesafe : config jar 1.3.3

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.11 jar 3.0.6

Project Modules

There are no modules declared in this project.

Scala Faker

Scala Fake Data Generator. This repository includes Scala implementation for Golang Faker.

Build Status Coverage Statue License Maven Central

Get Started

Supported Scala versions

  • Scala 2.11
  • Scala 2.12

This library is available at Maven Central Repository. To use the latest stable version, append the following to your build.sbt and replace LATEST_VERSION with the latest version published, which should be Maven Central

libraryDependencies += "com.github.stevenchen3" %% "scala-faker" % "LATEST_VERSION"

Build Current master

Check scalastyle, run tests and generate coverage report across all supported Scala versions:

sbt +scalastyle +scalafixcheck +coverage +test +coverageReport

Publish Locally

Make sure export GPG_TTY=$(tty) (this fixes gpg: signing failed: Inappropriate ioctl for device error, checkout here to see why) is appended to ~/.bashrc or has been loaded to current shell.

source ~/.bashrc
sbt +publishLocalSigned

Examples

import io.alphash.faker._

val number = Phone().phoneNumber()
println(s"$number") // output some phone number like, "+1 (202) 737-6022"

val name = Person().name
println(s"$name")  // e.g., "Blanca Spencer"

val price = Price().amountWithCurrency
println(s"$price") // e.g., "CAD 42545.1"

val ip = Internet().ipv4
println(s"$ip")    // e.g., "89.51.74.211"

...

Available Fakers

It currently supports the following fakers:

Datetime :

  • Datetime
  • Time

Geolocation :

  • Latitude and Longitude

Internet :

  • Email
  • Mac address
  • Domain name
  • URL
  • Username
  • IP Address (IPv4, IPv6 )
  • Password

Lorem :

  • Word
  • Sentence
  • Paragraph

Payment :

  • Credit Card Type (VISA, MASTERCARD, AMERICAN EXPRESS, DISCOVER, JCB, DINERS CLUB)
  • Credit Card Number

Person :

  • Title male
  • Title female
  • First name
  • First name male
  • First name female
  • Last name
  • Name with title
  • Name (first last)

Phone :

  • Phone number
  • Country code (US and Singapore)
  • Area code
  • Toll free phone number
  • E164PhoneNumber

Price :

  • Currency
  • Amount

Versions

Version
0.1.1
0.1.0
0.1.0-rc3
0.1.0-rc2
0.1.0-rc1