Package: wp2md
wp2mdConvert Wordpress Posts To MarkdownInstallpip install wp2mdUsagewp2mdis a simple command line tool.!wp2md-husage: wp2md [-h] [--apiurl APIURL] [--dest_path DEST_PATH]
             [--dest_file DEST_FILE] [--no_download]
             url_or_id

Convert A wordpress post into markdown file with front matter.

positional arguments:
  url_or_id              the public URL of the WP article OR the post id

optional arguments:
  -h, --help             show this help message and exit
  --apiurl APIURL        the base url for the wordpress api to retrieve posts
                         for your site. (default: https://outerbounds.com/wp-
                         json/wp/v2/posts)
  --dest_path DEST_PATH  The path to save the markdown file to (default: .)
  --dest_file DEST_FILE  Name of destination markdown file. If not given
                         defaults to the slug indicated in wordpress
  --no_download          Pass this flag to NOT download any images locally
                         (default: False)Example 1: Public PostsTo convert a wordpress post to markdown, simply pointwp2mdat the url for the post:!wp2md"https://outerbounds.com/blog/notebooks-in-production-with-metaflow/"Writing: notebooks-in-production-with-metaflow.mdThe generated markdown looks like this:!catnotebooks-in-production-with-metaflow.md|head-n30---
title: "Notebooks In Production With Metaflow"
date: "2022-02-09T22:59:06"
image: "https://outerbounds.com/wp-content/uploads/2022/02/Screen-Shot-2022-02-09-at-12.45.20-pm-1024x525.png"
slug: "notebooks-in-production-with-metaflow"
---


By Hamel Husain


*Learn how to use notebooks in production ML workflows with a new Metaflow feature*


When building production-ready machine learning systems, it is critical to monitor the health and performance of those systems with reports and visualizations. Furthermore, allowing for rapid debugging and interactive introspection is critical when workflows fail or do unexpected things. Jupyter notebooks have often been a preferred tool of data scientists for these tasks of visualization, exploration, debugging, and rapid iteration.  Ironically, many production systems do not integrate appropriately with notebooks, which can significantly frustrate progress on these tasks.


Indeed, in the field of data science tooling, one of the most [hotly-contested](https://mlops.community/jupyter-notebooks-in-production/) questions is whether notebooks are suitable for production use. We believe that tools should strive to meet data scientists where they are instead of forcing them to adapt approaches from other disciplines not suited to their needs. This is why we are excited to introduce **Notebook Cards**, which allow data scientists to use notebooks for visualizing and debugging production workflows and help to bridge the MLOps divide between prototype and production. This allows data scientists to safely use notebooks for parts of their production workflows, without having to refactor code to conform to a different development environment. 


With notebook cards, Metaflow orchestrates notebook execution in a reproducible manner without compromising the integrity of your workflows.


![](_notebooks-in-production-with-metaflow_data/0_img)A card rendered directly from a Jupyter Notebook in the [Metaflow GUI](https://netflixtechblog.com/open-sourcing-a-monitoring-gui-for-metaflow-75ff465f0d60).

### From notebooks to production machine learning


[Metaflow](https://docs.metaflow.org/) is an ergonomic Python framework created at Netflix for building production ML systems. The data team at Netflix is also famous [for notebook innovation](https://netflixtechblog.com/notebook-innovation-591ee3221233) in data science workflows.  This notebook innovation was revolutionary because it provided mechanisms to integrate notebooks into production data science workflows by providing the [following features](https://netflixtechblog.com/scheduling-notebooks-348e6c14cfd6):Example 2: Hidden Posts & Downloading ImagesA Wordpress post may note be public (i.e. it might have a status other thanpublished).  In that case, you will need two pieces of information to retrieve the markdown content for that post.The url for the api.  This is<your_site>/wp-json/v2/posts, for examplehttps://outerbounds.com/wp-json/wp/v2/posts.  Note:This isthe api route to retrieve a single WP post.Thepost idyou wish to convert to markdown. The post id can be extracted from wordpress edit url, for example the id forhttps://outerbounds.com/wp-admin/post.php?post=220&action=editis220.For example, we can get the contents of a post which has an id of220as follows:!wp2md220Writing: notebooks-in-production-with-metaflow.mdBy default,wp2mddownloads images locally into a folder named_<name_of_markdown_file>_data/.!ls_notebooks-in-production-with-metaflow_data/0_img 1_img 2_img 3_img 4_imgYou can prevent this by passing the--no_downloadflag:# Get rid of all artificats first!rmnotebooks-in-production-with-metaflow.md!rm-rf_notebooks-in-production-with-metaflow_data/!wp2md220--no_downloadWriting: notebooks-in-production-with-metaflow.mdassertnotPath('_notebooks-in-production-with-metaflow_data/').exists()