Skip to main content

Detect the version of Chrome installed on Windows, Linux, Mac. Cross-platform using Python, native OS detection.

Project description

Chrome Version

Coverage PyPI - Version PyPI - Python Version License Latest Commit

Downloads Downloads/Month Downloads/Week

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

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

chrome_version-0.4.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chrome_version-0.4.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

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

Hashes for chrome_version-0.4.0.tar.gz
Algorithm Hash digest
SHA256 885738d0fff7f085aa832838eb2f127001621cb987592c5a1ee9ec1729e9f4f1
MD5 839dd7aba36fc425ec8d7d58f3834b7c
BLAKE2b-256 fbcab5c27e24c98e5e055e7d241b47b73dd53f88012534ff048c9139cea6e591

See more details on using hashes here.

File details

Details for the file chrome_version-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chrome_version-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fdd6071e2412c420e18c8985a148a626a69fe96e4e523efcf4b8769a3ab0878
MD5 53deebeaf4117fbd466ba59013451d55
BLAKE2b-256 9705e7157a25fe18d195b0d194da076056bcd81f125dd23b1cac6b65e7286852

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page