Giter Site home page Giter Site logo

faker-1's Introduction

Faker

Generates fake data for testing or populating a development database. Run your tests with realistic data like names, emails, dates, countries...

A Java port of the Faker ruby gem. The goal was to reuse their locale data files.

Build Status Release

Installing

repositories {
    // ...
    maven { url 'https://jitpack.io' }
}

dependencies {
    compile 'com.github.markmooibroek:faker-1:1.3.0'
}

You can use testCompile or androidTestCompile, if you only want to use Faker for testing.

Usage

Faker faker = new Faker();
faker.name.firstName();    // Returns "Aaron"
faker.company.name();      // Returns "Hirthe-Ritchie"

Faker faker = new Faker("nl");
faker.name.firstName();    // Returns "Thijs"

For full list of available options, check the original source. We have tried to keep the operations as close as possible.

Available components

  • Address
  • App
  • Avatar
  • Book
  • Bool
  • Business
  • Color
  • Commerce
  • Company
  • Date
  • Food
  • Internet
  • Lorem
  • Name
  • Number
  • PhoneNumber
  • Placeholdit
  • SlackEmoji
  • Team
  • Time
  • University

Warnings

  • Currently we don't support locale specific operations like Address.postcode_by_state or Business.swedish_organisation_number.

TODO

  • Implement remaining components:
    • Beer
    • Bitcoin
    • Cat
    • ChuckNorris
    • Code
    • Crypto
    • Educator
    • Finance
    • GameOfThrones
    • Hacker
    • Hipster
    • IDNumber
    • Pokemon
    • Shakespeare
    • Space
    • Superhero
    • StarWars
    • Vehicle

Proguard

To use Faker with proguard, here are the rules you need to add:

# SnakeYAML
-keep class org.yaml.snakeyaml.** { public protected private *; }
-keep class org.yaml.snakeyaml.** { public protected private *; }
-dontwarn org.yaml.snakeyaml.**

# Joda Time
-dontwarn org.joda.convert.**
-dontwarn org.joda.time.**
-keep class org.joda.time.** { *; }
-keep interface org.joda.time.** { *; }

Contact

Feedback and contributions are welcome. Feel free to send an email or submit a pull request.

License

This code is free to use under the terms of the MIT license.

faker-1's People

Contributors

bffcorreia avatar sdsantos avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.