=================
Sphinx CSV filter
=================
.. image:: https://github.com/crate/sphinx_csv_filter/actions/workflows/tests.yml/badge.svg
:target: https://github.com/crate/sphinx_csv_filter/actions/workflows/tests.yml
:alt: CI outcome
.. image:: https://codecov.io/gh/crate/sphinx_csv_filter/branch/main/graph/badge.svg
:target: https://app.codecov.io/gh/crate/sphinx_csv_filter
:alt: Test suite code coverage
.. image:: https://img.shields.io/pypi/v/sphinx-csv-filter.svg
:target: https://pypi.org/project/sphinx-csv-filter/
:alt: Supported Python versions
.. image:: https://img.shields.io/pypi/pyversions/sphinx-csv-filter.svg
:target: https://pepy.tech/project/sphinx-csv-filter
:alt: Package version on PyPI
.. image:: https://pepy.tech/badge/sphinx-csv-filter/month
:target: https://pepy.tech/project/sphinx-csv-filter
:alt: PyPI downloads per month
.. image:: https://img.shields.io/pypi/status/sphinx-csv-filter.svg
:target: https://pypi.org/project/sphinx-csv-filter/
:alt: Project status (alpha, beta, stable)
.. image:: https://img.shields.io/pypi/l/sphinx-csv-filter.svg
:target: https://pypi.org/project/sphinx-csv-filter/
:alt: License
|
A CSV filter directive for docutils and `Sphinx`_, that extends the
"`csv-table`_" `reStructuredText`_ directive to add row filtering options.
Details
=======
The package depends on ``docutils``, it provides a ``CSVFilterDirective``,
extending ``CSVTable``. When used as a Sphinx extension, it will register the
``csv-filter`` `Sphinx directive`_.
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 following options to the csv-table_ directive:
``:included_cols:``
This is a comma-separated list of column indexes to include in the output.
``:include:``
This option takes a Python dict specifying the column index (starting at
zero) and a regular expression. Rows are included if the columnar value
matches the supplied regular expression.
``:exclude:``
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.
If a row matches an ``:include:`` as well as an ``:exclude:`` filter, the row
with be excluded.
Here's an example::
.. csv-filter:: 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 out our `support channels`_.
.. _contribution docs: CONTRIBUTING.rst
.. _Crate.IO: https://crate.io/
.. _csv-table: https://docutils.sourceforge.io/docs/ref/rst/directives.html#csv-table
.. _developer docs: DEVELOP.rst
.. _pip: https://pypi.org/project/pip/
.. _reStructuredText: https://www.sphinx-doc.org/en/stable/rest.html
.. _Sphinx: https://www.sphinx-doc.org/
.. _Sphinx directive: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html
.. _support channels: https://crate.io/support/
Raw data
{
"_id": null,
"home_page": "https://github.com/crate/sphinx_csv_filter",
"name": "sphinx-csv-filter",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.3",
"maintainer_email": "",
"keywords": "sphinx csv filter docutils directive plugin csv-table csv-filter restructuredtext",
"author": "Crate.IO GmbH",
"author_email": "office@crate.io",
"download_url": "https://files.pythonhosted.org/packages/49/c7/98cb1556db77b5cefa0d2e8a669138be992116ca6c5af17e9bb60a691bef/sphinx-csv-filter-0.4.1.tar.gz",
"platform": "any",
"description": "=================\nSphinx CSV filter\n=================\n\n.. image:: https://github.com/crate/sphinx_csv_filter/actions/workflows/tests.yml/badge.svg\n :target: https://github.com/crate/sphinx_csv_filter/actions/workflows/tests.yml\n :alt: CI outcome\n\n.. image:: https://codecov.io/gh/crate/sphinx_csv_filter/branch/main/graph/badge.svg\n :target: https://app.codecov.io/gh/crate/sphinx_csv_filter\n :alt: Test suite code coverage\n\n.. image:: https://img.shields.io/pypi/v/sphinx-csv-filter.svg\n :target: https://pypi.org/project/sphinx-csv-filter/\n :alt: Supported Python versions\n\n.. image:: https://img.shields.io/pypi/pyversions/sphinx-csv-filter.svg\n :target: https://pepy.tech/project/sphinx-csv-filter\n :alt: Package version on PyPI\n\n.. image:: https://pepy.tech/badge/sphinx-csv-filter/month\n :target: https://pepy.tech/project/sphinx-csv-filter\n :alt: PyPI downloads per month\n\n.. image:: https://img.shields.io/pypi/status/sphinx-csv-filter.svg\n :target: https://pypi.org/project/sphinx-csv-filter/\n :alt: Project status (alpha, beta, stable)\n\n.. image:: https://img.shields.io/pypi/l/sphinx-csv-filter.svg\n :target: https://pypi.org/project/sphinx-csv-filter/\n :alt: License\n\n|\n\nA CSV filter directive for docutils and `Sphinx`_, that extends the\n\"`csv-table`_\" `reStructuredText`_ directive to add row filtering options.\n\nDetails\n=======\n\nThe package depends on ``docutils``, it provides a ``CSVFilterDirective``,\nextending ``CSVTable``. When used as a Sphinx extension, it will register the\n``csv-filter`` `Sphinx directive`_.\n\nInstallation\n============\n\nThe Sphinx CSV filter plugin is available as a pip_ package.\n\nTo install, run::\n\n $ pip install sphinx-csv-filter\n\nTo update, run::\n\n $ pip install -U sphinx-csv-filter\n\nSet Up\n======\n\nTo include the extension, add this line to ``config.py`` in\nyour Sphinx project::\n\n extensions = ['crate.sphinx.csv']\n\nIf you're using other extensions, edit the existing list, or add this::\n\n extensions.append('crate.sphinx.csv')\n\nUse\n===\n\nThis plugin adds the following options to the csv-table_ directive:\n\n``:included_cols:``\n This is a comma-separated list of column indexes to include in the output.\n\n``:include:``\n This option takes a Python dict specifying the column index (starting at\n zero) and a regular expression. Rows are included if the columnar value\n matches the supplied regular expression.\n\n``:exclude:``\n This option takes a Python dict specifying the column index (starting at\n zero) and a regular expression. Rows are excluded if the columnar value\n matches the supplied regular expression.\n\nIf a row matches an ``:include:`` as well as an ``:exclude:`` filter, the row\nwith be excluded.\n\nHere's an example::\n\n .. csv-filter:: Example Table\n :header: Company,Contact,Country,Attend?\n :file: example.csv\n :exclude: {3: '(?i)Y\\w*'}\n\nIn 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.\n\nContributing\n============\n\nThis project is primarily maintained by `Crate.IO`_, but we welcome community\ncontributions!\n\nSee the `developer docs`_ and the `contribution docs`_ for more information.\n\nHelp\n====\n\nLooking for more help?\n\n- Check out our `support channels`_.\n\n.. _contribution docs: CONTRIBUTING.rst\n.. _Crate.IO: https://crate.io/\n.. _csv-table: https://docutils.sourceforge.io/docs/ref/rst/directives.html#csv-table\n.. _developer docs: DEVELOP.rst\n.. _pip: https://pypi.org/project/pip/\n.. _reStructuredText: https://www.sphinx-doc.org/en/stable/rest.html\n.. _Sphinx: https://www.sphinx-doc.org/\n.. _Sphinx directive: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html\n.. _support channels: https://crate.io/support/\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "A CSV filter directive for docutils and Sphinx, that extends the \"csv-table\" reStructuredText directive to add row filtering options.",
"version": "0.4.1",
"split_keywords": [
"sphinx",
"csv",
"filter",
"docutils",
"directive",
"plugin",
"csv-table",
"csv-filter",
"restructuredtext"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6d92d4c25b92599cf9fc0959b9df4c2be8c34d3943e0ce570909f37cefe2369b",
"md5": "adddf607c5104750d13f1b77d8056fea",
"sha256": "4dda4a2ed46722e3fd0891053e3e08b5c2668986f52148a71f1e2a0254cc94d7"
},
"downloads": -1,
"filename": "sphinx_csv_filter-0.4.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "adddf607c5104750d13f1b77d8056fea",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.3",
"size": 9246,
"upload_time": "2023-04-18T16:23:48",
"upload_time_iso_8601": "2023-04-18T16:23:48.096944Z",
"url": "https://files.pythonhosted.org/packages/6d/92/d4c25b92599cf9fc0959b9df4c2be8c34d3943e0ce570909f37cefe2369b/sphinx_csv_filter-0.4.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "49c798cb1556db77b5cefa0d2e8a669138be992116ca6c5af17e9bb60a691bef",
"md5": "6ef676a37ba970d18fe942a73863c4d6",
"sha256": "f63b136b448e9e4f9fb389fd6ac2b0513a894f475e3c79a591bee59c3e70ed42"
},
"downloads": -1,
"filename": "sphinx-csv-filter-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "6ef676a37ba970d18fe942a73863c4d6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.3",
"size": 10454,
"upload_time": "2023-04-18T16:23:52",
"upload_time_iso_8601": "2023-04-18T16:23:52.319469Z",
"url": "https://files.pythonhosted.org/packages/49/c7/98cb1556db77b5cefa0d2e8a669138be992116ca6c5af17e9bb60a691bef/sphinx-csv-filter-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-18 16:23:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "crate",
"github_project": "sphinx_csv_filter",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "sphinx-csv-filter"
}