Skip to content

Configuration

qcs.config

config(**kwargs)

Configuration settings for the QCS client.

If you are logged in, you shouldn't need to use this function.

The configuration instance is created once and reused across the library.

Configuration can be also given as environment variables, using the QCS_ prefix, e.g. QCS_RISK_SERVICE_URL. Environment variables have lower priority.

Attributes:

Name Type Description
risk_service_url str | None

URL for the risk service. Use only if you are not logged in and want to override the user metadata. Example: https://api.quarisma.net/....

queue_service_url str | None

URL for the queue service. Use only if you are not logged in and want to override the user metadata. Example: https://api.quarisma.net/....

disable_ssl_validation bool

If True, SSL validation will be disabled. Warning: This should only be used for testing purposes. Defaults to False.

verbose bool

If True, logs all requests and responses to json files in log_dir. Defaults to False.

log_dir str | None

Directory for request/response logs when verbose is True. Defaults to logs if not specified.

Returns:

Type Description
Config

The configuration instance with applied settings.

Examples:

>>> import qcs
>>> qcs.config(
...     risk_service_url="https://api.quarisma.net",
...     disable_ssl_validation=True,
...     verbose=True
... )
>>> print(qcs.config().risk_service_url)
'https://api.quarisma.net'