Utilities for working with IPykernel/DFKernel notebooks
Project description
dfconvert
This is a library provided in the form of a bundler extension that allows the conversion of Dataflow notebooks into their IPykernel equivalents. There is no guarantee made that the Notebook that enters will be as efficient as the notebook in the Dfkernel but it will perform in the same way.
A topological sort if also applied to the Notebook to ensure that it can be ran top down.
It relies on IPython core methods for some of the translation process so some magic and system commands may be translated into their IPython equivalent.
Installation Instructions
- cd to outer
dfconvertthat containssetup.py. pip install .jupyter bundlerextension enable --sys-prefix --py dfconvert
Usage
By enabling the bundler extension you will have the option inside of the File -> Download As method which provides two functions Ipykernel Compatible Notebook.
Optionally the package can also be called by the use of
import dfconvert.make_ipy as ipy
file_name = 'mynotebook.ipynb'
nb = nbformat.read(file_name,nbformat.NO_CONVERT)
new_file_name = 'mynewnotebook.ipynb'
dfpy.export_dfpynb(nb, in_fname=file_name, out_fname=new_file_name, md_above=True,full_transform=False,out_mode=False)
This will create a notebook with out_fname as an ipykernel compatible notebook if out_fname is not set then a file will be created with file_name that includes a _dfpy before the extension to ensure that files do not become overwritten. md_above is a flag for marking markdown cells at the top of the notebook and sending the full_transform flag set to true will also convert all Out[aaaaaa] style references including those that are inside of comments and inside of strings, by default this set to off. out_mode is an additional flag that will make sure that if a cell has any output that is normally created in the dfkernel that this output will be shown in a new cell in the ipykernel, this will be repeated for all results found in a tuple.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dfnbutils-1.0.0b0.tar.gz.
File metadata
- Download URL: dfnbutils-1.0.0b0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
442bf362631bbc10a94467d801d25ad4a06dba1d562e71b7b4542e3cb920fe36
|
|
| MD5 |
8f5fe289d9f3b8f436dc6dc7b0e2538e
|
|
| BLAKE2b-256 |
f50c585ed10766c5c028d48f97e4d271d8e8e80f9148b8902e8451e65e7d6c00
|
File details
Details for the file dfnbutils-1.0.0b0-py3-none-any.whl.
File metadata
- Download URL: dfnbutils-1.0.0b0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46f0760269e73414cfd8b31349868922ebc330577617f0e3c2000d90c1d7a991
|
|
| MD5 |
69adaddcb1969e8b38dcd50adc9cfeab
|
|
| BLAKE2b-256 |
c42a743b872f348a8095fc3e8122bf0a026575eaaa7651b0d3b87f441d14dea3
|
File details
Details for the file dfnbutils-1.0.0b0-1-py3-non-any.whl.
File metadata
- Download URL: dfnbutils-1.0.0b0-1-py3-non-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ebf590354e700c3a65beae32514f50eecc77254ef81a643fc655ae5d71cd8aa
|
|
| MD5 |
da43ceb79ee55a52fae6b5cbd6ff199b
|
|
| BLAKE2b-256 |
2e1615568a6d63e59f4ababe14b67d5c97cb2627c447e78382c55938a078a889
|