{ "info": { "author": "Brent Pedersen", "author_email": "bpederse@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", "Topic :: Scientific/Engineering" ], "description": "SimpleTable: simple wrapper around `pytables`_ hdf5\r\n------------------------------------------------------------------------------\r\n\r\n.. _`pytables`: http://pytables.org\r\n\r\nThis module removes some of the boiler-plate code required to use the excellent \r\n`pytables`_\r\nmodule to save and access structured data.\r\n\r\nExample Usage::\r\n\r\n >>> from simpletable import SimpleTable\r\n >>> import tables\r\n\r\ndefine a table as a subclass of simple table.\r\n\r\n >>> RGB = tables.Enum(list('RGB'))\r\n >>> class ATable(SimpleTable):\r\n ... x = tables.Float32Col()\r\n ... y = tables.Float32Col()\r\n ... name = tables.StringCol(16)\r\n ... color = tables.EnumCol(RGB, 'R', 'uint8')\r\n\r\ninstantiate with: args: filename, tablename\r\n\r\n >>> tbl = ATable('test_docs.h5', 'atable1')\r\n\r\ninsert as with pytables:\r\n\r\n >>> row = tbl.row\r\n >>> for i in range(50):\r\n ... row['x'], row['y'] = i, i * 10\r\n ... row['name'] = \"name_%i\" % i\r\n ... # NOTE how we have to manually translate the enum column.\r\n ... row['color'] = RGB['G']\r\n ... row.append()\r\n >>> tbl.flush()\r\n\r\ncan have the enum cols automatically translated using `insert`\r\n\r\n >>> data = {'x': 1000, 'y': 2000, 'color': 'G', 'name': 'flintstone'}\r\n >>> tbl.insert(data, row)\r\n >>> row.append()\r\n >>> tbl.flush()\r\n\r\nthere is also `insert_many()` method with takes an iterable\r\nof dicts with keys matching the colunns (x, y, name) in this\r\ncase.\r\n\r\nquery the data (query() alias of tables' readWhere()\r\nnote that pytables sends back the data with enum cols as they were\r\nand does nothing to translate them to their original values.\r\n\r\n >>> tbl.query('(x > 4) & (y < 70)') #doctest: +NORMALIZE_WHITESPACE\r\n array([(1, 'name_5', 5.0, 50.0), (1, 'name_6', 6.0, 60.0)],\r\n dtype=[('color', '|u1'), ('name', '|S16'), ('x', '>> r = tbl.q('x == 1000') # doctest: +NORMALIZE_WHITESPACE\r\n >>> r # doctest: +ELLIPSIS\r\n \r\n\r\n >>> list(r)\r\n [{'color': 'G', 'x': 1000.0, 'name': 'flintstone', 'y': 2000.0}]\r\n\r\nor use the `translate_enum` method\r\n\r\n >>> for row_with_enum in tbl.query('(x > 4) & (y < 70)'):\r\n ... tbl.translate_enum(row_with_enum)\r\n {'color': 'G', 'x': 5.0, 'name': 'name_5', 'y': 50.0}\r\n {'color': 'G', 'x': 6.0, 'name': 'name_6', 'y': 60.0}\r\n\r\nNote that using `q` or `translate_enum` will affect performance.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/brentp/biostuff/", "keywords": "hdf5 pytables tables numpy", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "simpletable", "package_url": "https://pypi.org/project/simpletable/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/simpletable/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bitbucket.org/brentp/biostuff/" }, "release_url": "https://pypi.org/project/simpletable/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "wrapper around pytables/hd5f to simplify using structured data", "version": "0.2.2" }, "last_serial": 799601, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "1751a77136f925be80c51195d106ea14", "sha256": "f141e9372738ca7abc697177e14ff65aecb8f7cbb5fe01ef0cc4b246b76d72b3" }, "downloads": -1, "filename": "simpletable-0.1.tar.gz", "has_sig": false, "md5_digest": "1751a77136f925be80c51195d106ea14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2728, "upload_time": "2009-09-29T23:04:00", "url": "https://files.pythonhosted.org/packages/22/4e/044a643237cd8a5cee4ebe3e0d845eba7d7093bff096e11bf05088bccf02/simpletable-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "078f18de5b2f865a1c9cda7a68051206", "sha256": "8124baf71921d05b0529c35b2b6ab849f8eaf1e35bda7895170ff6e32e16b870" }, "downloads": -1, "filename": "simpletable-0.2.tar.gz", "has_sig": false, "md5_digest": "078f18de5b2f865a1c9cda7a68051206", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2960, "upload_time": "2009-10-08T19:36:57", "url": "https://files.pythonhosted.org/packages/7f/c6/f4657ddda5aaccad19af2a7345b819dc2cc1877240d4e54f9b9e8c11f4d8/simpletable-0.2.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "d88b7c1ce2b908a1ee5bf608966e074b", "sha256": "5cb028eaf37fef83821d9bfd0726c5cd4e4440dcc93e8e0ac253c11b04caa279" }, "downloads": -1, "filename": "simpletable-0.2.2.tar.gz", "has_sig": false, "md5_digest": "d88b7c1ce2b908a1ee5bf608966e074b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3464, "upload_time": "2009-11-07T21:46:42", "url": "https://files.pythonhosted.org/packages/84/ce/6dbd6c6cfc8b672aa6f3c1e9134be6801985218610877ae8161430b50b69/simpletable-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d88b7c1ce2b908a1ee5bf608966e074b", "sha256": "5cb028eaf37fef83821d9bfd0726c5cd4e4440dcc93e8e0ac253c11b04caa279" }, "downloads": -1, "filename": "simpletable-0.2.2.tar.gz", "has_sig": false, "md5_digest": "d88b7c1ce2b908a1ee5bf608966e074b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3464, "upload_time": "2009-11-07T21:46:42", "url": "https://files.pythonhosted.org/packages/84/ce/6dbd6c6cfc8b672aa6f3c1e9134be6801985218610877ae8161430b50b69/simpletable-0.2.2.tar.gz" } ] }