Detect the version of Chrome installed on Windows, Linux, Mac. Cross-platform using Python, native OS detection.
Project description
Chrome Version
Get the version of Chrome installed on Windows, Linux, Mac. Cross-platform using Python, native OS detection, does not require Selenium.
Table of Contents
Installation
uv add chrome-version
Usage
Module:
import chrome_version
print(chrome_version.get_chrome_version())
# '103.0.5060.114'
CLI:
chrome-version
103.0.5060.114
Motivation
TL;DR I don't want to copy and paste it again...
At first,
I needed to get the Chrome version for a project I was working on, which was using Undetected Chromedriver. I found this gist.
After using it in several projects, I decided to turn it into a module so I'll be free of copy/paste. It only have one functionality: getting the chrome version.
Then,
I decided to use this package to learn more about:
- Using Poetry for packaging and dependency management.
- Using scripts for CLI.
- Versioning.
- License management.
- Documentation.
- Publishing a module on PyPI.
- Using GitHub Actions to automate the publishing process.
- ...
Finally,
Now it's kind of a playground for me to learn more...
One other thing is that it's educational: A simple module is a good practice for me to learn how to build modules and publish them on PyPI and show others how easy it is.
Features
- Cross-platform
- No external dependencies
- CLI
- Module
Development
Clone the repository and cd into the project directory:
git clone https://github.com/hasansezertasan/hwid
cd hwid
The commands below can also be executed using the xc task runner, which combines the usage instructions with the actual commands. Simply run xc, it will popup an interactive menu with all available tasks.
pre-commit
Run the pre-commit hooks:
uvx pre-commit run --all-files --hook-stage manual --show-diff-on-failure
checks
Run all checks to ensure code quality:
uvx "validate-pyproject[all]" pyproject.toml
uvx typos
uvx vulture src
uvx ruff check
uvx taplo lint pyproject.toml
uvx ruff format
uvx taplo format pyproject.toml
uvx mypy src
uvx mypy --install-types --non-interactive src/chrome_version
docs:serve
Serve the documentation locally:
uvx --with-requirements requirements.docs.txt --reinstall mkdocs serve
docs:build
Build the documentation locally:
uvx --with-requirements requirements.docs.txt --reinstall mkdocs build
Author
- Hasan Sezer Taşan, It's me :wave:
- Kory Becker, owner of the original script.
Disclaimer
Based on chrome-version-gist by Kory Becker.
This package provides a CLI wrapper for the original project. All credit reserved to the author of the original code.
License
chrome-version is distributed under the terms of the MIT license.
Project details
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 chrome_version-0.4.0.tar.gz.
File metadata
- Download URL: chrome_version-0.4.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
885738d0fff7f085aa832838eb2f127001621cb987592c5a1ee9ec1729e9f4f1
|
|
| MD5 |
839dd7aba36fc425ec8d7d58f3834b7c
|
|
| BLAKE2b-256 |
fbcab5c27e24c98e5e055e7d241b47b73dd53f88012534ff048c9139cea6e591
|
File details
Details for the file chrome_version-0.4.0-py3-none-any.whl.
File metadata
- Download URL: chrome_version-0.4.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fdd6071e2412c420e18c8985a148a626a69fe96e4e523efcf4b8769a3ab0878
|
|
| MD5 |
53deebeaf4117fbd466ba59013451d55
|
|
| BLAKE2b-256 |
9705e7157a25fe18d195b0d194da076056bcd81f125dd23b1cac6b65e7286852
|