Skip to main content

FakeReal

Overview

FakeReal is a Python library designed to populate MySQL, PostgreSQL, and SQLite databases with random test data. With FakeReal, you can easily generate and insert fake but realistic data into your databases, either for testing or for other purposes. It's built on top of the Faker library for generating the data and uses Peewee for database connectivity.

Features

  • Multiple Database Support: FakeReal supports MySQL, PostgreSQL, and SQLite databases.
  • Intuitive API: FakeReal provides an easy-to-use API for seeding databases and running test queries.
  • Customizable Data Generation: Auto-generates realistic data based on your database schema, semantics of fields, and relationship between the tables.
  • Wipe Test Data: Provides the ability to wipe test data from databases.

Installation

You can install FakeReal via pip:

pip install fakereal

Quick Start

Pre-requisites

Before diving into FakeReal, create a sample database named OnlineStore:

mysql -u root -p < onlineStoreDB.sql

Seed Your Database

Here's a Python script to quickly get you started with FakeReal:

from fakereal import fakereal

# Initialize FakeReal with a connection string
connection_string = 'mysql://root:@localhost:3306/OnlineStore'
FakeReal = fakereal(connection_string)

# Seed 'all' tables with 100 rows each, in batches of 10
FakeReal.seed('all', rows=100, batch_size=10)

# Run test queries and print the result
result = FakeReal.test_queries(return_bool=True, silent=False)
print(result)

Contributing

Contributions are welcome!

License

This project is open source.

Metadata

Release files for fakereal 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fakereal 0.2.1
File Size Uploaded Provenance Actions
fakereal-0.2.1.tar.gz 5.8 kB Without provenance Details for fakereal-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fakereal 0.2.1
File Interpreter ABI Platform Actions
fakereal-0.2.1-py3-none-any.whl Python 3 none any Details for fakereal-0.2.1-py3-none-any.whl

Total release size: 12.2 kB

Release files / fakereal-0.2.1.tar.gz

Download URL fakereal-0.2.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
03384f17a5f44c59fbd767581b40e456047010dd7f1748447b426672abfd1443
BLAKE2b-256 checksum
How to use checksums
5665e2b02b780a6c40495c9bb260425f39f901843326ca9edee83b7787a9802b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Release files / fakereal-0.2.1-py3-none-any.whl

Download URL fakereal-0.2.1-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e03d12d3785c48d6c0f607f8cd1eac06650c72e6bedeb4b1ef4d55dc391a878f
BLAKE2b-256 checksum
How to use checksums
8883565772c0a7b3776600a686c16432d04b3aa31bc8c2957855210eb0ddc98c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Security for fakereal 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page