# Installation Guide

## Requirements

- Python 3.8 or higher
- pip package manager

## Install from PyPI

```bash
pip install precipgen
```

## Install from Source

```bash
git clone https://github.com/your-org/precipgen.git
cd precipgen
pip install -e .
```

## Development Installation

```bash
git clone https://github.com/your-org/precipgen.git
cd precipgen
pip install -e ".[dev]"
```

This installs additional development dependencies for testing and documentation.

## Verify Installation

```python
import precipgen
print(precipgen.__version__)

# Quick test
from precipgen import quick_analysis
print("PrecipGen installed successfully!")
```

## Dependencies

Core dependencies are automatically installed:

- **numpy** - Numerical computations
- **pandas** - Data manipulation  
- **scipy** - Statistical functions
- **matplotlib** - Visualization
- **requests** - Data download

## Optional Dependencies

For enhanced functionality:

```bash
# For Jupyter notebook examples
pip install jupyter

# For advanced plotting
pip install seaborn

# For parallel processing
pip install joblib
```

## System Requirements

- **Memory**: 1GB+ RAM recommended for large datasets
- **Storage**: 100MB+ for GHCN station data cache
- **Network**: Internet access for automatic data download

## Troubleshooting

### Import Errors

If you encounter import errors:

```bash
pip install --upgrade precipgen
```

### Network Issues

For offline usage, pre-download station data:

```python
from precipgen.data import GHCNDownloader
downloader = GHCNDownloader()
downloader.download_station("USW00024233")  # Seattle
```

### Permission Errors

On some systems, use user installation:

```bash
pip install --user precipgen
```

## Platform Notes

### Windows
No special requirements. Works with standard Python installation.

### macOS  
No special requirements. Works with Homebrew Python or system Python.

### Linux
Ensure development headers are installed:

```bash
# Ubuntu/Debian
sudo apt-get install python3-dev

# CentOS/RHEL
sudo yum install python3-devel
```

## Docker

For containerized usage:

```dockerfile
FROM python:3.9-slim

RUN pip install precipgen

WORKDIR /app
COPY . .

CMD ["python", "your_script.py"]
```

## Next Steps

After installation, see the [User Guide](user_guide.md) for usage examples.