import os
from IPython.core.display import HTML
with open('creative_commons.txt', 'r') as f:
html = f.read()
name = '2014-08-25-github_doi'
html = '''
<small>
<p> This post was written as an IPython notebook.
It is available for <a href='https://ocefpaf.github.com/python4oceanographers/downloads/notebooks/%s.ipynb'>download</a>
or as a static <a href='https://nbviewer.ipython.org/url/ocefpaf.github.com/python4oceanographers/downloads/notebooks/%s.ipynb'>html</a>.</p>
<p></p>
%s''' % (name, name, html)
%matplotlib inline
from matplotlib import style
style.use('ggplot')
date = '-'.join(name.split('-')[:3])
slug = '-'.join(name.split('-')[3:])
metadata = dict(title="Minting DOIs for research software",
date=date,
hour='17:00',
comments="true",
slug=slug,
name=name)
markdown = """Title: {title}
date: {date} {hour}
comments: {comments}
slug: {slug}
{{% notebook {name}.ipynb cells[2:] %}}
""".format(**metadata)
content = os.path.abspath(os.path.join(os.getcwd(), os.pardir, os.pardir, '{}.md'.format(name)))
with open('{}'.format(content), 'w') as f:
f.writelines(markdown)
I have been a little busy this past week. That is why this is a very short post, just to keep track of what I have been doing lately.
Zenodo and GitHub joined forces to create an easy way to make citable-code. You can generate a DOI with just 4 clicks:
That's it! There is even a badge for READMEs and webpages. I already minted new releases of all my repositories and added DOIs to them. Check it out:
Next time you use any of these packages for your research, be sure to use the DOI and make your research more reproducible.
HTML(html)
This post was written as an IPython notebook. It is available for download or as a static html.