Get the unique machine ID of any host (without admin privileges)
Project description
py-machineid
Get the unique machine ID of any host (without admin privileges).
Sponsored by:
An open, source-available software licensing and distribution API.
Install
Install using pip
:
python3 -m pip install py-machineid
Usage
To obtain the raw GUID of the device, use id() -> str
:
import machineid
print(machineid.id())
To obtain an anonymized (hashed) version of the GUID, see below. The
hashed_id(str) -> str
function takes an optional application ID,
which will ensure a unique ID per-app for the same device.
import machineid
print(machineid.hashed_id('myappid'))
print(machineid.hashed_id())
Both id()
and hashed_id()
accept a winregistry: bool
kwarg,
which can be used to disable the registry query on Windows (enabled
by default). Depending on your security posture, disabling the
registry query may help prevent machine fingerprints from
being manually modified by a bad actor.
Testing
To run tests, invoke unittest
:
python3 -m unittest
Building
To build a release, run:
python3 setup.py sdist bdist_wheel
Publishing
To publish a release, run:
twine upload dist/*
Thanks
Special thanks to Denis Brodbeck for his Go package, machineid
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file py-machineid-0.6.0.tar.gz
.
File metadata
- Download URL: py-machineid-0.6.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00c38d8521d429a4539bdd92967234db28a1a2b4b263062b351ca002332e633f |
|
MD5 | 89b06228978a1533ba1d2bd23a14330a |
|
BLAKE2b-256 | 14ca10f1afc01f0648207b3648af16ebf913bb6401de9b7efc945e2489d7ce37 |
File details
Details for the file py_machineid-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: py_machineid-0.6.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63214f8a98737311716b29d279716dc121a6495f16486caf5c032433f81cdfd6 |
|
MD5 | e0fd5a7b09eb4d555f04d9222e34547a |
|
BLAKE2b-256 | cb541f146aed749192d1638fc6878dee444189e8873861e340f8a3ffe15b16f3 |