skipcheck

TM1 client · Docs · Sessions and logins

Tm1SessionBuilder

from skipcheck_tm1 import Tm1SessionBuilder

Builds a Tm1Session. Only base_url and credentials are required.

Members

__init__ constructor
copyA copy of these settings, for the pool to build one session per identity.
settingsThe settings so far, by name, as a new dict.
base_urlThe REST API's root, such as http://tm1:8010/api/v1/.
addressThe server's address, read by the dialect.
dialectThe kind of deployment, for address.
basic_authBasic authentication, for TM1 security modes 1 and 2.
authenticatorHow to log in.
impersonateLogs in as the service account but acts as user (TM1-Impersonate, sent at login only).
without_impersonationLogs in as the credentials' own user.
session_contextA label for the TM1 session, shown as its Context in Sessions and Threads, such as the application's name; sent with the login.
timeoutsTimeouts by kind of work; Tm1Timeouts.DEFAULTS unless set.
error_classifierHow error responses are classified; Tm1ErrorClassifier.defaults unless set.
http_clientThe HTTP client to send through (Java's webClient and connector).
verifyHow the server's certificate is checked.
check_capabilitiesWhether a request is checked against the server's $metadata before it's sent, and refused with a skipcheck_tm1.errors.Tm1UnsupportedOperationError if the server doesn't define what it needs.
clockThe clock refused logins are timed by, in seconds (Java's nanoTime).
base_url_or_unsetThe server, for messages.
buildThe session.

__init__

constructor
__init__(settings: dict[str, Any] | None = None)

copy

copy() -> Self

A copy of these settings, for the pool to build one session per identity.

settings

settings() -> dict[str, Any]

The settings so far, by name, as a new dict.

base_url

base_url(base_url: str) -> Self

The REST API's root, such as http://tm1:8010/api/v1/.

address

address(address: str) -> Self

The server's address, read by the dialect: http://tm1:8010.

dialect

dialect(dialect: Tm1Dialect) -> Self

The kind of deployment, for address. Tm1Dialect.V11 unless set.

basic_auth

basic_auth(user: str, password: str | None) -> Self

Basic authentication, for TM1 security modes 1 and 2: shorthand for authenticator(auth.basic(user, password)). A password of None counts as empty.

authenticator

authenticator(authenticator: Authenticator) -> Self

How to log in: TM1's own security, CAM, or credentials of your own. Asked for credentials on every login, and given the login timeout to supply them (see Tm1Timeouts).

impersonate

impersonate(user: str) -> Self

Logs in as the service account but acts as user (TM1-Impersonate, sent at login only). A name with characters outside ASCII goes out as UTF-8, which is how TM1 (11.8) reads the header. Refuses a blank name, which TM1 would take as no impersonation at all, and one with a control character.

without_impersonation

without_impersonation() -> Self

Logs in as the credentials' own user: no impersonation.

session_context

session_context(session_context: str) -> Self

A label for the TM1 session, shown as its Context in Sessions and Threads, such as the application's name; sent with the login. It's a setting of the session, not of a view: TM1 keeps one label per session. At most 250 characters; sent as UTF-8, as TM1 reads it.

timeouts

timeouts(timeouts: Tm1Timeouts) -> Self

Timeouts by kind of work; Tm1Timeouts.DEFAULTS unless set.

error_classifier

error_classifier(classifier: Tm1ErrorClassifier) -> Self

How error responses are classified; Tm1ErrorClassifier.defaults unless set.

http_client

http_client(client: httpx2.AsyncClient) -> Self

The HTTP client to send through (Java's webClient and connector).

verify

verify(verify: bool | str | ssl.SSLContext) -> Self

How the server's certificate is checked. True (the default) checks it against the operating system's trust store, as the .NET client does, so a company CA installed on the machine is trusted; the Java client uses the JVM's trust store instead. That's httpx2's default: truststore on Windows and macOS, OpenSSL's system CA files on Linux, and SSL_CERT_FILE or SSL_CERT_DIR instead when either is set. A path is a CA bundle (a PEM file, or a directory of them) to check it against instead, an ssl.SSLContext is used as it is, and False doesn't check it.

check_capabilities

check_capabilities(check: bool) -> Self

Whether a request is checked against the server's $metadata before it's sent, and refused with a skipcheck_tm1.errors.Tm1UnsupportedOperationError if the server doesn't define what it needs. On unless set.

clock

clock(clock: Callable[[], float]) -> Self

The clock refused logins are timed by, in seconds (Java's nanoTime): tests pass one they move.

base_url_or_unset

base_url_or_unset() -> str

The server, for messages: the base URL or address set, or a placeholder.

build

build() -> Tm1Session

The session. Nothing is sent to TM1 until the first request.