faker 0.0.5

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 84

faker

Build Status Coverage Status

A library for Dart that generates fake data.

faker is heavily inspired by the Python package faker, and the Ruby package ffaker.

Usage

A simple usage example:

import 'package:faker/faker.dart';

main() {
  var faker = new Faker();

  faker.internet.email();
  // francisco_lebsack@buckridge.com

  faker.internet.ipv6Address();
  // 2450:a5bf:7855:8ce9:3693:58db:50bf:a105

  faker.internet.userName();
  // fiona-ward

  faker.person.name();
  // Fiona Ward

  faker.person.prefix();
  // Mrs.

  faker.person.suffix();
  // Sr.
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Copyright (c) 2015 Jesper HÃ¥kansson. See LICENSE for details. Copyright (c) 2013 Emmanuel Oga. Copyright (c) 2012 Daniele Faraglia. Copyright (c) 2007 Benjamin Curtis.

Changelog

0.0.5

  • fix: Remove illegal chars from generated domain words

0.0.4

  • Added food generator, includes restaurants, dishes and cuisines

0.0.3

  • fix: Type faker constant to Faker

0.0.2

  • Added support for guids
  • Added fromPatternToHex method that generates a random set of numbers from a given pattern and return it as hex

0.0.1

  • Initial release

example/faker.dart

library faker.example;

import 'package:faker/faker.dart';

main() {
  // Generate some different types of data.
  print(faker.address.country());
  print(faker.company.name());
  print(faker.currency.code());
  print(faker.internet.ipv4Address());
  print(faker.job.title());
  print(faker.person.firstName());
  print(faker.sport.name());

  // Generate a random amount of IP v4 addresses (max 10).
  print(random.amount((_) => faker.internet.ipv4Address(), 10));

  // Generate random boolean.
  print(random.boolean());

  // Generate random decimal.
  print(random.decimal());
}

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  faker: "^0.0.5"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:faker/faker.dart';
        
Version Uploaded Documentation Archive
0.0.5 Apr 16, 2017 Go to the documentation of faker 0.0.5 Download faker 0.0.5 archive
0.0.4 Oct 25, 2015 Go to the documentation of faker 0.0.4 Download faker 0.0.4 archive
0.0.3 Oct 22, 2015 Go to the documentation of faker 0.0.3 Download faker 0.0.3 archive
0.0.2 Sep 8, 2015 Go to the documentation of faker 0.0.2 Download faker 0.0.2 archive
0.0.1 Jul 9, 2015 Go to the documentation of faker 0.0.1 Download faker 0.0.1 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
69 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
84

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:faker/faker.dart.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

Dependencies

Package Constraint Resolved Available
Dev dependencies
guinness >=0.1.17 <0.2.0
unittest >=0.11.0 <0.12.0