from seeq import spy

# Set the compatibility option so that you maximize the chance that SPy will remain compatible with your notebook/script
spy.options.compatibility = 202

spy.login

Logs into a Seeq Server. This command is necessary if you are using the SPy module with your own installation of Jupyter, or with hosted Jupyter Notebook services like AWS SageMaker or Azure Notebooks.

Note: In Seeq Data Lab, you will log in using the normal Seeq Server landing page and your credentials will be used by the SPy module directly.

spy.login(username=None, password=None, *, access_key=None, url=None, directory='Seeq', credentials_file=None, auth_code=None, ignore_ssl_errors=False)

Specifying Seeq Server URL and credentials

If you are not using Seeq Data Lab, you must specify the URL of the server. You can just copy the URL directly out of the browser’s address box and use it. For example: http://seeqserver:34216 or https://mycompany.seeq.site.

You can choose to embed your credentials directly into the notebook using the username and password fields, or you can choose to specify credentials_file that is read from disk (username on first line, password on second line). Note that the credentials file is not secure: It just allows you to share your notebook without also supplying your credentials.

spy.login(url='http://localhost:34216', username='mark.derbecker@seeq.com', password='DataLab!')

Authentication Directories

If your organization is configured to use LDAP or Windows Authentication where you have a corporate username and password, it may be necessary to specify the authentication directory. This is the name seen in the Directory dropdown on the Seeq login page, use it for the directory argument like so:

spy.login(url='http://localhost:34216', username='mark.derbecker@seeq.com', password='DataLab!', directory='Seeq')

Access Keys

If your organization uses password-less (e.g. smart card-based) Windows Authentication, you will need to use an Access Key to log in. Please read the Access Key documentation for information on how to create one. Once you have created the Access Key, use it like so:

spy.login(url='http://localhost:34216', access_key='LNXqmeT5SX-PA-grV7-IfQ', password='Wma3XlW6CM3c4Y2X8UiQnbcDYUwaEh')

In Seeq Server R22.0.49.XX and earlier, the Access Key is only valid for a set amount of time as specified in the server Administation page’s Configuration tab, specifically the Authentication/AccessKey/ValidityWithoutUserLogin setting. The default is 1 day. The validity time is measured from the time of last login. If you have not logged out (it’s important that you log out!) and then log back in to Seeq Workbench within the specified timeframe, you will need to do so to “reset” the validity period.

In Seeq Server R50.0.0 and later, the Access Key validity period is more lenient. The validity expiration time is measured from the time that you closed all your active Seeq Workbench browser tabs. In other words, if you keep a Seeq Workbench tab open somewhere, your access key will remain valid, and once you close your tab, it will still remain valid for the time specified in the setting described above.

If you wish to use an Access Key in conjunction with credentials_file, put the Access Key on the first line and the Password on the second line.

Single Sign-On for AI Agents and Other Applications

AI agents (such as Claude Code, Codex, Cursor, etc.) and other applications running outside Seeq Data Lab can log in through your organization’s single sign-on, without needing to provide a username, password or access key. Give spy.login only the Seeq server’s URL. This requires the Seeq server to have a single sign-on (OAuth 2.0) directory.

spy.login(url='https://mycompany.seeq.site')

SPy opens your browser at that URL. Sign in if you aren’t already, then click Allow access. You won’t be prompted again on this machine until the session expires.

Install seeq-spy[keychain] to keep the session in your operating system’s keychain (Windows requires it). Without it, SPy stores the session in a file that only your user account can read.

If a SPy call fails with 401 Unauthorized, the session may have ended: call spy.login(url=...) again, then retry. To end the session yourself and remove the saved copy, call spy.logout().

Within an AI agent, use the following prompt:

Install the latest seeq-spy[keychain] package from PyPI, then call spy.login(url='https://mycompany.seeq.site').

If no browser is available (for example over SSH), spy.login stops with an error that contains a sign-in URL. Open it in any browser and click Allow access. Seeq shows a one-time code; pass it to a second spy.login call within ten minutes:

spy.login(url='https://mycompany.seeq.site', auth_code='<the code Seeq showed>')

SSL Errors

If you are using a secure connection (https), the root certificate in the SSL certificate chain used by the Seeq Server must be recognized by the Python certifi library. If not, you’ll need to add ignore_ssl_errors=True with your spy.login call. Be warned that this will mean your connection is potentially insecure and vulnerable to man-in-the-middle attacks.

If you are using Seeq Data Lab, you can potentially put the seeq-key.pem and seeq-cert.pem files from Seeq Server in Seeq Data Lab’s <global_folder>/keys folder. The certificate file must contain the full unbroken certificate chain in order to work correctly.

Proxy Servers

If your organization uses a proxy server for Internet access, SPy will automatically look at the HTTP_PROXY and HTTPS_PROXY environment variables and use them if specified. Alternatively, you can supply an argument like proxy='http://myproxyserver:8088' to your spy.login call to specify it directly. If you specify proxy=None, then the HTTP_PROXY and HTTPS_PROXY environment variables will be ignored.

Detailed Help

All SPy functions have detailed documentation to help you use them. Just execute help(spy.<func>) like you see below.

help(spy.login)