skillfed

ctgan

Create tabular synthetic data using a conditional GAN

ctgan v0.12.1 123.0K downloads/30d#11,927 on PyPI1,559
License unclear BUSL-1.1 Active released

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 ctgan

uv

uv add ctgan

poetry

poetry add ctgan

Installing 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

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Artificial Intelligence

Tags

synthetic tabular data generationconditional GAN for tablesdeep learning data synthesisprivacy-preserving synthetic datatabular data augmentation
synthetic-datadeep-learningprivacy

More Artificial Intelligence packages

Further reading