Coder Social home page Coder Social logo

chifisource / ipycells.jl Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 68 KB

cells, pluto, ipython, and olive readers and writers

License: MIT License

Julia 85.28% Jupyter Notebook 14.72%
data-science ipython-notebook julia jupyter-notebook olive pluto pluto-notebooks odd-data

ipycells.jl's Introduction


version deps pkgeval

IPyCells

IPyCells provides parametric cell-based functionality, as well as readers and writers for different cell formats (Ipynb, JL), as well as offering the option to extend the cells via parametric typing. This module provides

cells
  • AbstractCell
  • Cell(n::Int64, type::String, content::String, outputs::Any = ""; id::String = "")
  • string(Cell{<:Any})
  • string(cell::Cell{:md})
  • string(cell::Cell{:doc})
  • getindex(v::Vector{Cell{<:Any}}, s::String)
read/write
  • read_plto(uri::String)
  • read_jlcells(uri::String)
  • read_jl(uri::String)
  • save(cells::Vector{<:AbstractCell}, path::String)
  • save_ipynb(cells::Vector{<:AbstractCell}, path::String) (this does not work just right yet) cells are readable by Olive, not jupyter post-save.
  • read_ipynb(f::String)
  • ipyjl(ipynb_path::String, output_path::String)
(internal)
  • plto_cell_lines(uri::String)
  • sep(content::Any)

Adding

julia> ]
pkg> add IPyCells

Usage

There are many ways to use IPyCells -- This package could be used to convert Pluto notebooks into Olive notebooks, IPython notebooks into Julia notebooks. Currently, the ipynb save method will break your .ipynb files where IJulia cannot read them, Olive eventually this is planned to be fixed. Anyway, this package could be used to read any package and save it into (currently) ipynb or julia.

ipynbjl("ipynbtestbook.ipynb", "example.jl")
cells = read_ipynb
save_jl(cells)

This preserves both the output and markdown. Alternatively, you could write functions around cells enabling for different cell types to be read by this reader.

ipycells.jl's People

Contributors

emmaccode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

stjordanis

ipycells.jl's Issues

.ipynb saving breaks notebook for IJulia

The printed JSON seems to be pretty similar to the two. It seems IJulia is trying to call get on something, we have provided a String but evidently this is not the type... It also says str, so it might mean Python String... But that could be because it's a str PyCall object. Either way, yes this is causing problems.

need Pluto file reader

We need a Pluto file reader, and for all of the types to be synonymous with the cells, also with all outputs available

Cells read using ends for read_jl

It would be nice to not only seperate by /ns, but concatenate In the case that there is still an open end. It would have to be length of find all for everything with an end, and then length findall for end. Then if the two aren't equal we concat the next line (using enumerate) if we cannot find a final end in the next cell, we check the next cell, totalling the ends the whole time. It's certainly a little annoying, but it will make the cell reader work a whole lot better on non-cell formatted Julia files.

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.