Skip to content

michaelahlers/faker-scala

Repository files navigation

Faker: Scala Appveyor Codacy Scala Steward

Realistic sample value generators for Scala.

Status

This project's a work-in-progress, and it's settling on design patterns and essential datasets to provide. Until those are stabilized, this project will not accept pull-requests.

Artifacts

Target Scala 2.12 Scala 2.13 Scala 3
JVM
JavaScript

Installation

SBT

Add both this project's resolver and library dependencies.

Most projects will want to obtain the ScalaCheck Gen and Arbitrary instances:

resolvers += "Ahlers Consulting" at "https://artifacts.ahlers.consulting/maven2"
libraryDependencies += "ahlers.faker" %% "faker-scalatest" % "0.2.0-SNAPSHOT" % Test 

For those interested only in the data:

resolvers += "Ahlers Consulting" at "https://artifacts.ahlers.consulting/maven2"
libraryDependencies += "ahlers.faker" %% "faker-datasets" % "0.2.0-SNAPSHOT" % Test :: 

Mill

TBD.

Gradle

TBD.

Platforms

This library tested on and supported on these platforms.

Java

JDK macOS Linux Windows
8
9
11
12
13
14
15

Datasets

Companies

Various parts (e.g., name, homepage, locality) of businesses from these sources:

Emails

Made available as component parts (local, domain, and comment) with strict validation according to applicable IETF standards (e.g., RFC 5322). Synthesized using this library's person name and company generators.

Person Names

As name prefix, given name, middle name, family name, nickname, and name suffix from these sources:

Plugins

This module provides what are, essentially, small ETL pipelines with the aim of reducing complexity, payload, and dependencies in dataset modules, used by this same project to ship for consumers a set of concise, trivially-parsed formats.

Most consumers of these libraries will not use this library of plugins; the preprocessing is made available to document how upstream sources are obtained and modified, and make available additional output formats should consumers wish to repurpose their output. For example, power users might want to use different output formats (planned are JSON and YAML) in different ways.

Over time, this is expected to grow in to a larger and more elaborate corpus of sources and normalizations. These upstream sources often provide greater detail than is used by this library. Also, over time, greater detail will be made available in the output of generators.

Inspiration

While arbitrary value generation is useful, testing often profits from realistic samples. This library aims to provide generators for email addresses, geographical locations, person names, phone numbers, universal resource identifiers (URI), and more.

It takes cues from these similar projects for other languages:

And means to fill gaps left by those for Scala which haven't seen recent activity:

Dependencies

Because this project preprocesses upstream sources, it's able to be largely free of extraneous dependencies in modules intended for end users. Confined to the [Plugins][#plugins] module, noteworthy dependencies include:

Acknowledgements

About

Realistic sample value generators for Scala.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages