Skip to main content

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

Project description

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-machineid-0.5.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_machineid-0.5.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file py-machineid-0.5.1.tar.gz.

File metadata

  • Download URL: py-machineid-0.5.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for py-machineid-0.5.1.tar.gz
Algorithm Hash digest
SHA256 235c485eccd2cd87aa0baad3085ea29f6e2e97933afb15ac7faa0b638fa4b274
MD5 b02367f6956da81b669a49463f266c6b
BLAKE2b-256 41326041361e6c1ebb92ec41352b38fb69d6964a6020e4a7539612493c875a7e

See more details on using hashes here.

File details

Details for the file py_machineid-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: py_machineid-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for py_machineid-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1eed7e7b2cfcf906dbc74d481dd664c26d0e73992f724aa2272c78d96b26c88
MD5 cc70bf0567e38d167a261ebfd3e34797
BLAKE2b-256 4457091f3baf06ab1e240ca4d863fe94a9dba39ec8faa49d4cae7e2ac68eeef5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page