Skip to main content

Publish a Jupyter Notebook as a Medium blogpost

Project description

Jupyter to Medium

Publish Jupyter Notebooks as Medium blog posts directly from your notebook with the help of jupyter_to_medium.

Installation

pip install jupyter_to_medium

Should be automatically activated

You should be able to skip the next step, but if the extension is not showing up in your notebook, run the following command:

jupyter bundlerextension enable --py jupyter_to_medium._bundler --sys-prefix

Get an Integration Token from Medium

Before using this package, you must request an integration token from Medium. Read the instructions here on how to get your integration token.

Usage

There are three ways to publish notebooks:

  • Within an active notebok
  • Using a Python script
  • From the command line

Publishing to Medium within a Notebook

After enabling the extension, open the notebook you wish to publish and select the option File -> Deploy as -> Medium Post

png

A new browser tab will open with a short form that needs to be completed.

png

After clicking publish, the notebook and all images will be uploaded to Medium. Any HTML tables (such as pandas DataFrames) will be converted to images (via chrome) as Medium has no ability to represent tables. This is a time consuming process, so be prepared to wait. Check your terminal for updates on what is happening.

If successful, you'll get the following response with a link to view the post.

png

Click the link to view the post.

png

I suggest keeping the setting to publish as a draft, then review on Medium and finalize the publishing there.

Publishing to Medium with a Python Script

Pass the publish function the location of the Jupyter Notebook you would like to publish as a Medium blog post

>>> import jupyter_to_medium as jtm
>>> jtm.publish('My Awesome Jupyter Notebook.ipynb',
                integration_token=None,
                pub_name=None,
                dataframe_image=True,
                title=None,
                tags=None,
                publish_status='draft',
                notify_followers=False,
                license='all-rights-reserved',
                canonical_url=None)

If successful, JSON data will be returned with the URL.

Publishing to Medium from the Command Line (upcoming)

Dependencies

  • Google Chrome / Brave browser

Project details


Download files

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

Source Distribution

jupyter_to_medium-0.0.6.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

jupyter_to_medium-0.0.6-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_to_medium-0.0.6.tar.gz.

File metadata

  • Download URL: jupyter_to_medium-0.0.6.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for jupyter_to_medium-0.0.6.tar.gz
Algorithm Hash digest
SHA256 ebd7fae8b961f7ec660bfa77dcbcb6cbf3c9fe77649255c291369a8a292a0ca5
MD5 fa460d278cb6d2256c48c68dda56b18c
BLAKE2b-256 da6cfeeef989741d6501343192630040f57f750006555c4c85c5d3797bf87f4f

See more details on using hashes here.

File details

Details for the file jupyter_to_medium-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: jupyter_to_medium-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for jupyter_to_medium-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 64c41e82f0da2d6378c7375966ebc057545d92136422f25cee58e897753cc146
MD5 230ba45d16f6320233095bb8604ddbb3
BLAKE2b-256 3bc81b5744bc992a71cb646b99923ff2a06e6b4f9aa61832b1efc51eaa43f176

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page