Skip to main content

Conventions for writing code in the notebook.

Project description

pidgy literate notebook programming

Binder Documentation Status Python package PyPI - Python Version

pidgy is literate programming kernel and shell for IPython. When pidgy is enabled:

  • Write code in markdown, indented and fenced are executed.
  • doctests in markdown are tested.
  • Include objects in markdown with jinja2 template syntax.
  • notebooks can be woven and tangled as documentation and code.
  • notebooks can be reproduced as tests.
  • ".md.ipynb" is a composite extension that indicates pidgy notebooks primarly written in markdown

The pidgy programming paper.

pidgy is written as literate programming in notebooks; the narrative develop together into a cohesive program that serves dually as literature and reusable source code.

import pidgy

pidgy command line application

Install the IPython kernels

Install the pidgy kernel so you can use whenever you want.

pidgy kernel install

Load the IPython extension

Otherwise, using the pidgy IPython extension any jupyter notebook.

%load_ext pidgy

Likely, the only other paper of the api you made need is the pidgy.pidgyLoader that allows pidgy documents to be imported as normal source code. The loader searches for notebooks with the ".md.ipynb" extension and adds them to the python import system.

reuse pidgy documents as modules

with pidgy.pidgyLoader():
    import readme
assert readme.__file__.endswith('.md.ipynb')

testing pidgy notebooks.

pidgy is a pytest plugin that can be used to include literature (eg. blog posts, issues, docs) in software test suites.

pytest --nbval--doctest-modules

The plurality of pidgy

Above we've highlight a few outcomes of pidgy programming. pidgy is written as both documentation and source code therefore it can be viewed by the following tools.

Project details

Download files

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

Files for pidgy, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size pidgy-0.2.2-py3-none-any.whl (35.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pidgy-0.2.2.tar.gz (26.6 kB) File type Source Python version None Upload date Hashes View hashes

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 DigiCert DigiCert EV certificate StatusPage StatusPage Status page