4 Tools to Speed Up Your Data Science Writing
This article covers how you can achieve your writing goals with these 4 tools.
By Rebecca Vickery, Data Scientist
I’ve been writing about data science on Medium for just over two years. Writing, in particular, technical writing can be time-consuming. Not only do you need to come up with an idea, write well, edit your articles for accuracy and flow, and proofread them. With technical articles you often also need to produce code to illustrate your explanations, ensure that it is accurate and transfer that code from the tool you used to write it, to your Medium post.
I try to publish once or twice a week. When I first started writing I found that the process could be very time consuming, and it was difficult to maintain this schedule around a full-time day job.
Over time I have found some tools that have hugely sped up the time it takes for me to create and publish an article. Particularly those containing coded examples. The following tools help me to achieve my goal of publishing one to two articles per week around my other life commitments.
This tool was only released in May this year by Ted Petrou but it is a game-changer if you write your code in Jupyter Notebooks. With this Python package, you can publish the entire content of your notebook as a blog post directly into your Medium account.
To use this tool first you need to pip install it into your project environment.
pip install jupyter_to_medium
You may need to also install this extension in the environment you are launching your notebook from.
jupyter bundlerextension enable --py jupyter_to_medium._bundler --sys-prefix
Once installed, when you open a Jupyter Notebook and navigate to File >> Deploy as, you will now find an option to deploy as a Medium post.
When you select this option you will be presented with a form. At the top, it asks for an integration token. If you are a regular writer on Medium you may have access to this in the settings in your Medium account. If you don’t have a token in your settings you will need to contact Medium to request one via this email address firstname.lastname@example.org.
From my experience, you will get a response quite quickly, typically within 1 to 2 days.
You can either paste your integration token into this form each time or, to save having to repeatedly access it, you can save the token as a file and directory labelled in the following way
Jupyter to Medium will publish your markdown as text, code as code blocks and images directly to medium as a draft. I have found that you generally only need to perform minimal edits to then get to a publishable blog post.
2. Github Gists
Github has a tool known as Github Gists that allow you to easily embed code snippets directly into your blog posts. The advantage of using Gists rather than code blocks in your articles is that they preserve the format of the code better, they promote your Github account and it is easier for readers to access your code to try the examples out for themselves.
You will need a Github account to create a Gist. Once you have one simply navigate to the Gists page at gist.github.com. Creating a Gist is very simple, just give it a name, paste in your code and hit publish. Once published you will see this page. To embed the Gist in your Medium post simply code the URL under ‘Embed’ and paste into your article.
The code displays in your Medium post as shown below.
Jovian.ml is a tool for hosting Jupyter Notebooks online which is very useful for sharing analyses externally from your local environment. Jovian recently released a feature which makes it possible to embed entire notebooks, snippets of code, cell outputs and markdown directly into your Medium posts.
To get started with Jovian you need to create an account on jovian.ml. The free tier gives you unlimited public projects which is ideal if you are using it to share via a Medium blog. You then need to pip install into your local environment.
pip install jovian
To upload a local Jupyter Notebook to your online Jovian account simply run the following in your notebook.
import jovian jovian.commit()
This will prompt you for an API key which you will find in your account.
To embed specific snippets of code in a cell. Navigate to the notebook you have uploaded to your online account and the cell containing the code you want to share. Click on Embed Cell.
This will give you a link you can paste into your Medium post.
This then displays as shown below.
Grammarly is quite a well-known app that checks your content for typos, grammatical errors and even the sentiment of your text. Although an obvious tool for writing it took me a while to start using it, and it made such a difference to the editing time for my articles so I thought it was worth sharing here.
Grammarly can be installed as a browser extension, locally as a desktop app or as a mobile app. To maximise the use of my time I write in many different environments so it is useful to have Grammarly installed locally if I am writing offline, in my browser for when I am directly writing on Medium and on my mobile if I am writing on the go.
If you are interested in posts about data science writing on Medium you might find these earlier articles I wrote on the subject useful too.
How I Write a Data Science Blog
Top tips for writing about data science (or any other topic)
Why I Write a Data Science Blog
Blog writing has accelerated my learning in data science, here’s why
Thanks for reading!
Bio: Rebecca Vickery is learning data science through self study. Data Scientist @ Holiday Extras. Co-Founder of alGo.
Original. Reposted with permission.
- If I had to start learning Data Science again, how would I do it?
- What Does It Take to be a Successful Data Scientist?
- The Most Important Data Science Project