synthpop-py
synthpop-py is a Python package for generating synthetic tabular data using sequential modelling methods. It is based on the established synthpop R package, but provides a modern Python interface and software architecture specifically designed for usability, reproducibility, maintainability and extensibility.
Synthetic data can help researchers, data scientist, statisticians and organisations work with realistic datasets when access to original or sensitive data is restricted. synthpop-py learns statistical relationships from an original dataset and uses these relationships to generate new synthetic observations. Properly synthesised data does not have any row-to-row relationships to the original data. As such, it may be considered non-personal data in the context of privacy laws such as the GDPR.
However, synthetic data does not automatically eliminate privacy risks. Sensitive information or distinctive patterns from the original data may still be reproduced or inferred from synthetic data. Users should therefore always carefully consider the characteristics and sensitivity of the original data, the synthesis methods, the settings used, and the intended use and sharing context of the synthetic data.
Project status: synthpop-py is currently under active development and the project is working towards its
1.0.0release
Quick start
The following example demonstrates the basic synthpop-py workflow:
import pandas as pd
from synthpop import Synthesiser
# Load original data
orig_df = pd.read_csv("path/to/your/data.csv")
# Create and fit the synthesiser
synth = Synthesiser(random_seed=42)
synth.fit(orig_df)
# Generate synthetic data
syn_df = synth.generate()
The original data should always be provided as a pandas.DataFrame. The Synthesiser learns the data patterns using a synthesis model when fit() is called, after which generate() creates a new synthetic dataset. It is possible to generate a dataset with a different number of observations than the original data.
Ready to explore further? For a complete introduction to preparing data, configuring synthesis, generating synthetic datasets, and evaluating the results, see the Getting Started guide.
If you try synthpop-py and have feedback on your experience, we would be very interested to hear from you. Your feedback can help us improve the package and prioritise future development.
Installation
Requirements
synthpop-py requires:
- Python 3.11 or later
- pandas 3.0.2 or later
- scikit-learn 1.8.0 or later
- plotly 6.5.2 or later
The runtime dependencies are installed when installing synthpop-py from PyPI.
Install from PyPi
The recommended installation method is through PyPI:
pip install synthpop-py
You can verify the installation by importing the package:
import synthpop
For installation in a virtual environment, installation from source, and troubleshooting, see the Installation documentation.
Documentation
The full documentation is available on Read the Docs.
It includes:
- Getting Started — an introduction to generating synthetic data with
synthpop-py. - User Guide — detailed guidance on data preparation, synthetic data generation, synthesis methods, and evaluation.
- Examples - detailed examples on creating a synthesis, evaluating the data, adjusting parameters and creating custom synthesis methods.
- API Reference — documentation of the Python API.
- Developer documentation — information about the project architecture, development workflow, and contributing to the package.
If you are using synthpop-py and find something unclear, missing, or difficult to follow, please let us know. Documentation improvements and suggestions for new examples are very welcome.
Supported data and synthesis methods
synthpop-py is designed for structured tabular datasets. It currently supports:
- numeric variables;
- categorical variables;
- boolean variables;
- ordinal variables; and
- missing values.
The package is not currently designed for unstructured data such as free text, images, audio, or time-series data. Synthesis is performed on one tabular dataset at a time. synthpop-py does not synthesise an entire relational database as a single unit, and it does not provide explicit support for relational structures such as primary key/foreign key relationships.
Synthesis methods
synthpop-py currently provides the following synthesis methods:
- CART — A Classification and Regression Trees method, the default sequential modelling method;
- Sampling — a sampling-based synthesis method; and
- Copying — a copying-based method.
The package is designed with extensibility in mind. Additional synthesis methods can be developed and integrated through the package's architecture, allowing users and contributors to extend the available synthesis functionality.
See the User Guide for detailed information about synthesis methods and their configuration.
Evaluating synthetic data
Synthetic data should be evaluated before it is used or shared. In particular, users should consider both utility and privacy.
Utility describes how well the synthetic data preserves the statistical properties and relationships that are relevant to the intended use. synthpop-py provides functionality for evaluating synthetic data utility.
Privacy concerns the extent to which information about individuals in the original data could be inferred from the synthetic data. Synthetic data can reduce the need to share sensitive original data, but generating synthetic data does not automatically guarantee privacy or anonymity.
Privacy evaluation functionality is planned for future development. Until then, users should independently assess the privacy risks associated with their datasets, synthesis settings, and intended use.
For more information about synthetic data evaluation, see the documentation.
Relationship to the synthpop R package
synthpop-py is based on the core concepts of the established synthpop R package, which provides a widely used framework for generating synthetic tabular data through sequential modelling.
The sequential modelling approach synthesises variables one at a time, using previously synthesised variables as predictors for subsequent variables. This allows statistical relationships between variables in the original data to be incorporated into the generated synthetic data.
synthpop-py brings this approach to the Python ecosystem through a native Python interface and a modular software architecture designed to support usability, testing, reproducibility, maintainability, and future extension.
The two packages are related but are not currently feature-equivalent. The original R package provides a broader collection of synthesis methods and evaluation functionality, while synthpop-py currently focuses on a smaller set of synthesis methods with an emphasis on providing a robust and extensible Python implementation.
The development of synthpop-py has been undertaken with approval from, and in cooperation with, the authors of the original synthpop R package.
For background on the methodology and the use of synthpop, see the references below.
Limitations and responsible use
Synthetic data should not automatically be considered anonymous or free from privacy risks.
The privacy and utility of a synthetic dataset depend on factors including:
- the characteristics of the original dataset;
- the synthesis methods and configuration used;
- the variables included in the data; and
- the intended use and sharing context.
Users are responsible for evaluating whether generated synthetic data is suitable for their intended purpose and whether it meets applicable privacy, security, legal, and regulatory requirements.
In particular, synthpop-py does not currently provide formal privacy guarantees such as differential privacy. Users should therefore not assume that the use of synthetic data alone guarantees that individuals in the original data cannot be identified or that sensitive information cannot be inferred.
Synthetic data should also be evaluated for utility. A synthetic dataset that provides strong privacy protection may not preserve the statistical characteristics required for a particular analysis, while a highly useful synthetic dataset may retain patterns that increase disclosure risk.
Project status and roadmap
synthpop-py is currently under active development. We expect to be able to do maintenance for at least a year (end of 2027). We are still working on long(er) term financing, development and maintenance. We expect to develop new features for at least half a year.
synthpop-py is a relatively new open-source project, with a small but growing user group. We are looking forward to growing the project together with its users and contributors.
The initial release focuses on providing a robust Python implementation of the core sequential modelling approach, with an emphasis on:
- usability;
- reproducibility;
- maintainability;
- extensibility; and
- integration with the Python data science ecosystem.
The preliminary roadmap is as follows:
- adjustable "level of privacy"
- business rules
- evaluating utility
- evaluating privacy
The roadmap will evolve as the project develops. If you have any ideas about features or improvements that would make synthpop-py more useful, we would love to hear from you. You can share your ideas through GitHub or email us at synthetische.data@duo.nl.
More details wil follow soon.
Contributing
We are very happy to receive contributions to synthpop-py. Whether you found a bug, spotted something that could be improved, have an idea for a new feature, want to improve the documentation or would like to contribute code, we would love to hear from you.
You do not need to be an expert in the field of synthetic data to contribute. Questions, suggestions and discussions are valuable contributions too, and they help us understand how synthpop-py can better serve its users.
For information about contributing to the project, setting up a development environment, and the development workflow, see the project's CONTRIBUTING.md and the developer documentation.
Have an idea for a feature? Found something that does not work as expected? Want to contribute to the project? Please get in touch through GitHub.
License
synthpop-py is licensed under the European Union Public Licence (EUPL), version 1.2.
See the LICENSE file for the full licence text.
Acknowledgements
synthpop-py is currently developed by a team of employees of the Dutch Ministry of Education, Culture and Science. The project is intended to be developed and maintained as open-source software.
The project builds on the methodology and ideas of the original synthpop R package and is developed with approval from, and in cooperation with, its original authors.
References
For background on the utility and application of synthetic data and the synthpop methodology, see:
- Ji, E., Ohn, J.H., Jo, H. et al. (2025). Evaluating the utility of data integration with synthetic data and statistical matching. Scientific Reports, 15, 19627. https://doi.org/10.1038/s41598-025-01514-0
- Khan, M.S.N., Reje, N., Buchegger, S. (2022). Utility Assessment of Synthetic Data Generation Methods. https://doi.org/10.48550/arXiv.2211.14428
- Drechsler, J. (2022). Challenges in Measuring Utility for Fully Synthetic Data. In Privacy in Statistical Databases: International Conference, PSD 2022, Paris, France, 220–233. https://doi.org/10.1007/978-3-031-13945-1_16
Metadata
Release files for synthpop-py 1.0.0
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 | |
|---|---|---|---|---|
| synthpop_py-1.0.0.tar.gz | 47.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| synthpop_py-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 102.5 kB
Release files / synthpop_py-1.0.0.tar.gz
| Download URL | synthpop_py-1.0.0.tar.gz |
|---|---|
| Size | 47.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43882b183721ad6e6dd304960ef11ba94f68648a59877e58516f1794b4858c67
|
|
BLAKE2b-256 checksum How to use checksums |
c221994ed92eb5cc9e95396c89c38beccc4786ab0cd6d3ae8a0971306b3a5e56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.1 CPython/3.13.5 Windows/11
|
Release files / synthpop_py-1.0.0-py3-none-any.whl
| Download URL | synthpop_py-1.0.0-py3-none-any.whl |
|---|---|
| Size | 55.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3cadec79f6fc2b67a8864bb527d2cd633ddb9bcf09bfd8b414d0e5fd934a6f76
|
|
BLAKE2b-256 checksum How to use checksums |
dccb5960eef4ec0d06bc70142b302d13bc6b9b29f8395ae1ce83d06004d7b3bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.1 CPython/3.13.5 Windows/11
|
Security for synthpop-py 1.0.0
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.