{ "info": { "author": "Brad Brown", "author_email": "brad@bradsbrown.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "TableRead\n=========\n\nTableRead is a script designed to read reStructredText (reST) `simple tables`_ from a file and convert them into Python objects.\n\n\nQuickstart\n----------\n\nSay you have a simple table like this located in a ``./example.rst``::\n\n ++++++++++++\n Damage Doers\n ++++++++++++\n\n ====== === ==============\n Name Age Favorite Color\n ====== === ==============\n Mookie 26 Red\n Andrew 24 Red\n JD 31 Red\n Xander 26 Red\n ====== === ==============\n\nHere are a few useful things you can do with that table::\n\n >>> from tableread import SimpleRSTReader\n >>>\n >>> reader = SimpleRSTReader(\"./example.rst\")\n >>> reader.tables\n ['Damage Doers']\n >>>\n >>> table = reader[\"Damage Doers\"]\n >>> table.fields\n ['name', 'age', 'favorite_color']\n >>>\n >>> for row in table:\n ... print(row.favorite_color)\n ...\n Red\n Red\n Red\n Red\n >>>\n >>> for row in table.matches_all(age=\"26\"):\n ... print(row.name)\n ...\n Mookie\n Xander\n >>>\n >>> for row in table.exclude_by(age=\"26\"):\n ... print(row.name)\n ...\n Andrew\n JD\n\nUsage\n-----\n\n``class tableread.SimpleRSTReader(file_path)``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n Parse a reStructredText file, ``file_path``, and convert any simple tables into ``SimpleRSTTable`` objects.\n Individual tables can be accessed using the table name as the key (``SimpleRSTReader['table_name']``)\n\n**data**\n An OrderedDict of the table(s) found in the reST file. The key is either the\n section header before the table name from the file, or ``Default`` for tables not under a header.\n For multiple tables in a section (or multiple ``Default`` tables),\n subsequent tables will have a incrementing number appended to the key: ``Default``, ``Default_2``, etc.\n The value is a ``SimpleRSTTable`` object.\n\n**tables**\n A list of the table names; an alias for ``list(data.keys())``\n\n**first**\n A helper to get the first table found in the file; an alias for\n ``list(self.data.values())[0]``\n\n\n``class tableread.SimpleRSTTable(header, rows, column_spans)``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n A representation of an individual table. In addition to the methods below,\n you may iterate over the table itself as a shortcut (``for entry in table:``),\n which will yield from ``table.data``.\n ``len(table)`` will also return the number of entries in ``table.data``.\n\n**data**\n A list of namedtuples with ``fields`` as the names.\n\n**fields**\n A tuple of the table fields, as used in the ``data`` namedtuple.\n Field names are adapted from table columns by lower-casing,\n and replacing spaces and periods with underscores.\n\n**from_data(data)**\n A helper function to create an object with. Expects a prepared list of namedtuples.\n\n**matches_all(**kwargs)**\n Given a set of key/value filters, returns a new TableRead object with only\n the filtered data, that can be iterated over.\n Values may be either a simple value (str, int) or a function that returns a boolean.\n See Quickstart_ for an example.\n\n Note: When filtering both keys and values are **not** case sensitive.\n\n**exclude_by(**kwargs)**\n Given a set of key/value filters, returns a new TableRead object without the\n matching data, that can be iterated over.\n Values may be either a simple value (str, int) or a function that returns a boolean.\n See Quickstart_ for an example.\n\n Note: When filtering both keys and values are **not** case sensitive.\n\n**get_fields(*fields)**\n Given a list of fields, return a list of only the values associated with those fields.\n A single field returns a list of values, multiple fields returns a list of value tuples.\n\n\n.. _`simple tables`: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#simple-tables\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://jolly-good-toolbelt.github.io/tableread/", "keywords": "", "license": "MIT", "maintainer": "Brad Brown", "maintainer_email": "brad@bradsbrown.com", "name": "tableread", "package_url": "https://pypi.org/project/tableread/", "platform": "", "project_url": "https://pypi.org/project/tableread/", "project_urls": { "Documentation": "https://jolly-good-toolbelt.github.io/tableread/", "Homepage": "https://jolly-good-toolbelt.github.io/tableread/", "Repository": "https://github.com/jolly-good-toolbelt/tableread" }, "release_url": "https://pypi.org/project/tableread/2.0.4/", "requires_dist": [ "attrs (>=16.0.0)" ], "requires_python": ">=3.6,<4.0", "summary": "Table reader for simple reStructuredText tables", "version": "2.0.4" }, "last_serial": 5577894, "releases": { "2.0.1": [ { "comment_text": "", "digests": { "md5": "ee50444528bd5751dd087b57924a7dc7", "sha256": "7c4d0de3d85e92ed6aed97a6c87ca89dacc9599e789f22fb6e4448958eb31578" }, "downloads": -1, "filename": "tableread-2.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ee50444528bd5751dd087b57924a7dc7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 5695, "upload_time": "2019-06-14T12:13:30", "url": "https://files.pythonhosted.org/packages/b7/d5/aa5e93ed4bc0f996e83570e7a690d7b9fbe38656ffa9263e9c93aa9bf87b/tableread-2.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e53a8c01d74afdfea929a747a1ff8f8", "sha256": "d8d726334c2b1891a0e67b956069bb757c2864a642620c2b5e171f6040275f85" }, "downloads": -1, "filename": "tableread-2.0.1.tar.gz", "has_sig": false, "md5_digest": "1e53a8c01d74afdfea929a747a1ff8f8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 5321, "upload_time": "2019-06-14T12:13:32", "url": "https://files.pythonhosted.org/packages/f3/69/d535ce34e20e9d1467878cb30a1e868612d5a0b50ac98a8538eca72c18e3/tableread-2.0.1.tar.gz" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "cf8bb5c4387228ca65d6302174bf24da", "sha256": "7d7e3afcde88528d7b2702bd4a89a38e636a97b84b8c50e3a044486842b4af07" }, "downloads": -1, "filename": "tableread-2.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "cf8bb5c4387228ca65d6302174bf24da", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 7514, "upload_time": "2019-07-15T19:42:22", "url": "https://files.pythonhosted.org/packages/46/e9/fa67282a23cf6156f33cfacd1a3bd323fd234f67a4cee9f0bc548a4e1270/tableread-2.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c933e9503b04923c908466cf07da0b97", "sha256": "a067649ddf94d1d2236290bd6e7bdddc0ad55f962463490ac3fc628c655fa024" }, "downloads": -1, "filename": "tableread-2.0.3.tar.gz", "has_sig": false, "md5_digest": "c933e9503b04923c908466cf07da0b97", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 7423, "upload_time": "2019-07-15T19:42:24", "url": "https://files.pythonhosted.org/packages/8f/74/9546f798ec90f550fd274ab9d4bf33cf64b2441c426df5d1fb511d63f275/tableread-2.0.3.tar.gz" } ], "2.0.4": [ { "comment_text": "", "digests": { "md5": "35d2ecd90eacbf23b0b7bde0ab3eec29", "sha256": "363fb850591c8269e9c22dfd36bd034f0af85b6588b498f965b43fabb5680efc" }, "downloads": -1, "filename": "tableread-2.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "35d2ecd90eacbf23b0b7bde0ab3eec29", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 7514, "upload_time": "2019-07-24T14:30:37", "url": "https://files.pythonhosted.org/packages/06/f0/a2fb806df555963068e310dc26386a68c458961267791817b6c4e1328e34/tableread-2.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7cfed393128d1a791cc1b8061fa0d930", "sha256": "72299d6cc2b0b0b424a1d3d599566b26f24ba01f4808014684e3dde1a871d182" }, "downloads": -1, "filename": "tableread-2.0.4.tar.gz", "has_sig": false, "md5_digest": "7cfed393128d1a791cc1b8061fa0d930", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 7400, "upload_time": "2019-07-24T14:30:39", "url": "https://files.pythonhosted.org/packages/9b/8b/cd3e53d99cad72e9cac61a979467e7e5d7f10deb8c70c8e3ce3abdfe0645/tableread-2.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "35d2ecd90eacbf23b0b7bde0ab3eec29", "sha256": "363fb850591c8269e9c22dfd36bd034f0af85b6588b498f965b43fabb5680efc" }, "downloads": -1, "filename": "tableread-2.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "35d2ecd90eacbf23b0b7bde0ab3eec29", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 7514, "upload_time": "2019-07-24T14:30:37", "url": "https://files.pythonhosted.org/packages/06/f0/a2fb806df555963068e310dc26386a68c458961267791817b6c4e1328e34/tableread-2.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7cfed393128d1a791cc1b8061fa0d930", "sha256": "72299d6cc2b0b0b424a1d3d599566b26f24ba01f4808014684e3dde1a871d182" }, "downloads": -1, "filename": "tableread-2.0.4.tar.gz", "has_sig": false, "md5_digest": "7cfed393128d1a791cc1b8061fa0d930", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 7400, "upload_time": "2019-07-24T14:30:39", "url": "https://files.pythonhosted.org/packages/9b/8b/cd3e53d99cad72e9cac61a979467e7e5d7f10deb8c70c8e3ce3abdfe0645/tableread-2.0.4.tar.gz" } ] }