Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wklee610/datapush
MySQL Data Generator
https://github.com/wklee610/datapush
automatic data data-generator database dataset db dynamically generator mysql test testing-tools
Last synced: about 2 months ago
JSON representation
MySQL Data Generator
- Host: GitHub
- URL: https://github.com/wklee610/datapush
- Owner: wklee610
- License: mit
- Created: 2024-11-08T15:22:31.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-18T14:33:44.000Z (about 2 months ago)
- Last Synced: 2024-11-18T15:48:37.891Z (about 2 months ago)
- Topics: automatic, data, data-generator, database, dataset, db, dynamically, generator, mysql, test, testing-tools
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```bash
pip install datapush
```## Usage
```python
# 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
```python
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...)