GithubHelp home page GithubHelp logo

ipynb-3's Introduction

Interactive import from ipynb to jupyter-console

This module lets you import cell-by-cell from any .ipynb file.

  • You'll be asked per cell whether you want to run it.
  • If you run all cells or decide not to run a cell:
    • No futher cells are executed.
    • But every cell in the file is now in your history, starting from 1.
    • The first cell you didn't run is immediately editable.
    • You can load and edit any of the cells from history.

Origin

This was started as an import module by Adrian Price-Whelan, concatenated by Robert Clewley, updated by Doug Callaway, and finally recycled for an interactive console by me.

Installation

git clone https://github.com/thejohnhoffer/ipynb.git
pip install -e ipynb

Usage

  • In the Jupyter-Console
    • example) example.ipynb:

import nbook
from example import *

Interaction

After an import *, you will be prompted like so:


In [1]: print('this is an example')
print('The first cell has these two lines')

Say y/n to running: 

  • As you hit y, prompts will continue for each cell.
  • If you hit n, the last cell prompted will load as multiline input.
    • example) you hit n at In [2] for a file of 8 code cells:
Say y/n to running: n                               
You can load lines 1-8                            
                                                    
In [9]: # %load 2                                   
      : DATA = 'this is the second code cell'
      :                                             
  • You can edit the input and execute (this will not affect the original file).
    • example) you run %load 3 to load the third cell as muliline input.
    • example) you run %load 3-8 to load the rest of the ipynb code at once.

ipynb-3's People

Contributors

thejohnhoffer avatar robclewley avatar

Watchers

 avatar  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.