Skip to main content

Extract the `hwid` on Windows, Linux, Mac. Cross-platform using Python, native OS detection.

Project description

hwid

CI Coverage PyPI - Version PyPI - Python Version License Latest Commit

Downloads Downloads/Month Downloads/Week

Extract the hwid on Windows, Linux, Mac. Cross-platform using Python, native OS detection.


Table of Contents

Installation

pip install hwid

Usage

As a Module

import hwid
print(hwid.get_hwid())

As a CLI Tool

uvx hwid

Motivation

TL;DR I don't want to copy and paste it again...

I have created a bunch of desktop applications for Windows. I needed a way to license my applications for my users to use it without distributing to other people. I decided to use the hwid of the computer to license my applications. I needed a way to get the hwid of the computer, so I created this module. It has only one purpose: getting the hwid of the computer. It is cross-platform and does not require any external dependencies.

Features

  • Cross-platform
  • No external dependencies
  • CLI
  • Module

Warning

I do not recommend using this module for licensing purposes all alone. You can use it as a part of your licensing system.

If you are using server-client architecture, you can send the encrypted hwid to the server and check if it is valid. But keep in mind, It's easy to intercept the http requests with mitmproxy or other tools.

If you are using a local licensing system, you can encrypt the hwid and store it in a file. Then you can check if the encrypted hwid is valid. You can use pyarmor to obfuscate your code. It will make it harder to reverse engineer your code. Here is a NeuralNine Tutorial using Oxyry

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.

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

docs:serve

Serve the documentation locally:

uvx --with-requirements requirements.docs.txt mkdocs serve

docs:build

Build the documentation locally:

uvx --with-requirements requirements.docs.txt mkdocs build

Author

Disclaimer

This module is not intended to be used for malicious purposes. The author is not responsible for any damage caused by this module. Use at your own risk.

License

hwid 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

hwid-0.2.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

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

hwid-0.2.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file hwid-0.2.0.tar.gz.

File metadata

  • Download URL: hwid-0.2.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hwid-0.2.0.tar.gz
Algorithm Hash digest
SHA256 462ac889a0ee302d7c2d3edf50f681c2b868e752c789fb0ee35cb357ccda0d2d
MD5 ed44f685dcbdae34428ab7e81e4902fe
BLAKE2b-256 d8099db868e4f96fb07566c9fd6003a31501ef340602b4a21bc45978685d63b2

See more details on using hashes here.

File details

Details for the file hwid-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: hwid-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hwid-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 582721662e1bf6e8dc308b854c405333022b4715623a2a1c5d6840b058fdf40b
MD5 b212abf61eff24084ef49966cb69f005
BLAKE2b-256 7597c1fced8e49a816e8ba57695c9e978235198fa26aed36633f0b74d3dda49c

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