Skip to main content

MySQL Data Generator

Project description

Datapush

Datapush is a Python package that generate data to MySQL Database directly.

When you need data for MySQL for some reasons (for test), and too lazy to make mock data, here is the answer.

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'
)

Extra 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
)

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

datapush-1.0.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

datapush-1.0.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file datapush-1.0.0.tar.gz.

File metadata

  • Download URL: datapush-1.0.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for datapush-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4d9a2fb5b8c19b7c3fd19b71056b406d7608d607152a0cf2a69982a034d5e1f8
MD5 00cabcd18ed6b3758e9a0a27c23ad628
BLAKE2b-256 c9bce46b7b7785ce5436366b01d9165abdac53ce253808ad562cc00ea3ee8dfa

See more details on using hashes here.

File details

Details for the file datapush-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: datapush-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for datapush-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cf72469c50e84ec9803a25d8ebe30975d0750462ca8b04673782f43d2e48870
MD5 bad2a7995a7a14ebc7a70837c50beb63
BLAKE2b-256 4c4a222e8c8413ebeac18441ce1eeb778de3310d4d2115e6535eb1fb490333f5

See more details on using hashes here.

Supported by

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