RAISE Synthetic Data Generator
A Python package to generate shareable versions of tabular datasets ready to upload to the RAISE platform. The package can also be used beyond the scope of the RAISE project as a lightweight synthetic data generator.
Features
The package currently provides a single main function: generate_synthetic_data.
Main capabilities
-
Input flexibility Accepts either:
- A CSV file path, or
- A
pandas.DataFrame.
-
Automatic or manual model selection
"auto-select"(default) automatically chooses the best synthetic data generation model based on simulations carried out on the input data.- You can also specify a model explicitly (for the moment one of
CTGAN,TVAEorCopulas).
-
Synthetic data generation
- Generates a synthetic dataset with the same properties as the input data.
- Number of synthetic samples to generate can be specified via
n_samples(defaults to the size of the input data).
-
Results storage
- Saves the generated synthetic dataset as
synthetic_data.csv. - Stores model information (
info.txt) inside the chosen output folder. - Creates a run-specific folder under the desired output path.
- Saves the generated synthetic dataset as
-
Evaluation report (optional)
- If
evaluation_report=True(default), runs a quality assessment comparing original vs synthetic data. - Produces an evaluation report (
evaluation_report.pdf) with figures and summary statistics.
- If
-
Logging and error handling
- Provides informative log messages for each step (dataset loading, model selection, data generation, report creation).
- Exceptions are logged with full traceback and re-raised for debugging.
Installation
You can install raise-synthetic-data-generator directly from PyPI using pip:
pip install raise-synthetic-data-generator
Usage
from raise_synthetic_data_generator import generate_synthetic_data
import pandas as pd
# Example input dataframe
df = pd.DataFrame(
{"age": [23, 35, 44, 29, 31], "country": ["ES", "FR", "DE", "IT", "ES"]}
)
# Generate synthetic data (in memory + saved to disk)
generate_synthetic_data(
dataset=df, # if desired the CSV filename can also be given
selected_model="auto-select", # or explicitly: "CTGAN", "TVAE" or "Copulas
n_samples=10, # number of synthetic samples to generate
evaluation_report=True, # if true (evaluation PDF report is generated)
output_dir="results", # base output directory (if none, results path will be created)
run_name="demo-run", # optional run name (this will be the subfolder where generated objects will be stored, if none a subfolder will be created)
)
This will save in specified output folder:
- The generated synthetic (
synthetic_data.csv) - A text file with the applied model information (
info.txt) - (If selected) A folder with resulted evaluation figures (
evaluation_figures). - (If selected) A PDF report with synthetic data quality evaluation results (
evaluation_report.pdf).
Usage Examples
Code examples demonstrating how to use the raise-synthetic-data-generator package are provided in the examples folder of the repository. You can explore these examples to understand how to utilize the functionality of the package.
To get started, check the examples folder for various scripts and notebooks, such as:
generate_synthetic_data.ipynb: A Jupyter Notebook with step-by-step instructions for generating synthetic data of your dataset.
License
This project is licensed under the European Union Public License (EUPL) version 1.2. See the LICENSE file for more details.
Contributing
We welcome contributions! If you'd like to contribute, please fork the repository, make changes, and submit a pull request. Contributions are subject to the terms of the EUPL license.
Contact
For any inquiries, feel free to reach out via the following email: info@raise-science.eu. More about the project: https://raise-science.eu
Metadata
Release files for raise-synthetic-data-generator 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| raise_synthetic_data_generator-0.1.11.tar.gz | 551.3 kB | Without provenance | Details for raise_synthetic_data_generator-0.1.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| raise_synthetic_data_generator-0.1.11-py3-none-any.whl | Python 3 | none | any | Details for raise_synthetic_data_generator-0.1.11-py3-none-any.whl |
Total release size: 729.6 kB
Release files / raise_synthetic_data_generator-0.1.11.tar.gz
| Download URL | raise_synthetic_data_generator-0.1.11.tar.gz |
|---|---|
| Size | 551.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fb2bcb8b553ddff5c2c8e5e58c0ddb96977b363f90f4e9f1fb2878c774f0f43
|
|
BLAKE2b-256 checksum How to use checksums |
0b0fbcfd781073bf0532d5f90c66945c5b7e7fc5af6c0f1299b724aecef6b7d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / raise_synthetic_data_generator-0.1.11-py3-none-any.whl
| Download URL | raise_synthetic_data_generator-0.1.11-py3-none-any.whl |
|---|---|
| Size | 178.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc27e6cc5571dfeaf6ceb5c34e7f2308f423af04456e1addfd22c1a0d684012e
|
|
BLAKE2b-256 checksum How to use checksums |
ba9a37c47d2b68c39454704842d9089d6575a718a5bc1c77766be5c774249fa7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Security for raise-synthetic-data-generator 0.1.11
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.