py-deviceid
A simple library to get or create a unique device id for a device in Python.
What it is and what it does
py-deviceid is a lightweight Python library that generates a unique identifier for a device based on the DevDeviceId specification. It exposes a single function, get_device_id(), that returns a string representing the device. The package has no runtime dependencies and supports Python 3.8 through 3.12, making it easy to integrate into existing projects.
The library is intended for scenarios where you need a machine-specific identifier—such as device tracking, licensing, telemetry, or system inventory. Because it is in Alpha status and has not been actively updated since its initial release, it should be evaluated carefully for production use, particularly if you need guarantees about identifier stability or cross-platform consistency.
Use it for:
- Tracking or identifying individual machines in a fleet or telemetry system.
- Generating unique device identifiers for software licensing or activation workflows.
- Correlating logs or events to specific hardware in a multi-machine environment.
- Creating device fingerprints for security or fraud-detection systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates or retrieves a unique device identifier for a system based on the DevDeviceId specification, returning a string that can be used to identify individual machines.
Yes, if you need a simple device identifier and can verify that the DevDeviceId specification meets your stability and cross-platform requirements. The zero-dependency design and MIT license make it low-risk to try. However, the Alpha status and lack of recent updates mean you should test thoroughly in your target environment before relying on it in production.
Install
py-deviceid on PyPI
pip
pip install py-deviceiduv
uv add py-deviceidpoetry
poetry add py-deviceidInstalling py-deviceid
Before you install
No runtime dependencies and a pure-Python wheel distribution mean installation is straightforward. However, the package is in Alpha status and has not been updated since March 2025, suggesting limited active maintenance.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—you may use this in commercial or proprietary projects as long as you include the license notice.
Quickstart
pip install py-deviceid
from deviceid import get_device_id
device_id = get_device_id()
print(f'Device ID is: {device_id}')
Verify before relying
- What system properties does the DevDeviceId specification use to generate the device ID?
- Whether the device ID is stable across reboots and system updates.
- Cross-platform behavior: does it work identically on Windows, macOS, and Linux?
- Whether the implementation handles virtual machines or containers differently than physical hardware.
Package facts
| License | py-deviceid Copyright (c) Microsoft Corporation. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 525 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,986,680/month — #2,186 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: py_deviceid-0.1.1-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
python-ulidGenerates and manipulates ULIDs (universally…
permissive · top 5,000 on PyPI
py-machineidRetrieves the unique machine ID of a host…
permissive · top 5,000 on PyPI
ulid-pyGenerates and parses ULIDs (Universally Unique…
permissive · top 5,000 on PyPI
uuidProvides UUID object creation and RFC…
unclear · top 5,000 on PyPI
ulidGenerates ULIDs (Universally Unique…
permissive · top 15,000 on PyPI
cuidGenerates fast, sequentially-ordered unique…
permissive · top 5,000 on PyPI
uuid-v7Generates UUID v7 and v6 identifiers, extending…
unclear · top 15,000 on PyPI
qcodesQCoDeS is a Python data acquisition and control…
permissive · top 15,000 on PyPI
ksuidGenerates sortable unique identifiers (KSUIDs)…
permissive · top 15,000 on PyPI
textfsmTextFSM parses semi-structured text (like CLI…
permissive · top 5,000 on PyPI