crandas.config¶
This module reads user configuration.
By default, user configuration files are stored in the folder
~/.config/crandas
, where ~
indicates the user’s home directory. On
Windows, this translates to %USERPROFILE%\.config\crandas
if set, or
%HOMEDRIVE%%HOMEPATH%\.config\crandas
.
The folder can be overridden by setting the environment variable
CRANDAS_HOME
. Alternatively, the user can set the environment variable
XDG_CONFIG_HOME
, and then configuration is assumed to reside within the
crandas
subfolder of that folder.
Within the configuration folder, crandas searches for the following files:
any file with a
.vdlconn
extension – a TOML-formatted connection file that contains all information used to connect to a server; seecrandas.connection_file
.analyst.sk
– the analyst secret keysettings.toml
– a TOML-formatted file that contains user settings (see below).
To make the configuration folder and display the folder in the user’s file
browser, the user can call python -m crandas config
.
User settings¶
For user configuration that does not pertain to the connection to the server
(for the latter, see Session
), crandas uses the Dynaconf configuration framework. This allows the user to set
configuration variables in three ways:
1. Using a TOML-formatted settings.toml
, located in the configuration
folder (see above). For example by including the line
show_progress_bar = false
2. Through environment variables, e.g. when starting a Jupyter notebook on the command-line
$ CRANDAS_SHOW_PROGRESS_BAR=0 jupyter notebook
Through code, e.g.
from crandas.config import settings settings.show_progress_bar = False
The following settings can be adjusted:
auto_bounds (bool | None, default=None) – if True, never warn about data-derived column bounds; see Query Arguments
default_connection_file (Path, default=”default.vdlconn”) – if
crandas.connect()
is not invoked manually, what connection file should be taken as the default file if there are multiple connection files in the configuration foldershow_progress_bar (bool, default=True) – show a progress bar for long-running queries
show_progress_bar_after (int, default=5) – after how many seconds to show the progress bar
settings related to the script recording checking functionality; see docs of
check_recording.py
- crandas.config.config_path()¶
Return the path where connection files are stored.