gen_data简介

介绍

gen_data是一个方便的工具,支持生成csv测试数据文件。

它可以用来生成一个非常大的数据文件用于测试目的。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

usage: gen_data [-h] -r rows [-c columns] [-t titles] csvfile

generate csv file with specfied number of rows, and column types.

positional arguments:

csvfile

options:

-h, –help            show this help message and exit

-r ro搭建项目系统点我wcqh.cnws, –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 titles

list of supported types: bool=1 int=2 string=3 float=4 date=5 datetime=6

登录后复制

如何设置?

1

2

3

4

5

6

7

8

9

10

11

12搭建项目系统点我wcqh.cn

13

14

15

16

17

18

19

# clone the repo

git 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_搭建项目系统点我wcqh.cndata

name: gen-data

version: 0.0.1

summary: a convinient tool for generating big test data.

home-page: https://github.com/patfinder/gen_data/

author: le vuong nguyen

author-email: vuong.se@gmail.com

license: unknown

location: ~/myrepos/gen_data

requires:

required-by:

登录后复制

用法

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

# Show Help for搭建项目系统点我wcqh.cn 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搭建项目系统点我wcqh.cn

id,is_active,name,job_desc,score

1,False,Louis Martinez,Really tonight we.,559

2,True,Larry Williams,Moment word camera.,845

3,True,Brandon Williams,Wear your consumer.,677

4,False,Chelsea Zamora,Identify itself let.,384

5,True,Jonathan Collier MD,Offer popular.,502

登录后复制

以上就是gen_data简介的详细内容,更多请关注青狐资源网其它相搭建项目系统点我wcqh.cn关文章!

© 版权声明
THE END
喜欢就支持一下吧
点赞944 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容