Skip to content

Commit

Permalink
Added aur and PyPi repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
williamjameshandley committed Nov 5, 2018
1 parent 95c0065 commit 00a5d1a
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

build/
dist/
*.egg-info/
34 changes: 30 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ py2nb: convert python scripts to jupyter notebooks
==================================================
:py2nb: convert python scripts to jupyter notebooks
:Author: Will Handley
:Version: 0.0.0
:Version: 0.0.1
:Homepage: https://github.com/williamjameshandley/py2nb

.. image:: https://badge.fury.io/py/py2nb.svg
Expand All @@ -13,9 +13,13 @@ py2nb: convert python scripts to jupyter notebooks
Description
===========

``py2nb`` is a python package for converting python scripts with minimal markdown to jupyter notebooks.
``py2nb`` is a python package for converting python scripts with minimal
markdown to jupyter notebooks.

Here is example code, saved as ``example.py``:
Markdown cells are rendered from comments beginning with ``#|``, splits between
code cells are created by comment lines beginning with ``#-``

If one has a script named ``example.py`` containing the code:

.. code:: python
Expand Down Expand Up @@ -49,7 +53,7 @@ Here is example code, saved as ``example.py``:
fig, ax = plt.subplots()
ax.plot(x,y)
Converting via the script
then running

.. code :: bash
Expand All @@ -58,6 +62,28 @@ Converting via the script
produces the notebook `example.ipynb <https://github.com/williamjameshandley/py2nb/blob/master/example.ipynb>`_

Installation
===============

Users can install using pip:

.. code:: bash
pip install py2nb
from source:

.. code:: bash
git clone https://github.com/williamjameshandley/py2nb
cd py2nb
python setup.py install
or for those on `Arch linux <https://www.archlinux.org/>`__ it is
available on the
`AUR <https://aur.archlinux.org/packages/python-py2nb/>`__



To do
=====
Expand Down
44 changes: 44 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python3

from setuptools import setup, Command, find_packages


def readme():
with open('README.rst') as f:
return f.read()


def get_version(short=False):
with open('README.rst') as f:
for line in f:
if ':Version:' in line:
ver = line.split(':')[2].strip()
if short:
subver = ver.split('.')
return '%s.%s' % tuple(subver[:2])
else:
return ver


setup(name='py2nb',
version=get_version(),
description='py2nb: convert python scripts to jupyter notebooks',
long_description=readme(),
author='Will Handley',
author_email='[email protected]',
url='https://github.com/williamjameshandley/py2nb',
scripts=['py2nb'],
install_requires=['nbformat'],
include_package_data=True,
license='GPL',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
)

0 comments on commit 00a5d1a

Please sign in to comment.