- Notifications
You must be signed in to change notification settings - Fork0
ogata-k/fakes-gen-cli
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This program is faker by random-select and support multi locale. Now, support Japan only.So, if you want to support other locale, please pull request data of the locale.You can generate formatted dummy data as xxxx.When it is String, formatter is "xxxx". When it is not String, formatter is xxxx.
This project is not active. Please usehttps://github.com/ogata-k/sbrd-gen
MIT
as Library
// Cargo.tomlfakes-gen = "version"as CLI for latest version
cargo install --git https://github.com/ogata-k/fakes-gen-cli --branch masteror get from crates.io
cargo install fakes-gen// "sep" is separator for data generated as each "options" // not support Join option's nest and name's furiganaJoin(sep, options),// s is user data quated by ".FixedString(s)FixedNotString(s)// list is user data such the formed: ["s1", "s2", "s3"]SelectString(list)SelectNotString(list)// unsigned integer n satisfied with from<=n<=to, // you can generate dummy as joined n-data by space. WordWords(from, to)SentenceSentences(from, to)ParagraphParagraphs(from, to)// When use with_furigana, you set true to furigana parameter.FirstName(with_furigana)FirstNameFuriganaLastName(with_furigana)LastNameFuriganaFullName(with_furigana)FullNameFurigana// You can use from and to paramator such as Lorem.// They are all not-String whithout Ascii.IntegerIntegerRange(from, to)FloatFloatRange(from, to)// Ascii chars without spaceAscii(from, to)Boolean// You can use from and to paramator such as Lorem. // Their data is sensitive, so I pay attention dummy data to be as possible as safety.EmailUserNamePassword(from, to)CreditCardURLIPv4IPv6RGBRGBAUserAgentStatusCodeCompanySuffixCompanyNameIndustryBuildingStreetNameCityNameStateNameCountryCodeCountryNameTimeZoneAddress// When you use number formatted as xxx-xxxx-xxx, set true to hyphen parameter.ZipCode(hyphen)DomesticPhoneNumber(hyphen)LatitudeLongitude// format-str: https://docs.rs/chrono/0.4.9/chrono/format/strftime/index.html// String is format. default is "%Y-%m-%d %H:%I:%M"'s sub-format.// But, When Time(Date, DateTime), use only Time(Date, Time/Date)-formatter.// ex. "219-11-02 21:09:31"Time(format)Date(format)DateTime(format)FileNameExtension- all_options: show examples of all options.
- csv: show record, data_set and full_form formatted csv for dummy of FullName and DateTime FakeOption.
- tsv: show record, data_set and full_form formatted tsv for dummy of FullName and DateTime FakeOption.
- json: show record, data_set and full_form formatted json for dummy of FullName and DateTime FakeOption.
fakes-gen [FLAGS] [OPTIONS] [option]...// help message from fakes-gen -h FLAGS: -b, --bnf show Backus-Naur Form and detail format for options -f, --fullform flag for generating as fullform such as body with header -h, --help Print this message -u, --usable show list of all usable options for faker -V, --version Prints version informationOPTIONS: -c, --converter <converter> converter for output [default: csv] [possible values: csv, tsv, json] -l, --locale <locale> 3-char's country code. [default: jpn] [possible values: jpn] -s, --size <size> data size. If 1, generate as record. If over 1, generate as data_set. [default: 1]Usable format is form such asXxxx.Yyyy(zzz) orXxxx.Yyyy(zzz#sub).Xxxx is Category. Usable Category is "With", " "Fixed", "Select", "Lorem", "Name", "Primitive", "Internet", "Company", "Address", "DateTime" and "FileSystem".Yyyy is Option for each Category. Usable Option is theirs andzzz is<column_name>.If you use header or fullform, fakes-gen use<column_name>.
// modified usable message from fakes-gen -uCategory: WithOptions:・With\.Join\(<column_name>#<join_separator>(#<repeatable_option>)*\)Example:fakes-gen With.Join(_#_dd_#Select.String(hoge#sss)#2#Select.NotString(1#2#3)) // "sss_dd_1_dd_2"Category: Fixed // fixed value of user-value. Options:・Fixed.String\(<column_name>#<string>\) // as String format "hoge".・Fixed.NotString\(<column_name>#<string>\) // as not String format hoge.Example: fakes-gen Fixed.String(_#hoge) // "hoge"Category: Select // select a value from user-values.Options:・Select.String\(<column_name>#<string_list>\) // as String format "hoge".・Select.NotString\(<column_name>#<string_list>\) // as not String format hoge.Example: fakes-gen Select.NotString(_#hoge#fuga) // hogeCategory: Lorem // dummy words Options:・Lorem.Word\(<column_name>(#<unsigned_integer_range>)?\) // one word or words of num in the range・Lorem.Sentence\(<column_name>(#<unsigned_integer_range>)?\) // one sentence or sentences of num in the range・Lorem.Paragraph\(<column_name>(#<unsigned_integer_range>)?\) // one paragraph or paragraphs of num in the rangeExample: fakes-gen Lorem.Word(_) // "氷山"fakes-gen Lorem.Word(_#2#4) // "有向グラフ Haskell Rust"Category: Name // nameOptions:・Name.FirstName\(<column_name>\) // first name・Name.FirstNameFurigana\(<column_name>\) // furigana of first name if exist, first name if not exist・Name.LastName\(<column_name>\) // last name・Name.LastNameFurigana\(<column_name>\) // furigana of last name if exist, last name if not exist・Name.FullName\(<column_name>\) // full name・Name.FullNameFurigana\(<column_name>\) // furigana of full name if exist, full name if not existExample: fakes-gen Name.FullName(_) Name.LastNameFurigana(_) Name.FirstNameFurigana(_) // "露木 静男","ツユキ","シズオ"Category: Primitive // primitive valuesOptions:・Primitive.Int\(<column_name>(#<signed_integer_range>)?\) // integer or integer with limit range・Primitive.Float\(<column_name>(#<signed_integer_range>)?\) // real num with limit range・Primitive.Ascii\(<column_name>(#<signed_integer_range>)?\) // one ascii char or ascii chars of num in the range・Primitive.Bool\(<column_name>\) // booleanExample: fakes-gen Primitive.Float(_) // -32544.35fakes-gen Primitive.Float(_#-1#1) // -0.87Category: Internet // internetOptions:・Internet.Email\(<column_name>\) // safe address of email・Internet.UserName\(<column_name>\) // name of user account・Internet.Password\(<column_name>#<unsigned_integer_range>\) // password as length one or num in the range・Internet.CreditCard\(<column_name>\) // safe number sequence of credit card・Internet.URL\(<column_name>\) // safe url・Internet.IPv4\(<column_name>\) // safe ipv4・Internet.IPv6\(<column_name>\) // safe ipv6・Internet.RGB\(<column_name>\) // rgb color such as #12480F・Internet.RGBA\(<column_name>\) // rgb with alpha such as #09AF50CB・Internet.UserAgent\(<column_name>\) // user agent・Internet.StatusCode\(<column_name>\) // status of http requestExample: fakes-gen Internet.URL(_) Internet.StatusCode(_) // "http://example.com/B/lUVB","6IxT4VL92u"Category: Company // compnayOptions:・Company.Suffix\(<column_name>\) // suffix of company such as Corp.・Company.Name\(<column_name>\) // name of company・Company.Industry\(<column_name>\) // domain of industryExample: fakes-gen Company.Name(_) Company.Industry(_) // "フリーダム匿名組合","宿泊業"Category: Address // address in countryOptions:・Address.Building\(<column_name>\) // name of building・Address.Street\(<column_name>\) // street in country・Address.City\(<column_name>\) // city in country・Address.State\(<column_name>\) // state in country・Address.CountryCode\(<column_name>\) // country code of three chars・Address.CountryName\(<column_name>\) // name of country・Address.TimeZone\(<column_name>\) // time zone・Address.Address\(<column_name>\) // address・Address.ZipCode\(<column_name>(#<bool>)?\) // zipcode with hyphen when not use <bool> or set true ・Address.Phone\(<column_name>(#<bool>)?\) // dummy phone number with hyphen when not use <bool> or set true ・Address.Latitude\(<column_name>\) // latitude such as +20.134875,-00.134875・Address.Longitude\(<column_name>\) // logitude +028.672211,-228.672211Example: fakes-gen Address.Phone(_#true) // "03-357-1407"Category: DateTime // date time with sub-format of "%Y-%m-%d %H:%I:%M" // If you want to know format, please reference to https://docs.rs/chrono/0.4.9/chrono/format/strftime/index.html#specifiersOptions:・DateTime.Time\(<column_name>#<format_string>\)・DateTime.Date\(<column_name>#<format_string>\)・DateTime.DateTime\(<column_name>#<format_string>\)Example: fakes-gen DateTime.Date(_#%m/%d) DateTime.Time(_) // "08/17","18:06:18"Category: FileSystem // fileOptions:・FileSystem.FileName\(<column_name>\) // name with extension of file・FileSystem.Extension\(<column_name>\) // extensionExample: fakes-gen FileSystem.FileName(_) // "8yIY6C4Pl.csv"And their option's format is theirs. [option] is <option>.
<option> := <normal_option>|<special_option><normal_option> := <category>\.<option_name>\(<column_name>(#<sub_option>)?\)<special_option> := <with_join_option><with_join_option> := With\.Join\(<column_name>#<join_separator>(#<repeatable_option>)*\)<join_separator> := [^#]*<repeatable_option> := <unsigned_integer>?#<option_without_column_name><option_without_column_name> := <category>\.<option_name>\((<sub_option>)?\)<category> := [A-Z][0-9a-zA-Z]*<option_name> := [A-Z][0-9a-zA-Z]*<column_name> := <string><sub_option> := <string>|<string_list>|<unsigned_integer_range>|<signed_integer_range>|<boolean>|<format_string><string> := ((".*")|[.[^\ ]]*)<string_list> := \[<string>(#<string>)*\]<unsigned_integer_range> := <unsigned_integer>#<unsigned_integer><signed_integer_range> := -?<unsigned_integer>#-?<unsigned_integer><unsigned_integer> := [0-9][1-9]*<bool> := (true)|(false)<format_string> := <string>If you want to know <format_string>, please reference to https://docs.rs/chrono/0.4.9/chrono/format/strftime/index.html#specifiersFakeOption's item is to convert to form Category(EachOption)can use as cli tool- add Primitive.Utf8 to FakeOption
- can specify character-code when generate
move helper's [not_]string_formatted to each Converter
About
Library and CLI tool for generating fake data as formatted as CSV, TSV and JSON.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.