faker 0.0.5

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

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());
}

Use this package as a library

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 flutter 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
Popularity:
Describes how popular the package is relative to other packages. [more]
75
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
64
Overall:
Weighted score of the above. [more]
80
Learn more about scoring.

We analyzed this package on Aug 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: Flutter, web, other

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

Issues and suggestions

Add SDK constraint in pubspec.yaml.

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Package is getting outdated.

The package was released 68 weeks ago.

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 of the API.

Format lib/src/address.dart.

Run dartfmt to format lib/src/address.dart.

Format lib/src/currency.dart.

Run dartfmt to format lib/src/currency.dart.

Fix additional 6 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/data/person/firstnames.dart (Run dartfmt to format lib/src/data/person/firstnames.dart.)
  • lib/src/data/person/lastnames.dart (Run dartfmt to format lib/src/data/person/lastnames.dart.)
  • lib/src/guid.dart (Run dartfmt to format lib/src/guid.dart.)
  • lib/src/internet.dart (Run dartfmt to format lib/src/internet.dart.)
  • lib/src/job.dart (Run dartfmt to format lib/src/job.dart.)
  • lib/src/random_generator.dart (Run dartfmt to format lib/src/random_generator.dart.)

Dependencies

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