alexmojaki / alexmojaki/snoop

Color in Jupyter Notebooks

Open
#8 0 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
Python
Stars
1.5k
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Colors in notebooks don't look great:

![Screen Shot 2019-07-21 at 19 07 43](https://user-images.githubusercontent.com/3627481/61594363-6d3eb080-abeb-11e9-9739-2bb6ab8ae811.png)

Some thoughts:

1. A good automatic default solution will probably require reliably detecting that we are in a notebook.
2. The default red background for stderr is a problem for pretty much any color scheme. It's a bit better if you set `out=sys.stdout`. The default colors for snoop don't work well on a white background, but you can choose a new theme [here](https://help.farbox.com/pygments.html) and pass it to `color`, e.g. `color='manni'`.
3. [It's possible to set a different theme for notebooks](https://stackoverflow.com/questions/46510192/how-to-change-the-theme-in-jupyter-notebook). A dark theme such as `chesterish` mostly works well with snoop's default colors.
4. ~The prefix of lines (the time etc.) are colored in 'grey' (escape code `'\x1b[90m'`) which terminals can actually choose to display however they want. In actual terminals this seems to work quite well. In Jupyter it's a complete failure - the default theme renders it pretty much black, so it doesn't get de-emphasised as it should, while in every dark theme I've tried it's unreadable. It might be best to use an escape code that specifies an RGB value so it always looks the same.~ Solved in https://github.com/alexmojaki/snoop/pull/14

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.