{ "info": { "author": "Yage Hu", "author_email": "yagejhu@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "=================================\nHierarchical Data Table (HDTable)\n=================================\n\nThis Python package generates grid tables that are\n`reStructuredText compliant\n`_\nfrom a data source and column specifications.\nAn example of a rendered reStructuredText grid table is:\n\n.. table:: Students, teachers, and the mascot of a class\n :name: example-class\n\n +-----------+---------+------------------+--------------+-----------+--------------+--------------+\n | Student # | Class # | Class Name | Project Name | Teacher # | Teacher Name | Class Mascot |\n +===========+=========+==================+==============+===========+==============+==============+\n | 1 | 1 | math | science fair | 1 | daniel | wombat |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+--------------+ | | |\n | | 2 | chinese | yearbook | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+--------------+ | | |\n | | 3 | computer science | robotics | | | |\n | | | | +-----------+--------------+ |\n | | | | | 2 | ethan | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+--------------+ | | |\n | | 4 | physics | esport | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n +-----------+---------+------------------+--------------+ | | |\n | 2 | 1 | math | robotics | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | +-----------+--------------+ |\n | | | | | 3 | frank | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+ | | | |\n | | 2 | chemistry | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+ | | | |\n | | 3 | physics | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | +-----------+--------------+ |\n | | | | | 4 | greg | |\n | | | | | | | |\n | | | | | | | |\n +-----------+---------+------------------+--------------+ | | |\n | 3 | 1 | english | N/A | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+ | | | |\n | | 2 | chinese | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | +-----------+--------------+ |\n | | | | | 5 | hank | |\n | +---------+------------------+ | | | |\n | | 3 | chemistry | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n +-----------+---------+------------------+--------------+ | | |\n | 4 | N/A | N/A | N/A | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n +-----------+---------+------------------+--------------+-----------+--------------+--------------+\n\nThe source for this table can be generated by HDTable with\n\n.. code-block:: python\n\n import os\n\n import yaml\n\n from hdtable.hdtable import Hdtable\n\n data_source_file = os.path.join(\"tests\", \"test_data.yml\")\n specs_file = os.path.join(\"tests\", \"specs\", \"sample.yml\")\n\n with open(data_source_file, \"r\") as f:\n d = yaml.safe_load(f)\n\n with open(specs_file, \"r\") as f:\n specs = yaml.safe_load(f)\n\n hdtable = Hdtable(d, specs)\n print(hdtable)\n\nwhich produces::\n\n +-----------+---------+------------------+--------------+-----------+--------------+--------------+\n | Student # | Class # | Class Name | Project Name | Teacher # | Teacher Name | Class Mascot |\n +===========+=========+==================+==============+===========+==============+==============+\n | 1 | 1 | math | science fair | 1 | daniel | wombat |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+--------------+ | | |\n | | 2 | chinese | yearbook | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+--------------+ | | |\n | | 3 | computer science | robotics | | | |\n | | | | +-----------+--------------+ |\n | | | | | 2 | ethan | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+--------------+ | | |\n | | 4 | physics | esport | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n +-----------+---------+------------------+--------------+ | | |\n | 2 | 1 | math | robotics | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | +-----------+--------------+ |\n | | | | | 3 | frank | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+ | | | |\n | | 2 | chemistry | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+ | | | |\n | | 3 | physics | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | +-----------+--------------+ |\n | | | | | 4 | greg | |\n | | | | | | | |\n | | | | | | | |\n +-----------+---------+------------------+--------------+ | | |\n | 3 | 1 | english | N/A | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | +---------+------------------+ | | | |\n | | 2 | chinese | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | +-----------+--------------+ |\n | | | | | 5 | hank | |\n | +---------+------------------+ | | | |\n | | 3 | chemistry | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n +-----------+---------+------------------+--------------+ | | |\n | 4 | N/A | N/A | N/A | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n | | | | | | | |\n +-----------+---------+------------------+--------------+-----------+--------------+--------------+\n\nInstall\n=======\n\n.. code:: console\n\n $ pip install hdtable\n\nExplanation of columns\n======================\n\nThe element of the specs specify the root object, you can use a dictionary\nwith an empty ``keys`` array for HDTable to use the entire provided data\nobject. This \"column 0\" is invisible and will not be printed.\n\nEach consecutive element in the specs list defines a column in the table,\nbeginning with column 1. Each column respresents a domain of data.\nIn the sample table, the domain of the first column is all the\nstudents in the class, which is a list.\nEach row in column 1 is the index of that student beginning with 1.\nThe domain of the second column is each student's classes they are taking.\nNo the student is not taking any class, the entry shows \"N/A\". Column 3\nrepresents the same data domain as column 2, which is the classes each student\nis taking, but it is in the form of string instead of index.\n\nThe data domain of column 4 inherits not from column 1 but from the invisible\ncolumn 0 (the root column). It lists all the teachers for that class in the\nform of indices.\n\nData Source\n===========\n\nThe data source can be a dictionary or list. All example data given here are\nin YAML format for readability.\nAn example of a data source that contains information a class is in\n``tests/example_data.yml``.\n\nColumn Specifications\n=====================\n\nColumn specifications, or column specs,\ndefine the domain of data each column shows.\nEach spec is a Python dictionary that must contain a ``keys`` entry,\nand optionally, ``parent``,``dtype``, and ``header`` entries.\nThe column specs that produced the sample table above is in\n``tests/specs/sample.yml``:\n\n.. code-block:: yaml\n\n - keys: []\n - keys: [\"students\"]\n dtype: index\n header: \"Student #\"\n - keys: [\"classes\"]\n dtype: index\n parent: 1\n header: \"Class #\"\n - keys: []\n parent: 2\n header: Class Name\n - keys: [\"projects\"]\n parent: 1\n dtype: key\n header: Project Name\n - keys: [\"teachers\"]\n dtype: index\n parent: 0\n header: \"Teacher #\"\n - keys: []\n parent: 5\n header: Teacher Name\n - keys: [\"mascot\"]\n header: Class Mascot\n\n\n.. table::\n\n +-----------+----------+-------------------+--------------------------------------+\n | Parameter | Required | Default | Function |\n +===========+==========+===================+======================================+\n | keys | Yes | N/A | The ``dict`` keys used to retrieve |\n | | | | data. A list of strings. |\n | | | | Can be empty. |\n +-----------+----------+-------------------+--------------------------------------+\n | parent | No | 0 (root) | The parent column from which the |\n | | | | keys will be used to retrieve this |\n | | | | column's data |\n +-----------+----------+-------------------+--------------------------------------+\n | dtype | No | string | The data type of that column. |\n | | | | Can be \"index\", \"key\", or \"string\". |\n +-----------+----------+-------------------+--------------------------------------+\n | header | No | guessed from keys | The displayed header for that column |\n +-----------+----------+-------------------+--------------------------------------+\n\n``dtype``\n---------\n\n``dtype`` defines the data format of a column.\nThere are currently 3 possible types:\n\n- string: try to convert the object to a string\n- index: try to index the object if it is a dictionary or list.\n- key: displays the keys if the object is a dictionary.\n\nAnatomy\n=======\n\n::\n\n +--------+-------+\n | col 1 | col 2 | <\u2500\u252c\u2500 row height of ``col 2``\n +========+=======+ <\u2500\u2518\n row height of ``xyz`` \u2500\u252c\u2500> | xyz | abc |\n \u251c\u2500> | +-------+\n \u251c\u2500> | | def | <\u2500\u2500\u2500 row 5 starting row of ``def``\n \u2514\u2500> +--------+-------+\n \u2502\u2502\u2502\u2502\u2502\u2502\u2502\u2502\n \u2514\u2534\u2534\u253c\u2534\u2534\u2534\u2518\n width of column 0\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/yagehu/hdtable", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "hdtable", "package_url": "https://pypi.org/project/hdtable/", "platform": "", "project_url": "https://pypi.org/project/hdtable/", "project_urls": { "Homepage": "https://gitlab.com/yagehu/hdtable" }, "release_url": "https://pypi.org/project/hdtable/0.1a5/", "requires_dist": [ "anytree (==2.4.3)", "docutils (==0.14)", "pyyaml (==4.2b4)", "six (==1.11.0)" ], "requires_python": ">=3.6", "summary": "Generate reStructuredText grid tables from hierarchical data", "version": "0.1a5" }, "last_serial": 4509376, "releases": { "0.1a2": [ { "comment_text": "", "digests": { "md5": "b41031896d72b0b79b0bd9f6c7aa38e5", "sha256": "bb8c987327f076703a7e51fa68e534fb759de73a0524a2a5c9802366d6d6c85a" }, "downloads": -1, "filename": "hdtable-0.1a2-py3-none-any.whl", "has_sig": false, "md5_digest": "b41031896d72b0b79b0bd9f6c7aa38e5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 20268, "upload_time": "2018-11-15T19:17:02", "url": "https://files.pythonhosted.org/packages/dd/75/bdfb6905c95604bad3181135bedda2a5f6da686a772700d9f42a21995872/hdtable-0.1a2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "24b50513fbd7723e6b4d7ea96cb86ef4", "sha256": "0fb0a7814ae45f5d7f5589af0b46af81cd4d05051b120f59e3149ac9e8d939a1" }, "downloads": -1, "filename": "hdtable-0.1a2.tar.gz", "has_sig": false, "md5_digest": "24b50513fbd7723e6b4d7ea96cb86ef4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10360, "upload_time": "2018-11-15T19:17:04", "url": "https://files.pythonhosted.org/packages/a7/37/e24cee355f40c48d285165bef7abed795ef6149c36b058db7b3a85bc4cfd/hdtable-0.1a2.tar.gz" } ], "0.1a3": [ { "comment_text": "", "digests": { "md5": "40f1159afd476a5146dc6f6aeb6aa4cd", "sha256": "fe46e4dfbde9f7dd8699f9885a1393979c5e72ea2f9907db7c9b6d9fc9980942" }, "downloads": -1, "filename": "hdtable-0.1a3-py3-none-any.whl", "has_sig": false, "md5_digest": "40f1159afd476a5146dc6f6aeb6aa4cd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 21331, "upload_time": "2018-11-16T23:42:26", "url": "https://files.pythonhosted.org/packages/73/5e/8dae93af6d8727255d276fa4320adede60e5208c0ada9227e712ec74d173/hdtable-0.1a3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b1cd37af07ff0bc663094d14c37f402b", "sha256": "7171898ef3004d8d10116dbdb73e6570d1d2a5cde2b211d389c2a4fe6e0e0dc9" }, "downloads": -1, "filename": "hdtable-0.1a3.tar.gz", "has_sig": false, "md5_digest": "b1cd37af07ff0bc663094d14c37f402b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11139, "upload_time": "2018-11-16T23:42:28", "url": "https://files.pythonhosted.org/packages/a3/3a/d829982bc8bd0d63a3526a944cd7458df1f16072214ca2a3e35d2959fa66/hdtable-0.1a3.tar.gz" } ], "0.1a4": [ { "comment_text": "", "digests": { "md5": "53fa3d1e87165bf88f07ea1aac813edf", "sha256": "8925f7fdb4d2a3e9422d1b4dd4602d3418668d23f519f0c4e4db187092cb113a" }, "downloads": -1, "filename": "hdtable-0.1a4-py3-none-any.whl", "has_sig": false, "md5_digest": "53fa3d1e87165bf88f07ea1aac813edf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 21338, "upload_time": "2018-11-20T20:49:42", "url": "https://files.pythonhosted.org/packages/fc/28/9f4a9226f41332c572e0c57199d9f4f4f891fe925517a1c0f4940b77834f/hdtable-0.1a4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "07b4f383be23c6dd728061a42fd14444", "sha256": "37cfea571db29339a67ed383b0df9c6923a78b5defc9a7e0cdc05f4cd9f400b0" }, "downloads": -1, "filename": "hdtable-0.1a4.tar.gz", "has_sig": false, "md5_digest": "07b4f383be23c6dd728061a42fd14444", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11143, "upload_time": "2018-11-20T20:49:44", "url": "https://files.pythonhosted.org/packages/c5/a5/0fec51cda0b6d027a7044332f0fd7037b5f9a659c90c64225614e6f8f22e/hdtable-0.1a4.tar.gz" } ], "0.1a5": [ { "comment_text": "", "digests": { "md5": "1760f75aa6512f1edfe3510d9a566296", "sha256": "4541a2e1cf715788c0fc24e533065357983473e7b9dc0ebefa81c1c20a14812a" }, "downloads": -1, "filename": "hdtable-0.1a5-py3-none-any.whl", "has_sig": false, "md5_digest": "1760f75aa6512f1edfe3510d9a566296", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 21348, "upload_time": "2018-11-20T21:03:41", "url": "https://files.pythonhosted.org/packages/f9/d5/d4e5d366d7cb772704aa137b1ce6644e79ce3c9a941e3a68d12b68b5369c/hdtable-0.1a5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "781a8c570d9a66191b98919abe053436", "sha256": "712677aa63db237ef69cf47e84e52ee4ebf8b6bce1ef25a9d01fb79c46d7a2b9" }, "downloads": -1, "filename": "hdtable-0.1a5.tar.gz", "has_sig": false, "md5_digest": "781a8c570d9a66191b98919abe053436", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11142, "upload_time": "2018-11-20T21:03:43", "url": "https://files.pythonhosted.org/packages/58/ee/bae07aef7a0e64db2568e9e313f53378911f29c6a2d24c9bcfe55d631401/hdtable-0.1a5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1760f75aa6512f1edfe3510d9a566296", "sha256": "4541a2e1cf715788c0fc24e533065357983473e7b9dc0ebefa81c1c20a14812a" }, "downloads": -1, "filename": "hdtable-0.1a5-py3-none-any.whl", "has_sig": false, "md5_digest": "1760f75aa6512f1edfe3510d9a566296", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 21348, "upload_time": "2018-11-20T21:03:41", "url": "https://files.pythonhosted.org/packages/f9/d5/d4e5d366d7cb772704aa137b1ce6644e79ce3c9a941e3a68d12b68b5369c/hdtable-0.1a5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "781a8c570d9a66191b98919abe053436", "sha256": "712677aa63db237ef69cf47e84e52ee4ebf8b6bce1ef25a9d01fb79c46d7a2b9" }, "downloads": -1, "filename": "hdtable-0.1a5.tar.gz", "has_sig": false, "md5_digest": "781a8c570d9a66191b98919abe053436", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11142, "upload_time": "2018-11-20T21:03:43", "url": "https://files.pythonhosted.org/packages/58/ee/bae07aef7a0e64db2568e9e313f53378911f29c6a2d24c9bcfe55d631401/hdtable-0.1a5.tar.gz" } ] }