Skip to main content

Convert a Jupyter notebook to blog ready format

Project description

Notebook to Blog

Overview

Notebook to Blog is a Python CLI that makes it easy to go from a Jupyter Notebook to the following outputs:

  • A .txt file containing blog text and placeholders
  • Images of plots (saved locally)
  • Github Gists

While not completely automated, this will make it much easier to create a blog post (e.g., Medium).

Instructions

  1. Install via pip install notebook-to-blog.
  2. Store your Github username/password somewhere in your filesystem:
GITHUB_USER=<username>
GITHUB_PASSWORD=<password>
  1. Run via notebook_to_blog <path to Jupyter notebook> <path to output directory> <path to Github credentials>

For example, running notebook_to_blog my_notebook.ipynb output .env will create the following files:

output/
  my_notebok.txt
  images/
    image_00.png

In addition, Github Gists will be created for each code block encountered.

my_notebook.txt looks like the following:

Whatever you wrote in Markdown will appear as regular text. Code blocks will cause Github Gists to be created, and a link to be inserted:

https://gist.github.com/cgrinaldi/1a11acbdc9006849323163e354955a31

Images will also be represented as placeholder text:

<INSERT img_04.png>

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for notebook-to-blog, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size notebook_to_blog-0.0.1-py3-none-any.whl (6.1 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size notebook-to-blog-0.0.1.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page