Skip to main content

A Python library to generate fake data and insert it into databases.

Project description

Fake Data To Database

Fake Data To Database is a Python library designed to generate fake data and insert it into databases.

Features

  • Generate realistic fake data using Faker
  • Insert data into:
    • PostgreSQL
    • SQLServer
  • Easy-to-use interface for bulk data insertion

Installation

You can install the library using pip:

pip install fake-data-to-database

Exemple of use

You can use the lib as the exemple:

import fake_data_to_database as fdg

db_config_postgres = {
    "db": "postgres",
    "host": "localhost",
    # "port": 5432, # Default 5432
    "database": "testdb",
    "user": "user",
    "password": "password",
}
db_config_sqlserver = {
    "db": "sqlserver",
    "host": "localhost",
    # "port": 1433, # Default 1433
    "database": "master",
    "user": "SA",
    "password": "YourStrong!Passw0rd",
}

fields = {
    "name": {"type": "varchar", "nullable": False},
    "age": {"type": "int", "nullable": False},
    "email": {"type": "varchar", "nullable": True},
    "cidade": {"type": "varchar", "nullable": False},
}

fdg = fdg.FakeDataGenerator(
    db_config=db_config_sqlserver,
    schema="test",
    table="test",
    fields_config=fields
)

fdg.generate_and_insert_data(num_records=10)

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

fake_data_to_database-1.2.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file fake_data_to_database-1.2.tar.gz.

File metadata

  • Download URL: fake_data_to_database-1.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for fake_data_to_database-1.2.tar.gz
Algorithm Hash digest
SHA256 6c99aa10c6250d3017d1bfd348fcb6982f566b9a7c1a81bfc332741d50005d48
MD5 b62fddd0f640f99695865eed61af5792
BLAKE2b-256 3c3b67c6acba5977b54a13984cd38d68296c0027d7c38228d5c68ba2d68d7e2f

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