ctgan
Create tabular synthetic data using a conditional GAN
What it is and what it does
CTGAN is a standalone deep learning library for generating synthetic tabular data using conditional GAN and TVAE models. It learns patterns from real data and produces synthetic records that preserve statistical properties while protecting privacy. The library is part of the Synthetic Data Vault ecosystem but can be used independently; it requires careful data preprocessing (no missing values, proper type handling) and depends on PyTorch for model training.
Typical workflows involve loading real data, specifying which columns are discrete, training a model for a set number of epochs, and sampling synthetic records. The library is in Pre-Alpha stage, meaning its API and behavior may change. It's most suitable for research, testing, and non-production synthetic data needs where you control the licensing implications.
Use it for:
- Generate synthetic test datasets for machine learning model development without exposing real customer or sensitive data.
- Create privacy-preserving data samples for sharing with external teams or in research publications.
- Augment imbalanced training datasets by synthesizing additional records for underrepresented classes.
- Prototype data pipelines and validate ETL logic on realistic synthetic data before running against production.
- Evaluate data quality and statistical properties of synthetic data generation models in research contexts.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
CTGAN generates synthetic tabular data by training deep learning models (CTGAN and TVAE) on real datasets, learning patterns to produce high-fidelity synthetic records suitable for testing, privacy-preserving data sharing, or augmentation.
Yes, with conditions. Install CTGAN if you need to generate synthetic tabular data and accept its Pre-Alpha maturity and BUSL-1.1 licensing restrictions. The library is actively maintained, has low install friction, and no known vulnerabilities. However, verify that the Business Source License aligns with your use case (commercial use may be restricted), and consider the SDV wrapper library if you need higher-level APIs and preprocessing support. Not recommended for production systems requiring stability guarantees.
Install
ctgan on PyPI
pip
pip install ctganuv
uv add ctganpoetry
poetry add ctganInstalling ctgan
Before you install
Low install friction with five runtime dependencies (numpy, pandas, torch, tqdm, rdt). Actively maintained with a recent release 182 days ago and ongoing repository activity. Pre-Alpha status signals the library is still evolving; consider this for experimental or non-production workflows.
License in practice
Licensed under BUSL-1.1 (Business Source License), which restricts commercial use until a specified date and requires careful review of your use case. This is not a permissive open-source license; verify compatibility with your project's licensing requirements.
Quickstart
from ctgan import CTGAN, load_demo
real_data = load_demo()
discrete_columns = ['workclass', 'education', 'occupation']
ctgan = CTGAN(epochs=10)
ctgan.fit(real_data, discrete_columns)
synthetic_data = ctgan.sample(1000)
Requires torch (PyTorch) as a runtime dependency; data must be preprocessed with continuous values as floats, discrete as ints/strings, and no missing values.
Verify before relying
- Whether BUSL-1.1 licensing restrictions apply to your intended use case and timeline.
- Performance characteristics and memory requirements for large datasets or high-dimensional tables.
- Fidelity and privacy guarantees compared to alternatives in the SDV ecosystem.
Package facts
| License | BUSL-1.1 (unclear) |
| Python support | supports the current Python release (<3.15,>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — numpy, pandas, torch, tqdm, rdt |
| Maintenance | actively maintained — 182 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 122,961/month — #11,927 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ctgan-0.12.1-py3-none-any.whl
Keywords: ctgan, CTGAN
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
deepechoDeepEcho generates synthetic time series data…
unclear · top 15,000 on PyPI
sdvSDV generates synthetic tabular data by…
unclear · top 15,000 on PyPI
copulasCopulas models multivariate statistical…
unclear · top 15,000 on PyPI
sdmetricsSDMetrics evaluates synthetic data by computing…
permissive · top 15,000 on PyPI
autogluon.tabularAutomates machine learning model training and…
permissive · top 15,000 on PyPI
rdtRDT converts raw, mixed-type data into fully…
unclear · top 15,000 on PyPI
autogluonAutoGluon automates machine learning model…
permissive · top 15,000 on PyPI
featuretoolsFeaturetools automates feature engineering for…
permissive · top 15,000 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI
batchgeneratorsv2Reimplemented data augmentation transforms for…
permissive · top 15,000 on PyPI