=================
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": null,
"docs_url": null,
"requires_python": ">=3.3",
"maintainer_email": null,
"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/b8/f0/4b48fae9db2232746b4cb94c5f1aa32200e64141645c762c0487388bbd38/sphinx_csv_filter-0.4.2.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.2",
"project_urls": {
"Homepage": "https://github.com/crate/sphinx_csv_filter"
},
"split_keywords": [
"sphinx",
"csv",
"filter",
"docutils",
"directive",
"plugin",
"csv-table",
"csv-filter",
"restructuredtext"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "21943813d9b82dd4b9c73349529aec1554f7d29e7f33a29c0a866cf2ca6a0890",
"md5": "771cecd6d0463b8373d3c58b0babab3e",
"sha256": "23b804dec644a5ade4b64fb142b2116837b5166bbd5f264dd9d49910b07b3bcd"
},
"downloads": -1,
"filename": "sphinx_csv_filter-0.4.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "771cecd6d0463b8373d3c58b0babab3e",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.3",
"size": 9186,
"upload_time": "2024-08-21T11:07:15",
"upload_time_iso_8601": "2024-08-21T11:07:15.186729Z",
"url": "https://files.pythonhosted.org/packages/21/94/3813d9b82dd4b9c73349529aec1554f7d29e7f33a29c0a866cf2ca6a0890/sphinx_csv_filter-0.4.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b8f04b48fae9db2232746b4cb94c5f1aa32200e64141645c762c0487388bbd38",
"md5": "614c8058b1c1ff158cf3cfe2bc88d764",
"sha256": "e6d1614ca30d85403a5ce668f6348a9aeecab8bf7238a3d13723d3c56e9daa34"
},
"downloads": -1,
"filename": "sphinx_csv_filter-0.4.2.tar.gz",
"has_sig": false,
"md5_digest": "614c8058b1c1ff158cf3cfe2bc88d764",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.3",
"size": 10442,
"upload_time": "2024-08-21T11:07:16",
"upload_time_iso_8601": "2024-08-21T11:07:16.486733Z",
"url": "https://files.pythonhosted.org/packages/b8/f0/4b48fae9db2232746b4cb94c5f1aa32200e64141645c762c0487388bbd38/sphinx_csv_filter-0.4.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-21 11:07:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "crate",
"github_project": "sphinx_csv_filter",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "sphinx-csv-filter"
}