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
- 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,
"database": "db",
"user": "user",
"password": "password",
}
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_postgres,
schema="public",
table="teste",
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
File details
Details for the file fake_data_to_database-1.1.tar.gz.
File metadata
- Download URL: fake_data_to_database-1.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
116122785bec86da80ed9266cae1f60e0d44203f7217d260bce9bb9992cda9b3
|
|
| MD5 |
6390f51a15ffa01b36d2adc6a14f80ac
|
|
| BLAKE2b-256 |
1cfbeb873d2e4c86961c5590e97d4bce6bc881664181db3689f0357d458eb3b7
|