Authenticate ​
The authentication is required for most methods of the Hectiq Lab package.
Using the command line interface ​
The command line interface is the easiest way to authenticate. You can use the following command to authenticate:
hectiq-lab authenticate
Parameter | Description |
---|---|
--generate | Generate an API key without storing it in the credentials file. |
When using the --generate
flag, the API key is displayed in the terminal. You can copy it and use it in your code. The API key is not stored in the credentials file.
You'll be asked for your username and password. It will then store an API key in your home directory.
The API keys are associated to your account and can be used to authenticate the package. You can use the same API key for multiple projects.
Once the API key is stored, you can use the package without having to authenticate again. The routes are authenticated using expiring access tokens. The API key is used to generate these tokens. When using the package, the tokens are automatically refreshed.
Storage of the API Key ​
The API key is automatically stored in your home directory at ~/.hectiq-lab/credentials.toml
. If you need to modify the default location, you can set the HECTIQLAB_CREDENTIALS
environment variable to the desired location.
When using the package, you can also set the HECTIQLAB_API_KEY
environment variable to the API key. This will override the stored API key.