Skip to content

Data generator, generate a lot data to use workers

License

Notifications You must be signed in to change notification settings

lalolv/data-worker

Repository files navigation

Overview

alt travis alt report

Data worker, data generator, generate a lot data by config.

中文说明

Application scenario

  • Data test
  • Demonstration
  • Unit Test for developing

Features

  • Define some specified fields and parameters by config.
  • Load external dict to use more data.
  • Custom formatted output data

Usage

Create a json file for config,and save to config folder。for example

{
  "dict_path": "dict",
  "build": {
    "count": 5,
    "format": "csv",
    "name": "demo2",
    "path": "out"
  },
  "fields": [
    {
      "name": "order_id",
      "value": "po-{uuid}"
    },
    {
      "name": "email",
      "value": "{username}@{email}"
    },
    {
      "name": "creat_dt",
      "value": "{datetime}"
    }
  ]
}
  • dict_path: It's a dict folder includes some dict files
  • build: Build command
  • fields: Setup output a few fields
  • Use curly braces to customize the output variables. Variables come from data dictionaries and built-in types.

Assign -c parameter,setup config

data-worker build -c ./config/demo.json

Built-in types

Type Desc
string String
uuid Unique identification
mobile Mobile phone
idno ID Number
datetime Full date and time

Plan

  • Custom variables, increase filters.
  • Support for more built-in types

About

Data generator, generate a lot data to use workers

Resources

License

Stars

Watchers

Forks

Packages

No packages published