
介绍
gen_data是一个方便的工具,支持生成csv测试数据文件。
它可以用来生成一个非常大的数据文件用于测试目的。
usage: gen_data [-h] -r rows [-c columns] [-t titles] csvfilegenerate csv file with specfied number of rows, and column types.positional arguments: csvfileoptions: -h, --help show this help message and exit -r rows, --rows rows number of rows -c columns, --columns columns list of colume type, in this format: "t t t:n ..." where t is type (number), n is column length. -t titles, --titles titles list of column titleslist of supported types: bool=1 int=2 string=3 float=4 date=5 datetime=6
如何设置?
# clone the repogit clone git@github.com:patfinder/gen_data.git# move to the tool source folder. then enter below command to setup the tool.# after this, gen_data will become a script command that you can execute directly.$ pip install -e .# show info of installed script$ pip show gen_dataname: gen-dataversion: 0.0.1summary: a convinient tool for generating big test data.home-page: https://github.com/patfinder/gen_data/author: le vuong nguyenauthor-email: vuong.se@gmail.comlicense: unknownlocation: ~/myrepos/gen_datarequires: required-by:
用法
# Show Help for the command$ gen_data --help# Run sample command to generate csv with 5 rows# and columns of (int, string, string with length of 20, int) and column titles$ gen_data f1.csv -r 5 -c"1,3,3:20,2" -t"is_active,name,job_desc,score"# Sample output of above command is f1.csv with below content$ cat f1.csv id,is_active,name,job_desc,score1,False,Louis Martinez,Really tonight we.,5592,True,Larry Williams,Moment word camera.,8453,True,Brandon Williams,Wear your consumer.,6774,False,Chelsea Zamora,Identify itself let.,3845,True,Jonathan Collier MD,Offer popular.,502
以上就是gen_data简介的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1349866.html
微信扫一扫
支付宝扫一扫