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.3.tar.gz (7.3 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: fake_data_to_database-1.3.tar.gz
  • Upload date:
  • Size: 7.3 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.3.tar.gz
Algorithm Hash digest
SHA256 52f2c31dfd6018e8812b55cee7404f49fb34ce100a3c1d27d9c3a0770f5276cd
MD5 1908d73dd1751124c5820b03b2c4ac93
BLAKE2b-256 599740c68a8a1560cc0d0ac66238a362c3dda3fc78bbe2d3f148025f4543dbd1

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