カテゴリー・パッケージ・リポジトリを検索

GitHub リポジトリdinkopehar/mock_data

mock_data

Dart を使ってランダムなデータ(文字列、整数、IP など)を生成します。

mock_data のプロジェクト画像
スター
14
フォーク
3
最終プッシュ(UTC)
2024/03/18
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

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

Dinko P. GitHub avatar
GitHub 作者

Dinko P. ↗

Applied AI engineer with focus on Python, Typescript, Gis and Cloud.

Oslo
言語Dart

カテゴリー

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 2 件

  • test開発用^1.17.5
  • pedantic開発用^1.11.0

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗