py-machineid
Get the unique machine ID of any host (without admin privileges)
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-machineiduv
uv add py-machineidpoetry
poetry add py-machineidInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
cuid2Generates collision-resistant,…
permissive · top 15,000 on PyPI
uuidProvides UUID object creation and RFC…
unclear · top 5,000 on PyPI
py-deviceidGenerates or retrieves a unique device…
permissive · top 5,000 on PyPI
django-guidAttaches a unique correlation ID to all logs…
permissive · top 15,000 on PyPI
elevateElevate re-launches the current Python process…
permissive · top 15,000 on PyPI
nanoidGenerates cryptographically secure,…
permissive · top 5,000 on PyPI
ulid-pyGenerates and parses ULIDs (Universally Unique…
permissive · top 5,000 on PyPI
uuid-v7Generates UUID v7 and v6 identifiers, extending…
unclear · top 15,000 on PyPI
ulidGenerates ULIDs (Universally Unique…
permissive · top 15,000 on PyPI
typeid-pythonGenerates and parses TypeIDs—type-safe,…
permissive · top 15,000 on PyPI