Skip to main content

Papyri – in progress

Project description

Papyri

See the legendary Villa of Papyri, who get its name from it's collection of many papyrus scrolls.

What

A set of tools to build better documentation for Python project.

  • Opinionated therefore can understand more about the structure of your project.
  • Allow automatic cross link (back and forth) between documentation across python packages.
  • Use a documentation IR, to separate building the docs from rendering the docs in many contexts.

This should hopefully allow a conda-forge-like model, where project upload their IR to a given repo, and a single website that contain multiple project documentation (without sub domains) can be build with better cross link between project and efficient page rebuild.

This should also allow to reader documentation on non html backend (think terminal), or provide documentation if IDE (Spyder/Jupyterlab), without having to iframe it.

install

You may need to get a modified version of numpydoc depending on the stage of development.

# clone this repo
# cd this repo
pip install flit
flit install --symlink

Instructions / Overview

In the end there should be roughly 3 steps:

generation (gen.py module_name),

Which collect the documentation of a project into a doc-bundle; a number of doc-blobs (currently json file), with a defined semantic structure, and some metadata (version of the project this documentation refers to, and potentially some other blobs)

During the generation a number of normalisation and inference can and should happen, for example

  • using type inference into the Examples sections of docstrings and storing those as pairs (token, reference), so that you can later decide that clicking on np.array in an example brings you to numpy array documentation; whether or not we are currently in the numpy doc.
  • Parsing "See Also" into a well defined structure
  • running Example to generate images for docs with images (not implemented)
  • resolve package local references for example building numpy doc "zeroes_like" is non ambiguous and shoudl be Normalized to "numpy.zeroes_like", ~.pyplot.histogram, normalized to matplotlib.pyplot.histogram as the target and histogram as the text ...etc.

The Generation step is likely project specific, as there might be import conventions that are per-project and should not need to be repeated (import pandas as pd, for example,)

Ingestion (crosslink.py)

The ingestion step take doc-bundle and/or doc-blobs and add them into a graph of known items; the ingestion is critical to efficiently build the collection graph metadata and understand which items refers to which; this allow the following:

  • Update the list of backreferences to a docbundle
  • Update forward references metadata to know whether links are valid.

Currently the ingestion loads all in memory and update all the bundle in place but this can likely be done more efficiently.

A lot more can likely be done at larger scale, like detecting if documentation have changed in previous version so infer for which versions of a library this documentation is valid.

There is also likely some curating that might need to be done at that point, as for example, numpy.array have an extremely large number of back-references.

Rendering (render.py)

Rendering can be done on on client side, which allows a lot of flexibility and customisation.

  1. on a client IDE; the links can allow to navigate in the doc "Inspector" (for example spyder) and will/can link only to already existing libraries of current environment.

  2. online experience can allow (back-)links to private doc-bundles to users.

Usage

Still quite hackish for now:

$ mkdir html
$ mkdir cache
$ rm htmls/*.html
$ python gen.py module_names
$ python crosslink.py
$ python render.py

Project details


Download files

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

Source Distribution

papyri-0.0.1.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

papyri-0.0.1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file papyri-0.0.1.tar.gz.

File metadata

  • Download URL: papyri-0.0.1.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.24.0

File hashes

Hashes for papyri-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7af6d138ae744636fba2e9b5ec52af2d4e04d2b7e1b78accf9bc0d95bbd7144c
MD5 1e1e49028595462e6888402164c4c9fb
BLAKE2b-256 cc20aa2283ef6df0668794753d1f81c9003bc7ab5d389677cf0facf214459ddc

See more details on using hashes here.

File details

Details for the file papyri-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: papyri-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.24.0

File hashes

Hashes for papyri-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9bddb55279752dc9c5c8a94fe27ec967ce20ea681e1c85e27fb2fc64a627c4a4
MD5 9675b3b30a18dbe185c1b6c7acd09d75
BLAKE2b-256 1fe402f73d1d233025f6bf189b13d406c81f13988789e0d4dddef2a2b7b1c761

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page