gen_data简介

DDD
发布: 2024-09-20 08:12:01
转载
924人浏览过

gen_data简介

介绍

gen_data是一个方便的工具,支持生成csv测试数据文件。
它可以用来生成一个非常大的数据文件用于测试目的。

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 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 titles

list of supported types: bool=1 int=2 string=3 float=4 date=5 datetime=6
登录后复制

如何设置?

# 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_data
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: 
登录后复制

用法

# 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,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简介的详细内容,更多请关注php中文网其它相关文章!

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
相关标签:
git
来源:dev.to网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号