Skip to content

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

License

Notifications You must be signed in to change notification settings

deajan/py-machineid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-machineid

CI PyPI version

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

Sponsored by:

Keygen

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

Thanks

Special thanks to Denis Brodbeck for his Go package, machineid.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%