https://github.com/keygen-sh/example-python-machine-activation
An example implementation of a node-locked license activation flow using Keygen and Python
https://github.com/keygen-sh/example-python-machine-activation
code-sample license-activation license-keys platform-example software-licensing
Last synced: 3 months ago
JSON representation
An example implementation of a node-locked license activation flow using Keygen and Python
- Host: GitHub
- URL: https://github.com/keygen-sh/example-python-machine-activation
- Owner: keygen-sh
- License: mit
- Created: 2018-06-13T02:52:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-21T14:47:03.000Z (almost 2 years ago)
- Last Synced: 2025-07-05T17:33:38.383Z (3 months ago)
- Topics: code-sample, license-activation, license-keys, platform-example, software-licensing
- Language: Python
- Homepage: https://keygen.sh
- Size: 9.77 KB
- Stars: 23
- Watchers: 3
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example Machine Activation
This is an example of a typical machine activation flow written in Python.
You may of course choose to implement a different flow if required - this
only serves as an example implementation.## Running the example
First up, configure a few environment variables:
```bash
# Your Keygen account ID. Find yours at https://app.keygen.sh/settings.
export KEYGEN_ACCOUNT_ID="YOUR_KEYGEN_ACCOUNT_ID"
```You can either run each line above within your terminal session before
starting the app, or you can add the above contents to your `~/.bashrc`
file and then run `source ~/.bashrc` after saving the file.Next, install dependencies with [`pip`](https://packaging.python.org/):
```
python3 -m pip install -r requirements.txt
```## Activating a machine
To perform a machine activation, run the script and supply a license key:
```
python3 main.py some-license-key-here
```The script will use a SHA256-HMAC of your device's [machineid](https://github.com/keygen-sh/py-machineid)
for the machine's fingerprint.## Questions?
Reach out at [support@keygen.sh](mailto:support@keygen.sh) if you have any
questions or concerns!