Skip to main content

Sphinx extension for embedding values extracted from Python modules

Project description

A Sphinx extension for embedding Python object values into documentation as text, lists or tables.

This is achieved by adding new roles and directives which refer to Python objects which contain the values to be represented. The extension provides roles for embedded single and lists of values, and a sophisticated directive for rendering complex data structures like lists of dictionaries as tables.

Status

Build status:

CI Status Documentation Status

Installation

The added-value package is available on the Python Package Index (PyPI):

https://badge.fury.io/py/added-value.svg

The package supports Python 3 only. To install:

$ pip install added-value

Usage

Added Value provides a number of roles and directives for embedding Python values into your documentation. For example, sing added value we can extract the value of pi from the Python Standard Library math module, and embed it in a sentence, using the format role provided by Added Values, like this:

The ratio of the circumference to the diameter of a circle is :format:`math.pi, .3f` to three
decimal places.

Which gives:

The ratio of the circumference to the diameter of a circle is 3.142 to three decimal places.

Powerful tools

Added value is powerful, and allows lists, dictionaries, and even complex data structures such as lists of lists of dictionaries to be rendered into tables in various ways. Consult the documentation for more details.

Copyright 2023 Sixty North AS

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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

added-value-0.22.2.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

added_value-0.22.2-py2.py3-none-any.whl (31.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file added-value-0.22.2.tar.gz.

File metadata

  • Download URL: added-value-0.22.2.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for added-value-0.22.2.tar.gz
Algorithm Hash digest
SHA256 f04648505a0221b723e4f794fca8171878bfdd554f398fe4d5e6765e6321b4ac
MD5 fcde2270ca6713712a701fb4a187eed0
BLAKE2b-256 60e722d1d45ec6e40afa834ae2ba1b2d7fcc4690fa1db77636ea02077218434b

See more details on using hashes here.

File details

Details for the file added_value-0.22.2-py2.py3-none-any.whl.

File metadata

  • Download URL: added_value-0.22.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for added_value-0.22.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 34bcad01f3e06cfc8fc85043bd07ad92849867d774d29b7ec65d82eeffd8cf74
MD5 90bbcd0e79453d258895b372ad4885bd
BLAKE2b-256 b7a9f3301adaa13853ab9411c24ed0ae1fa43de4c619501089405abdcb2aa3c1

See more details on using hashes here.

Supported by

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