https://github.com/gangly/datafaker
datafaker是一个大批量测试数据和流测试数据生成工具,兼容python2.7和python3.4+。
-确保安装python3以及pip3,然后通过pip3进行安装
pip3 install datafaker
-更新到最新版本:
pip install datafaker --upgrade
-卸载工具:
pip uninstall datafaker
-安装对应数据包
对于不同的数据库需要用到不同的python包,若在执行过程中报包缺失问题。 请pip安装对应包
| 数据库 | python包 | 备注 |
|---|
| mysql/tidb | mysql-python/mysqlclient | windows+python3请使用mysqlclient |
| oracle | cx-Oracle | 同时需要下载orale相关库 |
| postgresql/redshift | psycopg2 | 根据sqlachemy选择对应包 |
| sqlserver | pyodbc | mssql+pyodbc |
| Hbase | happybase,thrift | |
| es | elasticsearch | |
| hive | pyhive | |
| kafka | kafka-python | |
-mysql: https://pypi.org/project/mysqlclient/
yum install python3-devel mysql-devel
pip3 install mysqlclient
签名:这个人很懒,什么也没有留下!