Skip to main content

Generate some data and convert it to MySQL language.

Project description

Mysql random data generation

This is an auxiliary package for learning Mysql, and the I feel that inserting some test data is too cumbersome to enter manually, so I write a method that generates this data randomly and can automatically write it in Mysql language and save it to a text file. Currently, only insert into generation is supported.

Only Chinese is supported.

0.1.6 更多信息通过get_help()与get_demo()查看

pandas的帮助信息:

import mysql_study_datamaker_CN.pd_datamaker as pdk
print(pdk.get_demo()) # 查看如何使用 pandas随机生成的案例

mysql的帮助信息

import mysql_study_datamaker_CN.datamaker as dm
print(dm.get_demo()) # 获取 mysql 相关的案例
print(dm.get_help()) # 获取 mysql 相关的帮助

使用案例(mysql) 1: 实例1,生成单一数据 姓名,性别,年龄,城市

import mysql_study_datamaker_CN.datamaker as dm
one = dm.DataMaker(20, ("姓名", "性别", "年龄", "城市"))
one.get_data()

使用案例(mysql) 2: 示例2,员工信息 姓名,性别,生日,年龄,身份证,部门,手机,100人

import mysql_study_datamaker_CN.datamaker as dm
one = dm.DataMaker(50, ("姓名", "性别", "工号", "分数语文", "分数数学", "分数英语"),
                work_head="2024.三班", work_numwidth=2)
one.get_data("insert_into")

使用案例(mysql) 3: 示例3,员工信息 姓名,性别,生日,年龄,身份证,部门,手机,100人

import mysql_study_datamaker_CN.datamaker as dm
one = dm.DataMaker(100, ("姓名", "性别", "生日", "年龄", "身份证", "部门", "手机"))
one.get_data("insert_into")

使用案例(pandas.DataFrame) 4: 示例4,DataFrame对象,该对象的随机成绩 列名:科目 行名:姓名

import mysql_study_datamaker_CN.pd_datamaker as pdk
names = ["Tom",
         "Bob",
         "Jerry",
         "Lucy",
         "Lily",
         "Mike",
         "Tony",
         "Amber",
         "Kevin",
         "Peter"]
d1 = pdk.to_DataFrame_maker(n=9, low=80, high=150, people=10, names=names)
print(d1)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mysql_study_datamaker_cn-0.1.7.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mysql_study_datamaker_CN-0.1.7-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file mysql_study_datamaker_cn-0.1.7.tar.gz.

File metadata

File hashes

Hashes for mysql_study_datamaker_cn-0.1.7.tar.gz
Algorithm Hash digest
SHA256 cf1bfa4843c139fa80c15fd21473b578424a0beebfe131e77f5005baddd1714e
MD5 91bf9d09f9bfb2829d24725bdfabf03f
BLAKE2b-256 cbf6809ff38793c63b54569f1fc018809b4857502ad37b5cdb1830569b365a83

See more details on using hashes here.

File details

Details for the file mysql_study_datamaker_CN-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for mysql_study_datamaker_CN-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 72d2d82b3492e1353e10015e3d7b285985610fd044c9ad9bd4fcb2d224e8df45
MD5 afdfeb598708ac06d6b070ff1769a848
BLAKE2b-256 f5949240ddc37d420fc4b9f7429c7d75afcccab845cf4060c935507b964cc380

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page