Metadata-Version: 2.4
Name: driverManagementPro
Version: 1.0.3
Summary: Smart WebDriver management library with automatic caching
Home-page: https://github.com/yourusername/driverManagementPro
Author: QA Team
Author-email: qa@example.com
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: selenium>=4.0.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov>=2.10; extra == "dev"
Requires-Dist: black>=21.0; extra == "dev"
Requires-Dist: flake8>=3.9; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# driverManagementPro

![Python](https://img.shields.io/badge/python-3.8+-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)

**Smart WebDriver management library with automatic caching** - No rate limiting, no re-downloads!

## 🎯 Why driverManagementPro?

### Problem
- Running tests on 100+ systems simultaneously causes GitHub API rate limiting
- Downloading drivers repeatedly wastes bandwidth and time
- WebDriver Manager API gets exhausted quickly

### Solution
- ✅ **Smart Caching** - Download once, use everywhere
- ✅ **Automatic** - Downloads only on first run
- ✅ **No Rate Limiting** - Never hits GitHub API again
- ✅ **Lightweight** - Pure Python, minimal dependencies
- ✅ **Easy to Use** - One-liner driver setup

## 📦 Installation

### From PyPI (Recommended)
```bash
pip install driverManagementPro
```

### From Source
```bash
git clone https://github.com/yourusername/driverManagementPro.git
cd driverManagementPro
pip install -e .
```

## 🚀 Quick Start

### Basic Usage

```python
from driverManagementPro import DriverManager

# Initialize manager
manager = DriverManager()

# Get Chrome driver (auto-downloads if needed)
driver = manager.get_chrome_driver()
driver.get("https://www.google.com")
driver.quit()
```

### Firefox Driver
```python
driver = manager.get_firefox_driver()
driver.get("https://www.google.com")
driver.quit()
```

### Edge Driver
```python
driver = manager.get_edge_driver()
driver.get("https://www.google.com")
driver.quit()
```

### Custom Cache Directory
```python
manager = DriverManager(cache_dir="C:\\custom\\driver\\path")
driver = manager.get_chrome_driver()
```

### Custom Driver Versions
```python
# Specific Chrome version
driver = manager.get_chrome_driver(version="122.0.0.0")

# Specific Firefox version
driver = manager.get_firefox_driver(version="v0.33.2")

# Specific Edge version
driver = manager.get_edge_driver(version="122.0.0.0")
```

### Custom Chrome Options
```python
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("--headless")
options.add_argument("--no-sandbox")

driver = manager.get_chrome_driver(options=options)
```

## 📁 Cache Structure

Drivers are cached in user home directory:

```
~/driverManagementPro/
├── chrome/
│   ├── 123.0.0.0/
│   │   └── chromedriver.exe
│   └── 124.0.0.0/
│       └── chromedriver.exe
├── firefox/
│   ├── v0.33.3/
│   │   └── geckodriver.exe
│   └── v0.33.2/
│       └── geckodriver.exe
└── edge/
    ├── 123.0.0.0/
    │   └── msedgedriver.exe
    └── 124.0.0.0/
        └── msedgedriver.exe
```

## 🔧 Advanced Usage

### Check Cache Status
```python
manager = DriverManager()

# List all cached drivers
cached = manager.list_cached_drivers()
print(cached)
# Output: {'chrome': ['123.0.0.0', '124.0.0.0'], 'firefox': ['v0.33.3']}

# Health check
if manager.health_check():
    print("✅ Cache directory is accessible")
else:
    print("❌ Cache directory issue")
```

### Clear Cache
```python
manager = DriverManager()

# Clear all drivers
manager.clear_cache()

# Clear all Chrome drivers
manager.clear_cache("chrome")

# Clear specific version
manager.clear_cache("chrome", "123.0.0.0")
```

### Debug Mode
```python
manager = DriverManager(debug=True)
driver = manager.get_chrome_driver()  # Verbose logging
```

## 🏢 Use Cases

### Single System (Local Development)
```python
from driverManagementPro import DriverManager

manager = DriverManager()
driver = manager.get_chrome_driver()
# Drivers cached locally - subsequent runs are instant
```

### Multiple Systems (QA Teams)
```python
# System 1: Downloads driver once
manager = DriverManager()
driver = manager.get_chrome_driver()

# System 2-100: Use cached drivers instantly
# No GitHub API calls, no rate limiting!
```

### CI/CD Pipelines
```python
# Jenkins, GitHub Actions, Azure Pipelines
import os
from driverManagementPro import DriverManager

# Optional: use custom cache directory
cache_path = os.getenv("DRIVER_CACHE", None)
manager = DriverManager(cache_dir=cache_path)

driver = manager.get_chrome_driver()
# Run your tests...
driver.quit()
```

### Packaged Applications (EXE)
```python
# Your Python application packaged as EXE
# Drivers are cached on first run
# Subsequent runs use cached drivers

from driverManagementPro import DriverManager

manager = DriverManager()
driver = manager.get_chrome_driver()
# Works perfectly when distributed to clients!
```

## 📊 Performance Comparison

| Scenario | Without Cache | With driverManagementPro |
|----------|---------------|------------------------|
| **First Run** | 30-60 sec | 30-60 sec (download) |
| **2nd-100th Run** | 30-60 sec each | < 1 sec each |
| **100 systems, 1st time** | ❌ Rate Limited | ✅ Works fine |
| **Bandwidth** | 500 MB total | 5 MB (one download) |

## 🔐 Security

- **No credentials stored** in code
- **No hardcoded tokens** needed
- **Local cache only** - drivers never exposed
- **HTTPS downloads** from official sources

## 🐛 Troubleshooting

### Issue: "Failed to get ChromeDriver"

**Solution 1: Check connectivity**
```python
manager = DriverManager(debug=True)
manager.health_check()
```

**Solution 2: Clear cache and retry**
```python
manager.clear_cache("chrome", "123.0.0.0")
driver = manager.get_chrome_driver(version="123.0.0.0")
```

**Solution 3: Use different version**
```python
# Try a different version
driver = manager.get_chrome_driver(version="122.0.0.0")
```

### Issue: Permission denied (Linux/Mac)

**Solution:**
```bash
chmod +x ~/driverManagementPro/*/chromedriver
chmod +x ~/driverManagementPro/*/geckodriver
```

### Issue: Cache directory not accessible

**Solution:**
```python
# Use custom writable directory
manager = DriverManager(cache_dir="/tmp/drivers")
```

## 🧪 Testing

```bash
# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# With coverage
pytest --cov=driverManagementPro
```

## 📝 License

MIT License - See LICENSE file for details

## 🤝 Contributing

Contributions welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Submit a pull request

## 📞 Support

- 📧 Email: qa@example.com
- 🐛 Issues: https://github.com/yourusername/driverManagementPro/issues
- 📖 Documentation: https://github.com/yourusername/driverManagementPro/wiki

---

**Made with ❤️ for QA Teams**
