Skip to content

newman174/ruby_notebook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notebook.rb

Notebook.rb is a Ruby Class for Jupyter Notebooks

File Formats

Jupyter Notebook: .ipynb

Format Description

Notebook files are JSON dictionaries.

Cell types:

  • code
  • markdown
  • raw

Cell attributes

  • all
    • cell_type => string
    • metadata => hash/dict
      • my_metadata => hash/dict
        • heading_level
        • id
        • name
        • tags
        • created
    • source => arr
  {
  "cell_type" : "type",
  "metadata" : {},
  "source" : "single string or [list, of, strings]",
}
  • code

    • execution_count => int or null
    • metadata => hash/dict (inherited from base class)
      • collapsed => bool
      • scrolled => bool
    • outputs => arr (list of output dicts)
      • {output dicts}
      • { "output_type" : "stream", "name" : "stdout", # or stderr "text" : "[multiline stream text]" }
  • markdown

  • raw

Change Log

0.2.0

  • Init notebooks with a cell containing the metadata
  • Pretty generate

0.2.1

  • Cell / group IDs
  • info cells
  • rename cell.hash to cell.to_h
  • [/] inspect and to_s improvements

0.2.2 => jump to 0.3.0

0.3.0

  • Under the hood overhaul

**0.3.1 **

  • Encapsulate loader to class
  • Encapsulate ID generator to class

0.3.2

  • Split notebookcell class to code and markdown cell subclasses
  • Move formatters to their own class
  • Other minor refactoring
  • Change required ruby version to >= 3.0.0

x.x.x

  • Reserved cell names list (notebook instance method?)

About

A Ruby API for Jupyter notebooks.

Resources

Stars

Watchers

Forks

Packages

No packages published