Giter Site home page Giter Site logo

dinkopehar / mock_data Goto Github PK

View Code? Open in Web Editor NEW
14.0 4.0 2.0 98 KB

Generate random data(string, integer, IPs etc...) using Dart.

Home Page: https://pub.dartlang.org/packages/mock_data

License: MIT License

Dart 100.00%
dart mock random fake-data mock-data

mock_data's Introduction

Mock Data Logo
Build Status License Version
Generate random data using Dart

Features

API provides generation of:

  • Integers in any range of numbers
  • Strings with various characters and length
  • Colors represented with needed color space
  • Dates between different moments in time
  • Names such as John or Mary
  • UUIDv4 and Timestamp-first UUIDs
  • URLs with many fragments
  • IPv4 and IPv6
  • Locations as either random points or in specified radius

Usage

A simple usage example:

import 'package:mock_data/mock_data.dart';

main() {

  mockName();           // Generate male or female first name. 
  mockName('male');     // Generate male first name. 
  mockName('female');   // Generate female first name. 

  mockInteger(1, 6);    // Generate integer in range from 1 do 6.

  mockString(16);       // Generate string of length 16.
  
  mockIPv4();           // Generate IPv4 represented with 
                        // format(default is '*.*.*.*') as String. 
  
  mockIPv6();           // Generate IPv6, same usage as with IPv4.

  mockColor('hex');     // Generate color represented in hex format.
  mockColor('rgb');     // Generate color represented in RGB format.
  
  mockUUID();           // Generate UUIDv4
  
  mockLocation();       // Generate random location.
  mockLocation(53.55, 108.14, 1000); // Generate random location in 1000 m radius from the specified coordinates.
  
}

These are some basic examples. There are many more methods and they all support tweeking of parameters to suit you in generating random data. By reading examples you can learn more about functionality and usage of mock_data

Contributors

License

MIT

mock_data's People

Contributors

dinkopehar avatar nbodepudi avatar vbuberen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mock_data's Issues

Improve unit tests

mockData currently has unit tests, but they are not complete. Complete tests by adding missing tests for some sections, test for throws and generally rethink about improving testing step.

Add mock/random MAC address generator

Describe the feature
A function call which would generate a random mock MAC address.

To Reproduce
Steps to reproduce the behavior:

  1. Import mock_data
  2. Use this function with following arguments: mockMacAddress()

Expected behavior
A random MAC address containing a series of hexadecimal bytes in a form of hexadecimal string. Possibly specific separator which separates the hexadecimal bytes, could be colon, no separator or dash.

Additional context
Possibly can be used for Ethernet MAC addresses or Bluetooth device IDs.

Constraint solver issue using Flutter beta channel

There seems to be an issue with regards to the constraint solving. Would it be possible to bump down the lower version constraint to 2.0.0?

The current Dart SDK version is 2.1.0-dev.9.4.flutter-f9ebf21297.
Because ~ depends on mock_data >=1.0.1 which requires SDK version >=2.1.0 <3.0.0, version solving failed.

Add notification to Telegram on builds

It would be nice to have some sort of notification when build is triggered. I have chosen Telegram for this.

Actions should notify me on Telegram whether the build was successful or if it failed.

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.