Python Hardware (Device) IDs
This library provides preconfigured hardware identity providers:
- HardwareIdProvider (default)
- PlatformIdProvider
You can set the desired hardware identity provider when initializing the APIClient:
It also supports their customization and creation of your own hardware id provider.
Uses uuid.getnode() to generate unique ID per device as described:
Get the hardware address as a 48-bit positive integer. The first time this runs, it may launch a separate program, which could be quite slow. If all attempts to obtain the hardware address fail, we choose a random 48-bit number with the multicast bit (least significant bit of the first octet) set to 1 as recommended in RFC 4122. “Hardware address” means the MAC address of a network interface. On a machine with multiple network interfaces, universally administered MAC addresses (i.e. where the second least significant bit of the first octet is unset) will be preferred over locally administered MAC addresses, but with no other ordering guarantees.
All of the methods exposed by HardwareIdProvider:
Uses sys.platform and OS queries to find the raw GUID of the device.
Extends the HardwareIdProvider and overwrites only the get_id method:
Extend any of the preconfigured hardware identity providers, overwrite the methods you want and provide it when initializing the APIClient: