PyPI Install
Suitable for environments with network connection but without Docker support.
Available Dependency Groups
PETsARD provides different dependency groups for various use cases:
| Group | Included Features |
|---|---|
| Default | Core functionality: configuration, data loading, synthesis, evaluation, benchmark dataset downloads (pyyaml, pandas, anonymeter, sdmetrics, sdv, torch, requests, etc.) |
Data Science (ds) | Basic functionality + Jupyter Notebook support (for Docker environments with Jupyter) |
Complete (all) | Data science functionality + xlsx file support |
Development (dev) | Complete functionality + development and testing utilities (pytest, ruff, coverage, etc.) |
Method 1: PyPI Installation (Recommended)
PETsARD is available on PyPI.
Method 1-a: Using uv (Fastest, Recommended)
uv is a fast Python package installer.
Step 1: Install uv (skip if already installed)
# macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Or using pip
pip install uvStep 2: Install PETsARD
# Default installation (recommended for most users)
uv pip install petsard
# With dependency groups
uv pip install petsard[ds] # For Docker environments with Jupyter
uv pip install petsard[all] # With xlsx file support
uv pip install petsard[dev] # For developmentMethod 1-b: Using pip
Modern pip (>= 25.0) with dependency-groups support:
# Default installation (recommended for most users)
pip install petsard
# With dependency groups
pip install --group ds petsard # For Docker environments with Jupyter
pip install --group all petsard # With xlsx file support
pip install --group dev petsard # For developmentOlder pip (< 25.0) - backward compatible syntax:
pip install petsard[ds] # For Docker environments with Jupyter
pip install petsard[all] # With xlsx file support
pip install petsard[dev] # For developmentMethod 1-c: Installing from TestPyPI (For Testing)
To install pre-release or test versions from TestPyPI:
# Using pip
pip install --index-url https://test.pypi.org/simple/ petsard
# Using uv
uv pip install --index-url https://test.pypi.org/simple/ petsard
# With dependency groups (may need additional --extra-index-url for dependencies)
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ --group ds petsardNote: TestPyPI is used for testing package releases. For production use, install from the main PyPI (methods 1-a or 1-b above).
Installation in Restricted Network Environments
If you’re installing in a restricted network environment (e.g., behind a corporate firewall or proxy), you may encounter SSL certificate verification issues. In such cases, you can use the --trusted-host parameter to bypass certificate verification:
# Modern pip (>= 25.0)
pip install --group ds petsard \
--trusted-host pypi.org \
--trusted-host files.pythonhosted.org
# Older pip (< 25.0)
pip install petsard[ds] \
--trusted-host pypi.org \
--trusted-host files.pythonhosted.orgFor Jupyter Notebook users, the syntax is the same:
# Modern pip (>= 25.0)
%pip install --group ds petsard \
--trusted-host pypi.org \
--trusted-host files.pythonhosted.org
# Older pip (< 25.0)
%pip install petsard[ds] \
--trusted-host pypi.org \
--trusted-host files.pythonhosted.orgUnderstanding --trusted-host parameters:
--trusted-host pypi.org- Trusts the main PyPI index server--trusted-host files.pythonhosted.org- Trusts PyPI’s package file storage server
These parameters tell pip to skip SSL certificate verification for the specified hosts. This is useful when:
- Corporate networks intercept SSL/TLS traffic for security inspection
- Self-signed certificates are in use
- Certificate validation fails due to proxy configurations
Note: Only use --trusted-host in trusted network environments, as it reduces security by disabling certificate verification. Consider configuring proper SSL certificates or using a private PyPI mirror for production environments.
Method 2: Source Installation
For development or custom builds.
Method 2-a: Using Git (Recommended)
# Clone the repository
git clone https://github.com/nics-dp/petsard.git
cd petsard
# Using modern pip (>= 25.0) with dependency-groups
pip install --group all -e . # Complete functionality
pip install --group ds -e . # Data science features
pip install --group dev -e . # Development tools
# Using older pip (< 25.0) - backward compatible
pip install -e .[all] # Complete functionality
pip install -e .[ds] # Data science features
pip install -e .[dev] # Development tools
# Or using uv (recommended for development)
uv sync --group all # Complete functionality
uv sync --group dev # Development environmentMethod 2-b: Manual Download (Without Git)
If Git is not available in your environment, you can download the source code directly as a ZIP file:
Step 1: Download the Source Code
Visit PETsARD GitHub Releases or download directly:
- Latest stable version: https://github.com/nics-dp/petsard/archive/refs/heads/main.zip
- Or select a specific version from the Releases page
Step 2: Extract and Install
# Extract the downloaded file
unzip petsard-main.zip
cd petsard-main
# Using modern pip (>= 25.0) with dependency-groups
pip install --group all -e . # Complete functionality
pip install --group ds -e . # Data science features
pip install --group dev -e . # Development tools
# Using older pip (< 25.0) - backward compatible
pip install -e .[all] # Complete functionality
pip install -e .[ds] # Data science features
pip install -e .[dev] # Development tools
# Or using uv (recommended for development)
uv sync --group all # Complete functionality
uv sync --group dev # Development environmentWindows users can use File Explorer to extract the ZIP file, then open Command Prompt or PowerShell in that folder to run the installation commands.
Recommended tools for development:
pyenv- Python version managementuv- Package management