MySQL Data Generator
Project description
Datapush
Datapush is a Python package that generate data to MySQL Database dynamically.
When you need data for MySQL for some reasons (for test), and too lazy to make mock data, here is the answer.
Just enter your table, datapush will check each column and automatically generate the appropriate data!
Download
pip install datapush
Usage
# Connect to db
conn = datapush.mysql.connect(
host='localhost',
port=3306,
user='root',
password='',
database=''
)
# Make generator with connection
generator = datapush.Generator(conn)
# Generate!
generator.generate(
table='example_table'
)
Option
In generator.generate(), there has several options.
Args:
- table (str): The name of the table.
- count (int): The number of data you want to generate. (default: 10)
- **option (dict): Some specific data for each column
you want to generate (uuid, username, ip, etc...)
ex) user=id, uuid=uuid, ip_address=ip,
ex) column_name=type
Extra Usage
generator.generate(
table='example_table',
count=1000,
char_col='ip', # column_name is char_col and make unique ip
text_col='id', # column_name is text_col and make unique id
varchar_col='uuid' # column_name is varchar_col and make unique uuid
)
Note
Currently, we don't support spartial data type (geometry, point, polygon etc...)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
datapush-1.0.1.tar.gz
(6.8 kB
view details)
Built Distribution
datapush-1.0.1-py3-none-any.whl
(12.3 kB
view details)
File details
Details for the file datapush-1.0.1.tar.gz
.
File metadata
- Download URL: datapush-1.0.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddbaffeb8088b4df4c24ceea34c627eeeb5082405beb2cd5ebc2fe46be92db69 |
|
MD5 | 0d838bafb39126ff99d20584a90afbbe |
|
BLAKE2b-256 | fd4b8f49962b4ade94af9b9637ec1937bae824bfaecbb726c4fcaac790cea65a |
File details
Details for the file datapush-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: datapush-1.0.1-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e2992414721895440ff31a49047d24e3a8eb98625f2e82fdea9ae622b3f212b |
|
MD5 | dbccb9664623f7f7d413be14922481a4 |
|
BLAKE2b-256 | eab5e5f61debb093eb74344e5e9eff04a9dc04a1b46cfb0f79fcb26f1444539b |