paw-lu / nbpreview Goto Github PK
View Code? Open in Web Editor NEWA terminal viewer for Jupyter notebooks. It's like cat for ipynb files.
Home Page: https://nbpreview.readthedocs.io/
License: MIT License
A terminal viewer for Jupyter notebooks. It's like cat for ipynb files.
Home Page: https://nbpreview.readthedocs.io/
License: MIT License
Launch a pager automatically if output is longer than the terminal height. Like bat does.
Look into integrating (https://github.com/guilatrova/tryceratops)[https://github.com/guilatrova/tryceratops]. A linter for try/except blocks.
Integrate econchick/interrogate—a docstring coverage tool.
Backport to cjolowicz/cookiecutter-hypermodern-python.
Just charts is used for rendering vega content, but is not a dependency. Cite it in readme to give proper credit.
Fail gracefully on invalid images, links, etc.
This project basically aims to be bat—but for notebooks. Look at bat for inspiration on useful arguments and flags.
Some tests' state depend on the directory they are run in.
Right now for --theme
this reuses Rich's argument values. Create an alias for "ansi_dark"
and "ansi_light"
—"dark"
and "light"
.
Right now the stderr output renders the text on a pink background.
This can look too tight and snug depending on terminal settings. Add some padding to relax it.
Render images using sixel. Preferred library right now is probably libsixel-python, which we can add to the project once a new release of Poetry is out.
gh pr list --state=open --json=author,number | jq '.[]' | jq 'select(.author.login == "dependabot")' | jq '.number' | parallel "gh pr comment --body='@dependabot merge'"
There are automerge workflows, but we're not quite ready for that level of confidence. This is a good half step, where we can quickly accept all pending PRs once quickly scanned.
Check on how debugger output is rendered if pdb/ipbd is activated, used, and quit.
isort now has a black compatability profile, is a bit more standard than reorder-python-imports, a config file, and has better editor support. Cons is that it generatese bigger diffs.
Integrate with sphinx-click. Look to this PR.
Add a force color flag that will force the rendering to use colors.
You can style Pandas tables. How does this handle that?
Right now the left column will expand to fit all characters. Set a max width and truncate it, since it's less important than the main content.
Look at this blog to see the additional links we're missing. Backport to cookiecutter template.
Add a debugging shell for GitHub Actions. Follow this post.
Switch theme to pradyunsg/furo.
Things might get wonky if things get too wide or narrow. Set reasonable defaults for the minimum and maximum widths.
Make sure and test that all components—image drawings, code, links, etc, respect a --no-color
option. This should be enabled by default when piping output.
Add autocompletion for arguments for --theme
.
Right now the markdown styling might introduce some weird characters when parsed. Disable styling when --plain
is invoked.
test_notebook.py
is getting a little ridiculous. Some outputs are way too long, causing awkward editing, long linting and formatting times, etc. Move long outputs to external files.
Set stricter wrap rules for things like code input, output.
Detect when output is piped and disable color, render in a plain format, and disable image rendering.
Investigate MyST as a rst alternative.
An alternative to rendering Markdown headers is using different unicode characters. Investigate integrating dressup for this.
Evaluate pytest-clarity—which brings in colored diffs to failing test. Might be useful for this project, where a majority of tests compare string outputs.
nbpreview.notebook._pick_image_drawing
's logic is duplicated with choose_drawing
and fallen out of sync. Consolidate and update.
When trying to render this notebook, nbpreview hangs.
Profiling shows it hangs on rich's end on rich.cells.call_len:22
.
Isolate problem cell and idenfity issue.
Create a cli command that lists all the available themes and another command that renders a preview of them in the terminal. Right now the use has to know Pygments these, which is not ideal. Bat does something similar.
Integrate asottile/pyupgrade—a tool for automatically upgrading Python syntax.
Right now this project uses Rich's default markdown renderer. This doesn't work well with the project's style.
Problems:
Create a custom markdown renderer using the steps outlined here.
Use kelvindecosta/picharsso to draw images using text characters for terminals that do not support unicode block characters.
Create a flag to force on or off.
Colorize help. Look to this PR for help.
Add general documentation for the project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.