skillfed

py-machineid

Get the unique machine ID of any host (without admin privileges)

py-machineid v1.0.0 851.8K downloads/30d#4,902 on PyPI98
Permissive license MIT AGING released

What it is and what it does

py-machineid is a lightweight Python library that retrieves a unique identifier for the host machine without requiring administrator privileges. It provides two main functions: id() returns the raw machine GUID, and hashed_id() returns a cryptographic hash of that identifier, optionally scoped to a specific application. On Windows, the library can query the registry to construct the identifier; this behavior can be disabled via a kwarg for security-conscious deployments.

The package is typically used for device licensing, telemetry, or machine fingerprinting in applications that need to identify or track individual hosts. It has one runtime dependency (winregistry) and installs as a pure Python wheel with low friction. The maintenance status is aging—the last commit was 2025-12-02—so updates and bug fixes may come slowly, but the repository remains active and has not been archived.

Use it for:

  • Implement per-device licensing checks in software distribution systems to bind licenses to specific machines.
  • Generate stable, anonymized device identifiers for telemetry or analytics without exposing raw hardware details.
  • Build machine fingerprinting for security audits or compliance logging without requiring elevated privileges.
  • Scope application-specific identifiers to ensure the same device gets a unique ID per application.
  • Disable registry queries on Windows to prevent machine fingerprints from being manually modified by users.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Retrieves the unique machine ID of a host without requiring admin privileges, with options for raw GUID or hashed anonymized identifiers.

Yes, if you need a simple, low-friction way to retrieve machine identifiers for licensing or telemetry. The MIT license is permissive, install friction is minimal, and there are no known vulnerabilities. However, aging maintenance means you should verify that the library's behavior on your target platforms matches your security and accuracy requirements before relying on it in production.

Install

py-machineid on PyPI

pip

pip install py-machineid

uv

uv add py-machineid

poetry

poetry add py-machineid

Installing py-machineid

Before you install

Low install friction with a single runtime dependency (winregistry). Maintenance status is aging—last commit was 2025-12-02—so expect slower response to issues, though the repository remains active and not archived.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

pip install py-machineid

import machineid

print(machineid.id())
print(machineid.hashed_id('myappid'))

Verify before relying

  • Exact behavior and platform coverage across Windows, macOS, and Linux—documentation does not specify which platforms are supported or how fallback logic works.
  • Whether the hashed_id() function is cryptographically suitable for security-sensitive use cases or licensing enforcement.
  • Performance characteristics and any potential side effects of querying Windows registry when winregistry=True.

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — winregistry
Maintenance aging — 255 days since the last release
Last repo commit
First released
Downloads 851,778/month — #4,902 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: py_machineid-1.0.0-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

machine id detectionunique device identifierhardware fingerprintsystem uuid retrievaldevice identificationmachine guid lookuphost identifier
device-identificationlicensing

More Utilities packages