scala-faker

A library for generating fake data.

Лицензия

Лицензия

Категории

Категории

Scala Языки программирования
Группа

Группа

com.github.pjfanning
Идентификатор

Идентификатор

scala-faker_3
Последняя версия

Последняя версия

0.5.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

scala-faker
A library for generating fake data.
Ссылка на сайт

Ссылка на сайт

https://github.com/pjfanning/scala-faker/
Организация-разработчик

Организация-разработчик

com.github.pjfanning
Система контроля версий

Система контроля версий

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

Скачать scala-faker_3

Как подключить последнюю версию

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

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.scala-lang : scala3-library_3 jar 3.0.0
org.yaml : snakeyaml jar 1.28

test (1)

Идентификатор библиотеки Тип Версия
org.scalatest : scalatest_3 jar 3.2.9

Модули Проекта

Данный проект не имеет модулей.

scala-faker

scala-faker is a library written in Scala which generates fake data such as names, addresses, and phone numbers. It is a Scala port of the famous Ruby library faker. It actually uses the same data for generating. This release of scala-faker is built against Scala 2.12, 2.13 and 3.0.

scala-faker only depends on snakeyaml for reading the original faker yaml files. The tests are written with scalatest.

Usage

This section will give you a short introduction on how to get started with scala-faker.

Code

So how do I use it? Let's see ...

import faker._ // That's all you need!

case class User(name: String, username: String, email: String)

val name = Name.name
val user = User(name, Internet.user_name(name), Internet.free_email(name))
// User(Kimi Hauke,kimihauke,haukekimi@hotmail.com)

Pretty easy, right?

Localization

By default scala-faker tries you systems locale for generating fake data. If there isn't any localization for it (right now there are files for: de-ch, de, en-gb, en-us, en, nl) it will fall back to en. The locale can be changed any time with Faker.locale(newLocale).

import faker._

// changing Language to german
Faker.locale("de")

Add dependency

Adding scala-faker as dependency to your project is really simple. Just add the following lines

sbt

for the latest stable release:

libraryDependencies += "com.github.pjfanning" %% "scala-faker" % "0.5.3"

Maven

for the latest stable release:

<dependency>
    <groupId>com.github.pjfanning</groupId>
    <artifactId>scala-faker_2.12</artifactId>
    <version>0.5.3</version>
</dependency>

Credits

This library uses the locales data from the ruby faker library.

Contribution policy

Contributions via GitHub pull requests are gladly accepted from their original author. Along with any pull requests, please state that the contribution is your original work and that you license the work to the project under the project's open source license. Whether or not you state this explicitly, by submitting any copyrighted material via pull request, email, or other means you agree to license the material under the project's open source license and warrant that you have the legal authority to do so.

License

scala-faker is licensed under the Apache 2.0 License.

Версии библиотеки

Версия
0.5.3