Skip to main content

Sphinx directives for CSV-powered tabular authoring.

Project description

sphinx-tabular

PyPI Python Docs Downloads

Full documentation

Instead of just modifying the final table output, sphinx-tabular builds real docutils table nodes (table/tgroup/row/entry) the same way docutils' own table directives do, and only overrides the HTML rendering of table cells (for colspan/rowspan/inline styling) — the rest of the output is generated by Sphinx's normal HTML writer.

While the table structure and merged cells will work in the LaTeX builder PDF output, the table formatting (colors, icons, bacgkround color, text color, and alignment) is HTML only.

Donations to help support this project...

Venmo

Features

  • Sphinx extension.
  • Uses standard CSV file format.
  • Easily merge table cells with < and ^.
  • Support reStructuredText and Markdown.
  • Support for inline table data and external files.
  • Optional sticky header support for one or more header rows.
  • Provides a minimal set of spreadsheet formulas.
  • Set table cell alignment and per-cell alignment in both horizontal and vertical directions.
  • Set custom cell text and background colors.
  • Custom status pill.
  • Support for Font Awesome and Bootstrip icons if installed by your theme.

Installation

pip install sphinx-tabular

conf.py

extensions = [
    ...,
    'sphinx_tabular',
    ...,
]

Directives

RST, external file:

.. rcsv-table:: Title
    :file: table.rcsv

RST, inline data.

.. rcsv-table:: Title

    Col 1, Row 1
    Col 2, Row 2

Markdown, external file:

.. rcsv-table:: Title
    :file: table.rcsv

Markdown, inline data.

.. rcsv-table:: Title

    Col 1, Row 1
    Col 2, Row 2

Merging Cells

Columns

.. rcsv-table:: Title

    Merged,<
    Unmerged, Unmerged

Rows

.. rcsv-table:: Title

    Merged,Unmerged
    ^, Unmerged

Additional Capabilities

See full documentation for additional capabilities:

Formatting

  • Custom theming.
  • =ALIGN() horizontal/vertical cell value alignment.
  • =BG() set the background cell color.
  • =FG() set text color.
  • =ICON() use a Font Awesome or Bootstrap icon, or a fallback.
  • =STATUS() insert a colored status pill.

Spreadsheet

  • ' interprest as literal text without evaluation.
  • +,-,*,/ arithmetic operations on cells.
  • =C4 cell references.
  • =A4:B4 cell ranges.
  • =AVG() take the average.
  • =CONCAT() concatenation of cell values.
  • =COUNT() count number of numerical values.
  • =IF() conditional evaluation.
  • =MAX() find the maximum value.
  • =MIN() find the minimum value.
  • =ROUND() round the number to an int or the specified decimal places.
  • =SUM() sum a set or range of values.

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

sphinx_tabular-0.2.1.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_tabular-0.2.1-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_tabular-0.2.1.tar.gz.

File metadata

  • Download URL: sphinx_tabular-0.2.1.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sphinx_tabular-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9182f86bff183172ca9b62f7e9e5684382947ddc4fcef51b6937a896bdc6395a
MD5 d26b304f6e4c74fb72b0096117ea756e
BLAKE2b-256 8fb0759cc97dcceb38dfe6aedaa17fb3f9012ccdf7cea798ba182145ba960a6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_tabular-0.2.1.tar.gz:

Publisher: publish.yml on deepthinker2001/sphinx-tabular

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_tabular-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: sphinx_tabular-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sphinx_tabular-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab9dbaadae669dd2bffdbe1842512c8adc44e263626e0de8228b53d9544f928e
MD5 c4c3e71a13cd6cca5ece974c231b0ed9
BLAKE2b-256 6c779dfb06cfd07f588477516bd5475ae8bacba5a94fdb5fa29527aae26221c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_tabular-0.2.1-py3-none-any.whl:

Publisher: publish.yml on deepthinker2001/sphinx-tabular

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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