Sphinx CSV filter extension for Crate Documentation
Project description
A Sphinx plugin that extends the csv-table reStructuredText directive to add row filtering options.
Prerequisites
You need to be using Sphinx and reStructuredText.
Installation
The Sphinx CSV filter plugin is available as a pip package.
To install, run:
$ pip install sphinx-csv-filter
To update, run:
$ pip install -U sphinx-csv-filter
Set Up
To include the extension, add this line to config.py in your Sphinx project:
extensions = ['crate.sphinx.csv']
If you’re using other extensions, edit the existing list, or add this:
extensions.append('crate.sphinx.csv')
Use
This plugin adds the :exclude: option to the csv-table directive. This option takes a Python dict specifying the column index (starting at zero) and a regular expression. Rows are excluded if the columnar value matches the supplied regular expression.
Here’s an example:
.. csv-table:: Example Table :header: Company,Contact,Country,Attend? :file: example.csv :exclude: {3: '(?i)Y\w*'}
In this example, rows from example.csv will be omitted from the output if the regular expression (?i)Y\w* matches value of the Attend? column.
Contributing
This project is primarily maintained by Crate.io, but we welcome community contributions!
See the developer docs and the contribution docs for more information.
Help
Looking for more help?
Check StackOverflow for common problems
Chat with us on Slack
Get paid support
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
Built Distribution
File details
Details for the file sphinx-csv-filter-0.2.0.tar.gz
.
File metadata
- Download URL: sphinx-csv-filter-0.2.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b51b1f66b2cbdd2303aa62b01cbc572f4d4740f24390fab728a9488c5425290c |
|
MD5 | 0fd69aa54e799a4a4b1c81621da1d825 |
|
BLAKE2b-256 | 45b52563573bc7f8aaaa6b2ac5ddee3514936490a88d43078c5a7613587726ee |
Provenance
File details
Details for the file sphinx_csv_filter-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: sphinx_csv_filter-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bf159b20eb01ac1b26eb5ce7eb247d19270e7daea7ce91d8a92ff27c3a80eda |
|
MD5 | be04b52245e4d98350706c9a9cc4ba10 |
|
BLAKE2b-256 | 5854a1cca5b79a9a82628d17cb21ab66afb7c478c9d24cce6d476cdc47cdf26b |