PKIK>$::multi_rise/.__init__.py.un~VimUnDo6'BVE-w43Z8v*a@bD3"__version__ = '0.1' !!!!Y#_Y5_Y__version__ = '0.1'5_Y5_vbY"""This is """5_ vbY"""This is """5_'vbY'Q"""This is a quick shortcut to combine notebooks into a single rise presentation.5_vbY*!It adds a cell in between each"""5_ !vbYBY"""This is a quick shortcut to combine Jupyter notebooks into a single rise presentation.VIt adds a cell in between each notebook to reset the environment so that the notebooks%don't cause issues for each other."""5_ vbY5_ vbYL5_ vbYMfrom multi_rise import main5_ vbYN 5_  vbY]  5_ vbYl  5_vbYl 5_vbYnimport argparse5_vbYo5_vbYp__version__ = '0.1'5_vbYq 5_vbYr  5_ vbYv  5_vbY5_ vbY  5_ vbY 5_ vbY 5_vbY "from multi_rise import combine_nbs5_vbY from import combine_nbs5_vbYn from combine import combine_nbs5_vbYo from import combine_nbs5_ vbYr from . import combine_nbs5_! vbY __version__ = '0.1'5_ ! vbY# __version__ = '0.1.1'5_vbYdef parse_index(fp): if isinstance(fp, Path): with fp.open() as f:A nb_files = [fname.rstrip() for fname in f.readlines(): if Path(fname.rstrip()).is_file()] return nb_files5PKIK?88multi_rise/.combine.py.un~VimUnDo!ZUf~+7QxKrj\}F /C "slide_type": 'slide'"=Y"_!9Yi "-? "slide_type": 'slide'5_!9Yi "-: "slide_type": ''5_Y./ combined_nb.metadata.merge(nb.metadata). -5_%Y.& if not nb.cells.metadata.get()5_+Y., if not nb.cells.metadata.get("tags")5_0Y.0 if not nb.cells.metadata.get("tags", [])5_<Y.? if not nb.cells.metadata.get("tags", []).get("no_rest")5_ ?Y.@ if not nb.cells.metadata.get("tags", []).get("no_reset")5_ DY.D if not nb.cells.metadata.get("tags", []).get("no_reset", "")5_ $%VDY%. nb.cells.append(* new_code_cell("%reset -f",( metadata={4 "slideshow": {? "slide_type": 'slide'' }! })) nb.cells.append(= new_markdown_cell("Execute for next speaker",, metadata={4 "slideshow": {; "slide_type": '-'' }% }))5_ $%VDY.E if not nb.cells.metadata.get("tags", []).get("no_reset", ""):5_ $%VDY.G if not nb.cells[].metadata.get("tags", []).get("no_reset", ""):5_  $%VDY/ /.5_ %%VDY//I if not nb.cells[-1].metadata.get("tags", []).get("no_reset", ""):5_vY4/R if not no_reset nb.cells[-1].metadata.get("tags", []).get("no_reset", ""):/5_SvY6/T if not 'no_reset' nb.cells[-1].metadata.get("tags", []).get("no_reset", ""):5_vY</@ if not 'no_reset' nb.cells[-1].metadata.get("tags", []):5_ vY?/G if not 'no_reset' not in nb.cells[-1].metadata.get("tags", []):5_vY% import ipdb; ipdb.set_trace()5_'vY &(/* combined_nb.cells.append(cell)')/ ').5_'vY'*/ ').5_)vY (*0 combined_nb.metadata.pop()5_*vY )*5_$VY" nb.cells.append(A new_markdown_cell("Execute for next speaker",0 metadata={8 "slideshow": {? "slide_type": '-'+ }) }))5_VY" ((5_>%%VY"/? "slide_type": '-'5_"=%%VY"!#/C "slide_type": 'slide'5_"=%%VY"!#/> "slide_type": ''5PKIKIrmulti_rise/__init__.py"""This is a quick shortcut to combine Jupyter notebooks into a single rise presentation. It adds a cell in between each notebook to reset the environment so that the notebooks don't cause issues for each other.""" import argparse from pathlib import Path from .combine import combine_nbs __version__ = '0.1.2' def parse_index(fp): if isinstance(fp, Path): with fp.open() as f: nb_files = [fname.rstrip() for fname in f.readlines() if Path(fname.rstrip()).is_file()] return nb_files def main(argv=None): ap = argparse.ArgumentParser(description='Combine notebooks and make slides') ap.add_argument('--index', nargs='?', type=Path, default='index.txt') ap.add_argument('--output', nargs='?', type=Path, default='combined_nb.ipynb') args = ap.parse_args(argv) combine_nbs(nb_files=parse_index(args.index), output=args.output) PKIKtmulti_rise/combine.py# -*- coding: utf-8 -*- import nbformat from nbformat.v4 import new_code_cell, new_markdown_cell, new_notebook def combine_nbs(nb_files=None, output=None): if "ipynb" not in output.suffix: output = output.with_suffix(".ipynb") if nb_files is None: nb_files = ['./Untitled.ipynb', './Untitled2.ipynb', './Untitled3.ipynb'] combined_nb = new_notebook() for file in nb_files: nb = nbformat.read(file, as_version=4) combined_nb.metadata.merge(nb.metadata) if 'no_reset' not in nb.cells[-1].metadata.get("tags", []): nb.cells.append( new_markdown_cell("Execute for next speaker", metadata={ "slideshow": { "slide_type": 'slide' } })) nb.cells.append( new_code_cell("%reset -f", metadata={ "slideshow": { "slide_type": '-' } })) for cell in nb.cells: cell.metadata.origin = file combined_nb.cells.append(cell) combined_nb.metadata.pop("celltoolbar") nbformat.write(combined_nb, str(output)) if __name__ == '__main__': from . import main main() PK!HWr)0+multi_rise-0.1.2.dist-info/entry_points.txtN+I/N.,()-)Ɍ/,NUU@pr3PK!H}0RR multi_rise-0.1.2.dist-info/WHEEL1 0 RZtMDtPI{w<wUnbaKM*A1ѭ g\Ic c~PK!H:$Ҧ#multi_rise-0.1.2.dist-info/METADATA}TKo@ﯘ 'K6h#Z'*]YirRl{̬o1FFYB|(?4XI](%1[. V;Qсr[ꇈX;Ka Am:E/؇jئ6 K~qDF+~U]-s\#);Jlc(J%mgF#5Pa W}#6|\ᓒ{^CFm"M?IZkAe$_]+y# .^ls"~Ǡ<ʈ -S"l4'#njV!elWS'T-E 败T_աWkkڪ.5eN'泔Ru6L2LljߐP(,io$?jZ!~/c.^KOb+u?Z}G#x?f|60AKOƌrgKHdIVuבC)hD^zn?Z4B(ɓ}U;`dߣ[\Q!u^? KQ:q>  ˙H:kcG~Dz98;agah'{K@VrG 7!jk,;mo@xtxWhAϜ҇-%<PK!Hkւ~!multi_rise-0.1.2.dist-info/RECORD}v@}]@rSA$~Άv/|A׸GiffS$8Q27YtV !յ qpWA ȽUOhtB\'9hh]'9٘Itы3r:S@̧Ohz0kj0LN[*לV!0ƾmkZl]VC"K B4-fǩEfq~KF `8&ƤqߓfqKx+C?q=Zߗ<׃sWr,8^I(a*ҴZJH:jXQ!`wV)6i6Zq؝ʪʋLlJ6sѨfL_-RQA(dD|^}*EPKIK>$::multi_rise/.__init__.py.un~PKIK?88;multi_rise/.combine.py.un~PKIKIrtmulti_rise/__init__.pyPKIKtxmulti_rise/combine.pyPK!HWr)0+O~multi_rise-0.1.2.dist-info/entry_points.txtPK!H}0RR ~multi_rise-0.1.2.dist-info/WHEELPK!H:$Ҧ#Qmulti_rise-0.1.2.dist-info/METADATAPK!Hkւ~!8multi_rise-0.1.2.dist-info/RECORDPK_