-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Split concerns betweens column formatter and sql formatter * Update docs
- Loading branch information
Showing
11 changed files
with
60 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
|
||
# Quick Start | ||
|
||
`fakedata` helps you generate random data in a number of ways. You can generate | ||
data by specifying on the command line the kind of data you need: | ||
`fakedata` helps you generate random data in a number of ways. By default | ||
`fakedata` uses a column formatter with space separator: | ||
|
||
```sh | ||
$ fakedata email country | ||
|
@@ -19,11 +19,10 @@ [email protected] Malaysia | |
[email protected] Virgin Islands, British | ||
``` | ||
|
||
By default `fakedata` uses a space separator. You can choose a different output | ||
format: | ||
You can choose a different separator: | ||
|
||
```sh | ||
$ fakedata --format=csv product.category product.name | ||
$ fakedata --separator=, product.category product.name | ||
Shoes,Rankfix | ||
Automotive,Namis | ||
Movies,Matquadfax | ||
|
@@ -34,33 +33,35 @@ Home,Sil-Home | |
Health,Toughwarm | ||
Shoes,Freetop | ||
Tools,Domnix | ||
# tab is a little tricky to type, but works | ||
$ fakedata emoji industry -s=$'\t' | ||
👦 Electrical & Electronic Manufacturing | ||
🆘 Investment Banking/Venture | ||
📦 Computer Hardware | ||
♐ Computer & Network Security | ||
🔠 Religious Institutions | ||
💷 Automotive | ||
🇱 Capital Markets | ||
㊙ Public Relations | ||
☺ Alternative Dispute Resoluti | ||
``` | ||
|
||
or SQL insert statements: | ||
You can also specify a SQL formatter: | ||
|
||
```sh | ||
$ fakedata --format=sql --limit 1 email domain | ||
INSERT INTO TABLE (email,domain) values ('[email protected]','example.me'); | ||
``` | ||
|
||
You can specify the name of the column using a field with the following format | ||
You can change the name of the table column using a field with the following syntax | ||
`column_name=generator`: | ||
|
||
```sh | ||
$ fakedata --format=sql --limit 1 login=email referral=domain | ||
INSERT INTO TABLE (login,referral) values ('[email protected]','test.me'); | ||
``` | ||
|
||
If you need more control over the output, you can use templates: | ||
|
||
```sh | ||
$ echo '{{Email}}--{{Int}}--{{Color}}' | fakedata -l5 | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
``` | ||
If you need more control over the output, you can use [templates](/templates). | ||
|
||
# Generators | ||
|
||
|
@@ -75,7 +76,9 @@ country.code 2-digit country code | |
date date | ||
domain domain | ||
domain.tld example|test | ||
# ...It's a long list :) | ||
#... | ||
#... | ||
#It's a long list :) | ||
``` | ||
|
||
You can use the `-g` (or `--generator`) option to see an example: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
Usage: fakedata [option ...] field... | ||
|
||
-C, --completion string print shell completion function, pass shell name as argument ("bash", "zsh" or "fish") | ||
-f, --format string generators rows in f format. Available formats: csv|tab|sql | ||
-f, --format string generates rows in f format. Available formats: column|sql (default "column") | ||
-g, --generator string show help for a specific generator | ||
-G, --generators lists available generators | ||
-c, --generators-with-constraints lists available generators with constraints | ||
-l, --limit int limits rows up to n (default 10) | ||
-s, --separator string specifies separator for the column format (default " ") | ||
-t, --table string table name of the sql format (default "TABLE") | ||
-T, --template string Use template as input | ||
-v, --version shows version information |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters