Skip to content

Latest commit

 

History

History
115 lines (111 loc) · 9.88 KB

DATAGENERATION_RULES.md

File metadata and controls

115 lines (111 loc) · 9.88 KB

Data Generation Rules

Rules Group Rule Parameters
StringRules
Module to generate string related entries
alpha
Generating a string consisting of letters in the English alphabet.
minLength [default: 10]
maxLength [default: 100]
casing [default: mixed]
alphanumeric
Generating a string consisting of alpha characters and digits.
minLength [default: 10]
maxLength [default: 100]
casing [default: mixed]
enum
Returns a random value from an Enum object
words
Returns a string containing a number of space separated random words.
count [default: 5]
nanoid
Generates a Nano ID.
minLength [default: 5]
maxLength [default: 5]
numeric
Generates a given length string of digits.
minLength [default: 5]
maxLength [default: 5]
leadingZeros [default: false]
static
Assign a static value.
symbol
Returns a string containing only special characters
minLength [default: 5]
maxLength [default: 5]
uuid
Returns a UUID v4 (Universally Unique Identifier).
fromRegExp
Generates a string matching the given regex like expressions
pattern [ default: ^[A-Za-z]$ ]
phoneNumber
Returns a random phone number
json
Returns a string representing JSON object with 7 pre-defined properties.
NullRules
Module to generate null or empty values.
null
Returns null value
empty
Returns an empty string
NumberRules
Module to generate numbers of any kind.
float
Returns a single random floating-point number
minimum [default: 0]
maximum [default: 1000]
fractionDigits [default: 2]
int
Returns a single random integer.
minimum [default: 0]
maximum [default: 1000]
countUp
Generates an incremental number.
start [default: 1]
change [default: 1]
countDown
Generates a decremental number.
start [default: 9999999]
change [default: 1]
BooleanRules
Module to generate boolean values.
boolean
Returns the boolean value true or false
DateRules
Module to generate dates
currentDate
Returns a current date
format [default: MM-DD-YYYY]
timeStamp
Returns current time as timestamp, the number of seconds since January 1, 1970 UTC
currentDateWithTime
Returns a current date with time
format [default: MM-DD-YYYY HH:mm:ss]
currentTime
Returns a current time
format [default: HH:mm:ss]
anytime
Generates a random date that can be either in the past or in the future.
future
Generates a random date in the future.
years [default: 10]
past
Generates a random date in the past.
years [default: 10]
recent
Generates a random date in the recent past.
days [default: 10]
soon
Generates a random date in the near future.
days [default: 10]
month
Returns a random name of a month.
abbreviated [default: false]
weekday
Returns a random day of the week.
abbreviated [default: false]
LoremRules
Module to generate random texts and words
lines
Generates the given number lines of lorem separated by '
minimum [default: 2]
maximum [default: 5]
paragraph
Generates a paragraph with the given number of sentences.
minimum [default: 2]
maximum [default: 5]
sentence
Generates a space separated list of words.
minimum [default: 5]
maximum [default: 10]
text
Generates a random text based on a random lorem method.
word
Generates a word of a specified length.
minimum [default: 5]
maximum [default: 10]
PersonRules
Module to generate people's personal information such as names and job titles.
prefix
Returns a random person prefix.
firstName
Returns a random first name.
lastName
Returns a random last name.
middleName
Returns a random middle name.
fullName
Generates a random full name.
suffix
Returns a random person suffix.
sex
Returns a random sex.
jobTitle
Generates a random job title.
jobDescriptor
Generates a random job descriptor.
jobType
Generates a random job type.
LocationRules
Module to generate addresses and locations
buildingNumber
Generates a random building number.
street
Generates a random localized street name.
streetAddress
Generates a random localized street address.
city
Generates a random localized city name.
state
Returns a random localized state.
zipCode
Generates random zip code from specified format.
country
Returns a random country name.
countryCode
Returns a random ISO_3166-1 country code.
latitude
Generates a random latitude.
minimum [default: -90]
maximum [default: 90]
precision [default: 4]
longitude
Generates a random longitude.
minimum [default: -90]
maximum [default: 90]
precision [default: 4]
timeZon
Returns a random time zone.
InternetRules
Module to generate internet related entries
domainNam
Generates a random domain name.
casing [default: lower]
domainWord
email
Generates a random email address.
casing [default: lower]
emoji
Generates a random emoji.
emoji
ipv4
Generates a random IPv4 address.
ipv6
Generates a random IPv6 address.
mac
Generates a random mac address.
url
Generates a random http(s) url.
casing [default: lower]
username
Generates a random username.
casing [default: lower]
FinanceRules
Module to generate finance and money related entries
accountNumber
Generates a random account number.
amount
Generates a random amount between the given bounds.
minimum [default: 0]
maximum [default: 1000]
swiftOrBic
Generates a random SWIFT/BIC code based on the ISO-9362 format.
creditCardIssuer
Returns a random credit card issuer.
creditCardNumber
Generates a random credit card number.
currencyCode
Returns a random currency code.
currencyName
Returns a random currency name.
currencySymbol
Returns a random currency symbol.
bitcoinAddress
Generates a random Bitcoin address.
ethereumAddress
Creates a random, non-checksum Ethereum address.
transactionDescription
Generates a random transaction description.
transactionType
Returns a random transaction type.
AirlineRules
Module to generate airline and airport related data.
airline
Generates a random airline.
airplane
Generates a random airplane.
airport
airplane
Generates a random airplane.
airport
Generates a random airport name with code.
airportName
Generates a random airport name.
airportCode
Generates a random airport code.
flightNumber
Returns a random flight number.
minimum [default: 1]
maximum [default: 3]
leadingZeros [default: false]
CommerceRules
Module to generate commerce and product related entries.
companyName
Generates a random company name.
department
Returns a random department inside a shop.
isbn
Returns a random ISBN identifier.
price
Generates a random price between min and max.
minimum [default: 1]
maximum [default: 999]
product
Returns a random short product name.
productDescription
Returns a random product description.
productNam
Generates a random descriptive product name.

Supported Regular Expression

# Rule Description
1. x{times} Repeat the x exactly times times.
2. x{min,max} Repeat the x min to max times.
3. x-y Randomly get a character between x and y (inclusive).
4. x-y{times} Randomly get a character between x and y (inclusive) and repeat it times times.
5. x-y{min,max} Randomly get a character between x and y (inclusive) and repeat it min to max times.
6. ^... Randomly get an ASCII number or letter character that is not in the given range. (e.g. ^0-9 will get a random non-numeric character).
7. -... Include dashes in the range. Must be placed after the negate character ^ and before any character sets if used (e.g. ^-0-9 will not get any numeric characters or dashes).
8. x? Randomly decide to include or not include x.
9. x-y? Randomly decide to include or not include characters between x and y (inclusive).
10. x* Repeat x 0 or more times.
11. x+ Repeat x 1 or more times.
12. x-y* Repeat characters between x and y (inclusive) 0 or more times.
13. x-y+ Repeat characters between x and y (inclusive) 1 or more times.