• Stars
    star
    487
  • Rank 89,765 (Top 2 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created over 8 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Pythonic alternative to John MacFarlane's pandocfilters, with extra helper functions

Panflute: Pythonic Pandoc Filters

Development Status Build Status License DOI

GitHub Releases PyPI version Conda Version Python version Supported implementations

panflute is a Python package that makes creating Pandoc filters fun.

For a detailed user guide, documentation, and installation instructions, see http://scorreia.com/software/panflute/. For examples that you can use as starting points, check the examples repo, the sample template, or this github search. If you want to contribute, head here.

You might also find useful this presentation on how I use markdown+pandoc+panflute to write research papers (at the Banco de Portugal 2019 Workshop on Reproductible Research).

Installation

Pip

To manage panflute using pip, open the command line and run

  • pip install panflute to install
    • pip install "panflute[extras]" to include extra dependencies (yamlloader)
  • pip install -U panflute to upgrade
  • pip uninstall panflute to remove

You need a matching pandoc version for panflute to work flawlessly. See [Supported pandoc versions] for details. Or, use the [Conda] method to install below to have the pandoc version automatically managed for you.

Conda

To manage panflute with a matching pandoc version, open the command line and run

  • conda install -c conda-forge pandoc 'panflute>=2.0.5' to install both conda install -c conda-forge pandoc 'panflute>=2.0.5' yamlloader to include extra dependencies
  • conda update pandoc panflute to upgrade both
  • conda remove pandoc panflute to remove both

You may also replace conda by mamba, which is basically a drop-in replacement of the conda package manager. See mamba-org/mamba: The Fast Cross-Platform Package Manager for details.

Note on versions

Supported Python versions

panflute 1.12 or above dropped support of Python 2. When using Python 3, depending on your setup, you may need to use pip3/python3 explicitly. If you need to use panflute in Python 2, install panflute 1.11.x or below.

Currently supported Python versions: Python version. Check setup.py for details, which further indicates support of pypy on top of CPython.

Supported pandoc versions

pandoc versioning semantics is MAJOR.MAJOR.MINOR.PATCH and panflute's is MAJOR.MINOR.PATCH. Below we shows matching versions of pandoc that panflute supports, in descending order. Only major version is shown as long as the minor versions doesn't matter.

panflute version supported pandoc versions supported pandoc API versions
2.3.0 2.11.0.4–3.0.x 1.22–1.23
2.2.4 2.11.0.4–2.17.x 1.22–1.22.1
2.1.x 2.11.0.4β€”2.14.x 1.22
2.0 2.11.0.4β€”2.11.x 1.22
not supported 2.10 1.21
1.12 2.7-2.9 1.17.5–1.20

Note: pandoc 2.10 is short lived and 2.11 has minor API changes comparing to that, mainly for fixing its shortcomings. Please avoid using pandoc 2.10.

Dev Install

After cloning the repo and opening the panflute folder, run

  • python setup.py install to install the package locally
  • python setup.py develop to install locally with a symlink so changes are automatically updated

Contributing

Feel free to submit push requests. For consistency, code should comply with pep8 (as long as its reasonable), and with the style guides by @kennethreitz and google. Read more here.

License

BSD3 license (following pandocfilters by @jgm).

Changelog

  • 2.3.0 Update Pandoc API from 1.22 to 1.23 (Pandoc 3.0):
    • Add Figure block object
    • Remove Null block object (scheduled for removed)

More Repositories

1

reghdfe

Linear, IV and GMM Regressions With Any Number of Fixed Effects
Stata
194
star
2

ftools

Fast Stata commands for large datasets
Stata
123
star
3

ppmlhdfe

Poisson pseudo-likelihood regression with multiple levels of fixed effects
HTML
62
star
4

ivreghdfe

Run IV/2SLS with many levels of fixed effects (i.e. ivreg2+reghdfe)
Stata
62
star
5

panflute-filters

Pandoc filters that use Panflute
Python
55
star
6

quipucamayoc

dev repo for article
Python
11
star
7

pandocmk

Python library that simplifies running Pandoc
Python
10
star
8

stata-misc

Miscellaneous Stata Commands
Stata
10
star
9

sublime-stata

Sublime Text package for Stata (improved syntax, snippets, and shortcuts)
Python
8
star
10

parse-smcl

Parse SMCL Help Files into Markdown and HTML
Python
8
star
11

stata-require

Ensure package requirements are met
Stata
7
star
12

data-covid-minsa

limpieza rapida de datos de covid de minsa
Stata
7
star
13

stata-schemes

Some personal Stata figure schemes (styles)
Stata
5
star
14

useful-stata

Do file that quickly installs useful Stata programs
Stata
5
star
15

egenfast

Because -egen- is too slow
Stata
4
star
16

stata-ensemble-ocr

Stata package that combines different versions of the same variable, each obtained from different OCR engines or scans
Stata
3
star
17

quipu

Manage Stata Estimation Results
Stata
2
star
18

fedplot

R package to create ggplot2 charts in the style used by the Fed's FSR
R
2
star
19

xtsmooth

Panel version of Stata's -smooth- command
Stata
2
star
20

panflute-dockerfiles

Experimental docker files for panflute
Dockerfile
1
star
21

geocode_ip

Geocode IP addresses in Stata
Stata
1
star
22

bcrpuse

Stata module to Import data from the Peruvian Central Bank (BCRP)
Stata
1
star