Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

Profile manager of text processing pipelines: Pandoc filters, any text CLI filters. Atom+Markdown+Pandoc+Jupyter workflow, export to ipynb.

Project description

Pandoctools

Pandoctools is a combination of tools that help write reproducible markdown reports. They rely on Pandoc and Jupyter kernels.

Introduction article: Convenient and easily tweakable Atom+Markdown+Pandoc+Jupyter experience (can export to ipynb).

“Glueing” part of pandoctools is a profile manager of text processing pipelines. It stores short shell (bash or batch) scripts that define chain operations over text. They are mostly Pandoc filters but any CLI text filter is OK.

Notable parts of Pandoctools

  • Pandoc, Jupyter, pandoc-crossref (dependence) - classical tools.
  • Pandoctools CLI app: profile manager of text processing pipelines. It stores short shell (bash or batch) scripts - called profiles - that define chain operations over text. They are mostly Pandoc filters but any CLI text filter is OK. Profiles can be used to convert any document of choise in the specified manner.
  • Knitty (dependence): Knitty is another CLI for Stitch/Knotr: reproducible report generation tool via Jupyter, Pandoc and Markdown. Insert python code (or other Jupyter kernel code) to the Markdown document and have code’s results in the output document. Can even export to Jupyter ipynb notebooks.
  • SugarTeX (dependence): SugarTeX is a more readable LaTeX language extension and transcompiler to LaTeX.
  • Feather Helper helps to cache 2D numpy arrays and pandas dataframes.
  • Matplotlib Helper is my custom helper to tune Matplotlib experience.
  • Pandas Helper helps print dataframes to Markdown.
Pandoctools is a tool for converting markdown document. But we also need tools for writing markdown and deploying python/Jupyter code blocks.
And the best one for it is:

Examples markdown to ipynb

Here are examples that demonstrate converting documents:

  • from markdown .md with Jupyter python code blocks, SugarTeX math and cross-references to ipynb notebook.
  • from Hydrogen/python notebook .py with Atom/Hydrogen code cells, Knitty markdown incerts (again with SugarTeX math and cross-references) to .ipynb notebook.

Install

Windows:

Via conda:

  • Install Miniconda,

  • Install Git together with Bash. Git is needed for writing text conversion profiles in cross-platform bash language instead of Windows-only batch language (that is supported by Pandoctools anyway),

  • :

    call activate root
    conda update conda
    conda create -n myenv python=3 pip setuptools
    
    call activate myenv
    conda update python pip setuptools
    
    conda install -c defaults -c conda-forge "pip>=10.0.1" "pandoc>=2.3.1" matplotlib ^
    feather-format jupyter_core traitlets ipython jupyter_client nbconvert pandocfilters ^
    pypandoc click psutil nbformat pandoc-attributes six pyyaml notebook jupyter future ^
    shutilwhich cython pywin32 pandas
    
    chcp 1252
    pip install panflute knitty sugartex shortcutter pandoctools pandoctools-ready
    
  • Install latest stable pandoc-crossref (compatible with pandoc version) to <miniconda-path>/envs/myenv/Library/bin,

  • Tips:

    • If Pandoc errors try downgrade to "pandoc>=2.0,<2.1" and pandoc-crossref v0.3.0.1,
    • Should be "conda>=4.5.4" (conda update conda should be enough).

Via pip:

  • :

    pip install pandoctools pandoctools-ready
    
  • Install latest stable pandoc-crossref (compatible with pandoc version) to <miniconda-path>/envs/myenv/Scripts,

Unix:

Via conda:

  • Install Miniconda,

  • :

    source activate root
    conda update conda
    conda create -n myenv python=3 pip setuptools
    
    source activate myenv
    conda update python pip setuptools
    
    conda install -c defaults -c conda-forge "pip>=10.0.1" "pandoc>=2.3.1" matplotlib \
    feather-format jupyter_core traitlets ipython jupyter_client nbconvert pandocfilters \
    pypandoc click psutil nbformat pandoc-attributes six pyyaml notebook jupyter future \
    shutilwhich cython pandas
    
    pip install panflute knitty sugartex shortcutter pandoctools pandoctools-ready
    
  • Install latest stable pandoc-crossref (compatible with pandoc version) to <miniconda-path>/envs/myenv/bin,

  • Tips:

    • If Pandoc errors try downgrade to "pandoc>=2.0,<2.1" and pandoc-crossref v0.3.0.1,
    • Should be "conda>=4.5.4" (conda update conda should be enough).

Via pip:

  • :

    pip install pandoctools pandoctools-ready
    
  • Install latest stable pandoc-crossref (compatible with pandoc version) to <miniconda-path>/envs/myenv/bin.

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pandoctools-0.4.17.tar.gz (71.6 kB) Copy SHA256 hash SHA256 Source None Oct 12, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page