Giter VIP home page Giter VIP logo

nb2md's Introduction

nb2md: conversion of Jupyter and Zeppelin notebooks to Jupyter or Markdown formats

nb2md relies on nbconvert and lets you convert Jupyter and Zeppelin notebooks to Jupyter or Markdown formats.

Installation

You can install or update the package with pip:

pip install -U nb2md

Usage

The format of input notebooks can be either Jupyter or Zeppelin. The format of output notebooks can be either Jupyter or Markdown. Input and output formats are guessed by the extension of the pathname base name: .ipynb for Jupyter, .json for Zeppelin and .md for Markdown.

To convert a Zeppelin notebook to Markdown:

nb2md --src notebooks/example1.json --dst example1.md

To convert a Zeppelin notebook to Markdown, using the notebook name to form the destination pathname:

nb2md --src notebooks/example1.json

To convert a Zeppelin notebook hosted on AWS S3:

nb2md --src s3://bucketname/your/path/2E6XDUATX/note.json

To convert a Jupyter notebook to Markdown:

nb2md --src notebooks/example2.ipynb --dst example2.md

To convert a Zeppelin notebook to the Jupyter format:

nb2md --src notebooks/example1.json --dst example1.ipynb

Credits and license

The pynb project is released under the MIT license. Please see LICENSE.txt.

Development

Create Python environment

Instructions that work on MacOS Catalina:

  • Install a specific version of Python: pyenv install 3.8.3
  • Create virtualenv: pyenv virtualenv 3.8.3 nb2md
  • Activate virtualenv: pyenv activate nb2md
  • Update pip: pip install --upgrade pip
  • Install packages: pip install -r requirements.txt
  • Install package in development mode: pip install -e .
  • Remove virtualenv: pyenv virtualenv-delete nb2md

Install pyenv/virtualenv:

brew update
brew install pyenv
brew install pyenv-virtualenv

Add to ~.zshrc:

if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
  export PYENV_VIRTUALENV_DISABLE_PROMPT=1
fi

if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi

The fabfile assumes you have zsh as shell and the pynb virtual env.

Building and publishing a new release

Create a file secrets.py in the project directory with the Pypi credentials in this format:

pypi_auth = {
    'user': 'youruser',
    'pass': 'yourpass'
}

To release a new version:

fab release

Running the tests

  • To run the py.test tests: fab test
  • To run tests printing output and stopping at first error: fab test-sx
  • To run the pep8 test: fab test-pep8
  • To fix some common pep8 errors in the code: fab fix-pep8

Contributing

  1. Fork it
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Create a new Pull Request

nb2md's People

Contributors

nicosuave avatar

Forkers

atm-com

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.