Code Monkey home page Code Monkey logo

juq's Introduction

juq

CLI for viewing/slicing Jupyter notebooks (name is inspired by "jq for Jupyter")

PyPI version

Installation

pip install juq.py

Usage

juq cells

Slice/Filter cells:

juq cells --help
# Usage: juq cells [OPTIONS] CELLS_SLICE [NB_PATH]
#
#   Slice/Filter cells.
#
# Options:
#   -m, --metadata / -M, --no-metadata
#                                   Explicitly include or exclude each cell's
#                                   "metadata" key. If only `-m` is passed, only
#                                   the "metadata" value of each cell is printed
#   -o, --outputs / -O, --no-outputs
#                                   Explicitly include or exclude each cell's
#                                   "outputs" key. If only `-o` is passed, only
#                                   the "outputs" value of each cell is printed
#   -s, --source / -S, --no-source  Explicitly include or exclude each cell's
#                                   "source" key. If only `-s` is passed, the
#                                   source is printed directly (not as JSON)
#   -t, --cell-type TEXT            Only print cells of this type. Recognizes
#                                   abbreviations: "c" for "code", {"m","md"}
#                                   for "markdown", "r" for "raw"
#   --help                          Show this message and exit.

juq merge-outputs

Merge consecutive "stream" outputs (e.g. stderr):

juq merge-outputs --help
# Usage: juq merge-outputs [OPTIONS] [NB_PATH]
#
#   Merge consecutive "stream" outputs (e.g. stderr).
#
# Options:
#   -i, --in-place       Modify [NB_PATH] in-place
#   -o, --out-path TEXT  Write to this file instead of stdout
#   --help               Show this message and exit.

e.g.:

juq merge-outputs -i notebook.ipynb

Useful for situations like:

As of nbconvert#2089, this should be redundant with:

jupyter nbconvert --coalesce-streams --inplace notebook.ipynb

juq papermill-clean

juq papermill-clean --help
# Usage: juq papermill-clean [OPTIONS] [NB_PATH]
#
#   Remove Papermill metadata from a notebook.
#
#   Removes `.metadata.papermill` and
#   `.cells[*].metadata.{papermill,execution,widgets}`.
#
# Options:
#   -i, --in-place       Modify [NB_PATH] in-place
#   -o, --out-path TEXT  Write to this file instead of stdout
#   --help               Show this message and exit.

juq's People

Contributors

ryan-williams avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.