Metadata-Version: 2.4
Name: synthpop-py
Version: 0.1.0
Summary: 
License-Expression: EUPL-1.2
License-File: LICENSE.md
Author: Erina
Author-email: erina.koomen@duo.nl
Requires-Python: >=3.13
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Dist: pandas (>=3.0.2,<4.0.0)
Requires-Dist: plotly (>=6.5.2,<7.0.0)
Requires-Dist: scikit-learn (>=1.8.0,<2.0.0)
Description-Content-Type: text/markdown

# Synthpop

This package is currently being developed. It mostly contains placeholders and documentation.

## What is synthpop?
Synthpop is a package to generate synthetic data, primarily for use in data analysis. This Python package is a redesign of the existing [R package](https://www.synthpop.org.uk/), with approval from and cooperation with the R package author's.

The Synthpop R package has consistently been found to outperform other synthesis methods when it comes to generating synthetic data that is statistically similar to the original data. [1](https://www.nature.com/articles/s41598-025-01514-0) [2](https://arxiv.org/abs/2211.14428) [3](https://www.researchgate.net/publication/363521664_Challenges_in_Measuring_Utility_for_Fully_Synthetic_Data). We aim to have the Python package perform as least as well.

Synthetic data generated by the synthpop package do not have any row-to-row relationships between synthetic and real data. As such, it may be considered non-personal data in the concept of privacy laws such as the the GDPR.

The aim is to generate synthetic data that is as close to the observed data as possible without disclosing the actual data.
This allows for analysis of sensitive data while adhering to the GDPR. 

The [R package](https://www.synthpop.org.uk/) has been used some time for this purpose.

## The goals of this project
The goal of this project is to make it easier to generate synthetic data for data analysis. 
For now, we aim to make it easier for two groups of people.
One group are people who are just starting out with synthetic data.
The other group are people that want to provide synthetic data to third parties or want to include synthetic data in their standard toolbox.

## General roadmap
The first aim is to make a package that is comparable to synthpop. 
This should attract enough active users to decide what the next aim should be.

## About the team
There are 3 maintainers, all of which work for the dutch ministry of education, culture, and science. 
There is a commitment of about 1.5 fte for at least a year.

## Contributing

If you wish to contribute to synthpop, start by cloning the repository.

### Prerequisites

The project uses **pipx** and **Poetry** for dependency management. Follow the steps below after cloning the repository.

1. Open a terminal in the root of the repository.
2. Install pipx: ```py -m pip install --user pipx```
3. Navigate to Scripts folder (the exact path is shown in the warning from the previous command): ```cd <USER folder>\AppData\Roaming\Python\Python<VERSIE>\Scripts```. 
4. Add pipx to your $PATH: ```run .\pipx.exe ensurepath```
5. Close the terminal and open a new one (anywhere).
6. Verify the installation: ```pipx --version```
7. Install poetry: ```pipx install poetry```
8. Close the terminal and open a new one (anywhere).
9. Verify the installation: ```poetry --version```

You can close the terminal.

### Install project dependencies

1. Open a terminal in the root of the repository.
2. Install all dependencies: ```poetry install --with=docs```
3. Navigate to the **docs** directory: ```cd docs``` 
4. Build the documentation: ```poetry run sphinx-build source build```

You can close the terminal.

### Install from GitHub source

Use one of the following workflows when you want to test the package directly from GitHub instead of PyPI.

#### Test the latest `main` branch without cloning

```bash
python -m pip install "git+https://github.com/duonl/synthpop-py.git@main"
```

#### Develop from a local clone

1. Clone the repository: ```git clone https://github.com/duonl/synthpop-py.git```
2. Enter the project directory: ```cd synthpop-py```
3. Install the project and documentation dependencies: ```poetry install --with=docs```
4. Run project commands through Poetry, for example: ```poetry run pytest```

### Updating the documentation

After making changes to the documentation, rebuild the HTML output by running the following commands:

1. Open a terminal in the root of the repository:
2. Navigate to the **docs** directory: ```cd docs``` 
3. Delete current documentation files: ``` poetry run sphinx-build -M clean source build```
4. Build the new documentation: ``` poetry run sphinx-build source build```

