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

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.0.tar.gz (4.3 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.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: py-machineid-0.5.0.tar.gz
  • Upload date:
  • Size: 4.3 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.0.tar.gz
Algorithm Hash digest
SHA256 6fdced17d77262364a2d25ca0dcc7a11ffa48fbe8621ce186f537da46c258b84
MD5 9da8ec65aae56003a1b54c98318d03d7
BLAKE2b-256 0f4c7c2a245fc9c87d25cfe46084f20708801c700e86e4ce224b1e2b60edb1ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: py_machineid-0.5.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19d40e8e0cc6fc303c517edd99254e52ea126618fb807f4c418b75b41d68fa8b
MD5 172fd2f396b8d3cf3389ecb449615cf4
BLAKE2b-256 f3002b805edaac8d314f05688b0a20c5569140719897c151340f8c920ab76500

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