jacquev6 / RecursiveDocument

Python library formating, in a console-friendly and human-readable way, a document specified through its structure

Home Page:http://pythonhosted.org/RecursiveDocument/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DO NOT USE THIS LIBRARY: it was written to support InteractiveCommandLine, and the click library is vastly better. I will not fix anything in this library and I'm migrating my own projects to click.

RecursiveDocument is a Python (2.7+ and 3.3+) library formating, in a console-friendly and human-readable way, a document specified through its structure (sections, sub-sections, paragraphs, etc.). It is especially well suited for printing help messages for command-line executables.

It's licensed under the MIT license. It's available on the Python package index, its documentation is hosted by Python and its source code is on GitHub.

https://badge.waffle.io/jacquev6/RecursiveDocument.png?label=ready&title=ready

Quick start

Install from PyPI:

$ pip install RecursiveDocument

Import:

>>> from RecursiveDocument import *

Create a document:

>>> doc = Document().add(
...   Section("Introduction")
...     .add("This is the first paragraph of a very interesting story. It begins with this paragraph.")
...     .add("After the first paragraph comes the second paragraph. As incredible as it may sound, it can go on and on and on...")
... )

And print it:

>>> print doc.format()
Introduction
  This is the first paragraph of a very interesting story. It begins
  with this paragraph.
<BLANKLINE>
  After the first paragraph comes the second paragraph. As incredible
  as it may sound, it can go on and on and on...

About

Python library formating, in a console-friendly and human-readable way, a document specified through its structure

http://pythonhosted.org/RecursiveDocument/

License:MIT License


Languages

Language:Python 100.0%