by: Kevin Broløs & Tom Jelen
(Feyn version 1.4 or newer)
The keys to the self-driving car
In order to use your
QLattice, you need two key components.
You can get both of these pieces of information from the dashboard.
QLattice is an identifier that will look something like this:
On your dashboard, it can be found under
[QLattice_Name] > Details :: QLattice.
User Access Token
User Access Token is your authentication credential for accessing the QLattice (so keep it safe). It can be found on the same dashboard page as above, under
[QLattice_Name] > Details :: User Access Token and will look something like this:
Using your credentials
In short, you can provide your credentials in two different ways:
- In the initializer.
- From a configuration file.
In the initializer
This is the simplest way. You just pass them in as the arguments
api_token to the QLattice initializer.
from feyn import QLattice qlattice = QLattice(qlattice="a1b2c3d4", api_token="c1a2c3a406d6e6729012e0de4d8c7a2c")
From a configuration file
Alternatively, you can store them in a local configuration file like this:
[QuesadillaLattice] qlattice = a1b2c3d4 api_token = c1a2c3a406d6e6729012e0de4d8c7a2c [QuibbleLattice] qlattice = ... api_token = ...
The configuration file should be placed in your home folder (or in the
.config subfolder), and be called
feyn.ini if you are on Windows, otherwise
With the configuration file in place, you can connect to the QLattice by specifying which configuration section to use. Or none at all, and the first configuration section will be used.
from feyn import QLattice qlattice = QLattice() # Will use the QuesadillaLattice section. qlattice = QLattice(config="QuibbleLattice") # Loads the QuibbleLattice configurations.
We recommend you use this approach, as it allows you to share code with others, without accidentially disclosing your access token.
It's very easy, because
feyn uses standard
HTTPS to communicate with your
QLattice is running in the abzu cluster on
Therefore, if you can reach https://qlattice.abzu.ai/firewall-test from the computer running
feyn, then you are good to go.
Also, proxies are supported automatically, as long as they are configured in one of the most common ways on your OS.