SDKs
Python SDK

Python Hardware (Device) IDs

6min
this library provides preconfigured hardware identity providers hardwareidprovider (default) platformidprovider hardwareidprovidersource (recommended) you can set the desired hardware identity provider when initializing the apiclient from licensespring hardware import platformidprovider api client = apiclient(api key=" your api key ", shared key=" your shared key ", hardware id provider=platformidprovider) it also supports their customization and creation of your own hardware id provider on the next major version release hardwareidprovidersource will be set as the default hardware id provider hardwareidprovider uses uuid getnode() https //docs python org/3/library/uuid html#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 class hardwareidprovider def get id(self) return str(uuid getnode()) def get os ver(self) return platform platform() def get hostname(self) return platform node() def get ip(self) return socket gethostbyname(self get hostname()) def get is vm(self) return false def get vm info(self) return none def get mac address(self) return " " join(("%012x" % uuid getnode())\[i i + 2] for i in range(0, 12, 2)) def get request id(self) return str(uuid uuid4()) hardwareidprovidersource utilizes a proprietary in house algorithm for our sdks class hardwareidprovidersource(hardwareidprovider) def get id(self) hardware id = get hardware id(hardwareidalgorithm default) if logging getlogger() hashandlers() logs = get logs() version = get version() logging info("version ",version) logging info("hardware id ",hardware id) for log line in logs logging info(log line) return hardware id customization extend any of the preconfigured hardware identity providers, overwrite the methods you want and provide it when initializing the apiclient class customhardwareidprovider(hardwareidprovider) def get id(self) return " my id " api client = apiclient(api key=" your api key ", shared key=" your shared key ", hardware id provider=customhardwareidprovider) class customhardwareidprovider(hardwareidprovider) def get id(self) return " my id " api client = apiclient(api key=" your api key ", shared key=" your shared key ", hardware id provider=customhardwareidprovider)