A comprehensive tool to detect web browser versions on Windows systems
Project description
BrowseVersa
A comprehensive Python package to programmatically detect web browser versions on Windows systems. This tool provides native Windows detection without requiring Selenium or WebDrivers, making it perfect for automation scripts, system administration, and CI/CD pipelines on Windows environments.
Features
- 🔍 Multi-Browser Support: Detect Chrome, Firefox, Edge, and Internet Explorer versions
- 🖥️ Windows Optimized: Specifically designed for Windows systems
- 🏢 Enterprise Ready: Enhanced support for Windows Server 2019/2022 and enterprise deployments
- 🛠️ Multiple Detection Methods: Registry queries, executable commands, and folder-based detection
- 📝 Robust Error Handling: Comprehensive fallback mechanisms and logging
- 🚀 Zero Dependencies: Uses only Python standard library
- 💻 CLI Interface: Command-line tool for automation and scripting
- 📦 Easy Integration: Simple API for use in Python applications
Supported Browsers
| Browser | Windows | Notes |
|---|---|---|
| Google Chrome | ✅ | Includes Chromium |
| Mozilla Firefox | ✅ | Includes Firefox ESR |
| Microsoft Edge | ✅ | Includes Beta/Dev/Enterprise |
| Internet Explorer | ✅ | Windows only, deprecated |
Supported Platforms
- Windows: 7, 8, 10, 11, Server 2019/2022
Note: This package is designed specifically for Windows systems and will not work on macOS or Linux.
Installation
From PyPI (Recommended)
pip install browseversa
From Source
git clone https://github.com/pandiyarajk/browseversa.git
cd browseversa
pip install -e .
Quick Start
Command Line Usage
# Detect all browsers
browseversa
# Detect specific browser
browseversa --browser chrome
# Get version only (for scripting)
browseversa --browser firefox --version-only
# Check script version
browseversa --script-version
# Enable verbose logging
browseversa --browser all --verbose
Python API Usage
from browseversa import BrowserVersionDetector
# Create detector instance
detector = BrowserVersionDetector()
# Detect specific browser
chrome_version = detector.detect_chrome_version()
print(f"Chrome version: {chrome_version}")
# Detect all browsers
all_browsers = detector.detect_all_browsers()
for browser, info in all_browsers.items():
if browser != 'platform':
status = info['version'] if info['detected'] else 'Not found'
print(f"{browser}: {status}")
Convenience Functions
from browseversa import (
get_chrome_version,
get_firefox_version,
get_edge_version,
get_ie_version,
get_all_browser_versions
)
# Quick version checks
chrome_ver = get_chrome_version()
firefox_ver = get_firefox_version()
edge_ver = get_edge_version()
ie_ver = get_ie_version()
# Get all versions at once
all_versions = get_all_browser_versions()
Output Examples
Standard Output
Browser Version Detection Results:
========================================
✓ Chrome: 120.0.6099.109
✓ Firefox: 120.0
✗ Edge: Not found
✗ Ie: Not found
Platform: win32
Version-Only Output (for scripting)
chrome: 120.0.6099.109
firefox: 120.0
edge: Not found
ie: Not found
API Reference
BrowserVersionDetector Class
The main class for browser version detection.
Methods
detect_chrome_version()→Optional[str]detect_firefox_version()→Optional[str]detect_edge_version()→Optional[str]detect_ie_version()→Optional[str]detect_all_browsers()→Dict[str, Any]
Example
detector = BrowserVersionDetector()
# Individual browser detection
chrome_ver = detector.detect_chrome_version()
if chrome_ver:
print(f"Chrome {chrome_ver} detected")
else:
print("Chrome not found")
# All browsers detection
results = detector.detect_all_browsers()
print(f"Platform: {results['platform']}")
for browser, info in results.items():
if browser != 'platform':
print(f"{browser}: {info['version'] if info['detected'] else 'Not found'}")
Convenience Functions
get_chrome_version()→Optional[str]get_firefox_version()→Optional[str]get_edge_version()→Optional[str]get_ie_version()→Optional[str]get_all_browser_versions()→Dict[str, Any]
Use Cases
System Administration
# Check browser versions across multiple systems
from browseversa import get_all_browser_versions
def check_system_browsers():
browsers = get_all_browser_versions()
detected = [b for b, info in browsers.items()
if b != 'platform' and info['detected']]
return detected
CI/CD Pipelines
# Check if required browser is available
if browseversa --browser chrome --version-only | grep -q "Not found"; then
echo "Chrome not found, installing..."
# Install Chrome
fi
Automation Scripts
# Ensure compatible browser versions
from browseversa import get_chrome_version
def check_chrome_compatibility():
version = get_chrome_version()
if not version:
raise RuntimeError("Chrome not installed")
major_version = int(version.split('.')[0])
if major_version < 90:
raise RuntimeError(f"Chrome version {version} is too old. Need 90+")
return version
Development
Setup Development Environment
git clone https://github.com/pandiyarajk/browseversa.git
cd browseversa
pip install -e ".[dev]"
Running Tests
pytest
Code Formatting
black browseversa.py
flake8 browseversa.py
mypy browseversa.py
Building Package
python -m build
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Pandiyaraj Karuppasamy - pandiyarajk@live.com
Acknowledgments
- Thanks to the Python community for excellent tooling
- Inspired by the need for reliable browser version detection in automation workflows
- Built with enterprise environments in mind
Changelog
See CHANGELOG.md for a detailed history of changes.
Support
- 📧 Email: pandiyarajk@live.com
- 🐛 Issues: GitHub Issues
- 📖 Documentation: GitHub README
Note: Internet Explorer has been deprecated by Microsoft and may not be available on newer Windows versions. This tool includes IE detection for legacy system support.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file browseversa-1.0.0.tar.gz.
File metadata
- Download URL: browseversa-1.0.0.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efae476a76be4717076024c678bf156c06f4daba8eb8445055b74220cad7e439
|
|
| MD5 |
93087a88046f063140ee5d28b158b8c3
|
|
| BLAKE2b-256 |
2bef27930fde0d28e21227027c1bb790b5c7c156e9baee3782abcff456276917
|
File details
Details for the file browseversa-1.0.0-py3-none-any.whl.
File metadata
- Download URL: browseversa-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ef8b16b65c17ed2577981202932bb20aa454701658880d627247bd85019f801
|
|
| MD5 |
e1706618cbf263613211e33dd0dd2312
|
|
| BLAKE2b-256 |
ea021c26b944e20672668c2bfafa15799fe43ae023c7be61a048de8d08aa93cd
|