---
# System prepended metadata

title: viresclient dev notes

---

# viresclient dev notes


## Resolve bad behaviour with tqdm

The `IN_JUPYTER` flag in `_client.py` (and likewise in `_config.py`) will not always work. https://github.com/tqdm/tqdm/issues/1098 explains that this is by design (`tqdm.auto` tries something similar and has the same problem). This results in broken output of html in some situations, like the QtConsole used in Spyder's IPython.

```python
# Use auto tqdm, which tries to use tqdm.notebook only when in Jupyter notebook
#  NB: doesn't play nice with QtConsole (e.g. in Spyder)
#      https://github.com/tqdm/tqdm/issues/1098
from tqdm.auto import tqdm
# Allow user to choose between them
from tqdm import tqdm as tqdm_classic
from tqdm.notebook import tqdm as tqdm_notebook
```

Resolve this by 1) tidying up the `IN_JUPYTER` flag setting in `_config.py` and 2) adding `IN_JUPYTER` as an optional setting in the config file. Users can then set it to `False` if it is causing problems.

## Nicer intial configuration from terminal

Implement new CLI tool, `viresclient init`, which walks the user through setting the access token (pointing to the token management page) and any other settings like above.