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 uv
Step 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 development
Method 1-b: Using pip
# 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 development
Method 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 petsard
Note: 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:
pip install --group ds petsard \
--trusted-host pypi.org \
--trusted-host files.pythonhosted.org
For Jupyter Notebook users, the syntax is the same:
%pip install --group ds petsard \
--trusted-host pypi.org \
--trusted-host files.pythonhosted.org
Understanding --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
# Install with pyproject.toml (recommended)
pip install --group all -e .
# Or install specific dependency groups
pip install --group ds -e . # Data science features
pip install --group dev -e . # Development tools
Method 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
# Install with pyproject.toml (recommended)
pip install --group all -e .
# Or install specific dependency groups
pip install --group ds -e . # Data science features
pip install --group dev -e . # Development tools
Windows 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
Next Steps
After installation, you can:
- Check the Getting Started guide for detailed examples
- Visit the PETsARD YAML documentation to learn about configuration
- Explore benchmark datasets for testing
- Review example configurations in the GitHub repository