Metadata-Version: 2.1
Name: datapush
Version: 1.0.1
Summary: MySQL Data Generator
Home-page: https://github.com/wklee610/datapush
Author: Hajun Lee
Author-email: wklee610@gmail.com
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pymysql

# 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...)

