{ "info": { "author": "DecisionVis LLC", "author_email": "team@decisionvis.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "This library interacts with DiscoveryDV, a data visualization suite,\nover a ZMQ-based API. In order to use all features of this software, \nDiscoveryDV must be installed and run.\n\n\n# License\n\nPlease see LICENSE.md for information about use, redistribution, and \nmodification of this library.\n\nThe DiscoveryDV application (not included with this package) and the \nDiscoveryDV name are copyright DecisionVis LLC.\n\n\n# Requirements\n\n* PyZMQ (pyzmq>=17.0.0)\n* MessagePack (msgpack-python>=0.4.8)\n* Python >= 3.6\n\n\n# Usage\n\nThe DiscoveryDV Python module has 3 main components:\n\n1. `Connection`\n * This class provides an interface with DiscoveryDV.\n * It is a \"Context Manager\" and ideally should be used within Python's `with` statement.\n * If used outside of a `with` statement, the connection object must be connected \n first (`connection_obj.connect()`), and must be closed when finished (`connection_obj.close()`).\n * The connection can be re-connected with `connection_obj.connect()`; optionally a different \n TCP/IP address, and/or different ports can be passed as arguments.\n * The current application state for DiscoveryDV can be retrieved with `connection_obj.state`; \n it can be resynchronized by calling `connection_obj.reload()` and accessing `connection_obj.state` again.\n\n2. `State`\n * This class represents a DiscoveryDV \"state\" object.\n * It is analogous to Python's `namedtuple`.\n * It contains `_fields`, which is a tuple of strings containing field names\n * Fields may be accessed using dot-notation (e.g. `state.name`) or by subscripting (e.g. `state['name']`).\n * Values may be `State` objects, `Collection` objects, or Python values (`int`, `float`, `bool`, `str`)\n * Fields may be set using `=` (e.g. `state.name = \"New Name\"`, `state['name'] = \"New Name\"`).\n * Fields may be reset to defaults by deletion (e.g. `del state.name`, `del state['name']`).\n * Printing this object will provide an API path and a list of valid fields.\n * This object supplies a `repr` that \"pretty prints\" the `State` recursively\n\n3. `Collection`\n * This class represents a DiscoveryDV \"collection\" object.\n * It is analogous to Python's `tuple`, but can also be queried by an child's \n name (similar to Python's `dict`).\n * Internally in DiscoveryDV these are referred to as `OrderedLookup` or `NameLookup`; \n the main difference is that a `NameLookup` requires children names to be unique.\n * Children are always `State` objects that contain a `name` field\n * Children may be accessed by subscripting, either using a numerical index \n (e.g. `0`, `-1`) or a string name (e.g. `'Page 001`).\n * Children may be added by calling `collection_obj.insert(index)` or `collection_obj.add()`; \n an optional name argument may be supplied to create a child with a specified name.\n * Children may be deleted by calling `collection_obj.delete(index/name)` or `del collection_obj[index/name]`.\n * Printing this object will provide an API path and a list of children's names.\n * This object supplies a `repr` that \"pretty prints\" the `Collection` recursively\n\n\n# Example\n\n\n## Making a Connection\n\nYou will first need to make a connection to DiscoveryDV. It is best to use the \n`Connection` class in a `with` statement:\n\n```\nwith Connection('127.0.0.1', 33929, 33930) as ddv:\n # Commands applied to the \"ddv\" connection object\n ...\n\n```\n\nPython's `with` clause will create the connection, connect it to DiscoveryDV, \nand properly close the connection outside the scope of the `with` clause, and \nin the event of an exception. \n\nAlternately, an instance of a `Connection` can be created, but must be connected \nbefore performing actions, and closed afterward:\n\n```\nddv = Connection('127.0.0.1', 33929, 33930)\nddv.connect()\n# Commands applied to the \"ddv\" connection object\n...\nddv.close()\n```\n\nYou may wish to include the `ddv.close()` command in a `finally` clause to ensure \nthat the connection is properly closed in the event of an exception.\n\n## Working with the DiscoveryDV application state\n\nOnce connected, the application state can be retrieved as a `State` object. \nThis object is an abstraction of the API commands that can be performed in \nDiscoveryDV.\n\nFor example, the following DVS script creates a page, adds a file, \ncreates a PCPlot, and sets up some axes:\n\n```\nadd /page/ \"LTM\"\nadd /page/LTM/file/ \"LTM\"\nset /page/LTM/file/LTM/path/ \"ltm.xlsx\"\nset /page/LTM/file/LTM/type/ excel\nadd /page/LTM/pcplot/ \"PCPlot\"\nadd /page/LTM/pcplot/PCPlot/parallel/ \"Cost\" \"Error\" \"Risk\" \"Mass\"\nset /page/LTM/pcplot/PCPlot/axis/c/name/ \"Cost\"\n```\n\nWe can replicate this script with the DiscoveryDV Python module:\n\n```\nwith Connection('127.0.0.1', 33929, 33930) as ddv:\n ddv.state.page.add(\"LTM\")\n ddv.state.page[\"LTM\"].file.add(\"LTM\")\n ddv.state.page[\"LTM\"].file[\"LTM\"].path = \"ltm.xlsx\"\n ddv.state.page[\"LTM\"].file[\"LTM\"].type = \"excel\"\n ddv.state.page[\"LTM\"].pcplot.add(\"PCPlot\")\n ddv.state.page[\"LTM\"].pcplot[\"PCPlot\"].parallel.add(\"Cost\")\n ddv.state.page[\"LTM\"].pcplot[\"PCPlot\"].parallel.add(\"Error\")\n ddv.state.page[\"LTM\"].pcplot[\"PCPlot\"].parallel.add(\"Risk\")\n ddv.state.page[\"LTM\"].pcplot[\"PCPlot\"].parallel.add(\"Mass\")\n ddv.state.page[\"LTM\"].pcplot[\"PCPlot\"].axis.c.name = \"Cost\"\n```\n\nWe could write this is a more Pythonic approach: \n\n```\nwith Connection('127.0.0.1', 33929, 33930) as ddv:\n state = ddv.state\n page = state.page.add(\"LTM\")\n file = page.file.add(\"LTM\")\n file.path = \"ltm.xlsx\"\n file.type = \"excel\"\n pcplot = page.pcplot.add(\"PCPlot\")\n for name in (\"Cost\", \"Error\", \"Risk\", \"Mass\"):\n _ = pcplot.parallel.add(name)\n pcplot.axis.c.name = \"Cost\"\n```\n\n## Performing \"actions\"\n\nThe DiscoveryDV API has several commands that do not modify the state. These \n\"actions\" can also be performed using this module.\n\nYou can see a list of commands you can run by querying the connection object's \n`commands`: `print(connection_obj.commands)`.\n\nTry running `print(connection_obj.help(\"verb\")` to see information from DiscoveryDV \non a particular command. Actions for the `Connection` object take the same arguments \nas API commands in DiscoveryDV.\n\nYou can also perform state modification commands directly using the connection \nobject. For these commands, you will need to provide a full path. Paths in \nthis module are specified using Python tuples rather than \"/\"-separated as they \nare in the DiscoveryDV API. For example, `/page/0/name/` would be `('page', 0, 'name')`. \n\n\n# Troubleshooting\n\nIt is often useful to `print` the `Connection` object and any relevant `State`/`Collection` \nobjects, or for more detailed information, `print` their `repr` (e.g. `print(repr(connection_obj.state))`).\n\n* `ValueError` with no response from DiscoveryDV: \n * Ensure that DiscoveryDV is running\n * Ensure that the module's `Connection` object has been connected if not using a with statement\n 1. `connection_instance.connect()`\n * Check that the `Connection` object's address and ports match DiscoveryDV\n 1. `print(connection_instance)`\n 2. Compare address and ports to the log message when starting DiscoveryDV\n 3. Reconnect and specify address and ports `connection_instance.connect('127.0.0.1', 33929, 33930)` \n\n* `KeyError` or `IndexError` when performing state changes\n * Confirm that the name or index are correct\n * `print(collection_obj)` and compare names/positions\n * `print(state_obj)` and compare field names\n * Ensure that the module's `State` object is synchronized with DiscoveryDV\n 1. `connection_instance.reload()`\n 2. `state_obj = connection_instance.state`\n\n* `ValueError` when trying to set a `State` field\n * DiscoveryDV only allows certain types/ranges of values based on a path\n * It may be useful to `print` the output from `obj.help()` (for `State` or `Collection`),\n or call `Connection`'s `help` method using a full path (e.g. `connection_obj.help(path)`).\n\n\n# Release Notes\n\n## Version 0.1 - (August 9, 2019):\n\n- Initial release.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.decisionvis.com/ddv/", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "DiscoveryDV", "package_url": "https://pypi.org/project/DiscoveryDV/", "platform": "", "project_url": "https://pypi.org/project/DiscoveryDV/", "project_urls": { "Homepage": "https://www.decisionvis.com/ddv/" }, "release_url": "https://pypi.org/project/DiscoveryDV/0.5/", "requires_dist": [ "pyzmq", "msgpack-python" ], "requires_python": ">=3.6", "summary": "Python package for interfacing with DiscoveryDV using its API", "version": "0.5" }, "last_serial": 5896406, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8ec7996c41a7ffe49c10d598c6f6a387", "sha256": "80db34c5e66ccb2ff66dbda62c76a59ea1a918cbc16cc679c669637d99ad9789" }, "downloads": -1, "filename": "DiscoveryDV-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8ec7996c41a7ffe49c10d598c6f6a387", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 11055, "upload_time": "2019-08-09T17:25:09", "url": "https://files.pythonhosted.org/packages/ac/7b/c8ea13ff0f68d83acd94ce402ad60dcfe1922e4e5fcf0690eb1a2b53fac3/DiscoveryDV-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "32a3ca841b7239133ebea88b057afab2", "sha256": "0045b9c08fc2fa3acdede6e83c56798049ae43c7bec0b6e0686675e8135c8892" }, "downloads": -1, "filename": "DiscoveryDV-0.1.tar.gz", "has_sig": false, "md5_digest": "32a3ca841b7239133ebea88b057afab2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10318, "upload_time": "2019-08-09T17:25:11", "url": "https://files.pythonhosted.org/packages/d0/2e/34d6f1c61e6743fda05143b5bc4b69bd765b325726cb85a75000f9c3509b/DiscoveryDV-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "9e93c387a46d22355eaa3f67c3e94f81", "sha256": "702c62c4517105cc196e0579e4961077fa13c78ef5c61b34c257a82a97366b06" }, "downloads": -1, "filename": "DiscoveryDV-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9e93c387a46d22355eaa3f67c3e94f81", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 17108, "upload_time": "2019-09-26T21:01:49", "url": "https://files.pythonhosted.org/packages/2a/5b/57cf98195b004b1e18d72f0cb081d123e7b42b23121f9488114d0305fe8f/DiscoveryDV-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "88bfa164266f7f1d3bf2626fee229436", "sha256": "0dc955c1eb94bfefca54e08d4c9a3d003993b44ac2567d9b14de4fb44f007b7f" }, "downloads": -1, "filename": "DiscoveryDV-0.2.tar.gz", "has_sig": false, "md5_digest": "88bfa164266f7f1d3bf2626fee229436", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10487, "upload_time": "2019-09-26T21:01:51", "url": "https://files.pythonhosted.org/packages/99/95/e5e17284317dc5af6d3842f40113675e66ff440e4fc2c1dd4b4cc2ba2382/DiscoveryDV-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "fd3a3100a5c3c086e2dcd3389856433b", "sha256": "c8fc40968e1a4495b032a99a5ac941f706639c8d662639497c1ee92ba50e3b5a" }, "downloads": -1, "filename": "DiscoveryDV-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "fd3a3100a5c3c086e2dcd3389856433b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 11192, "upload_time": "2019-09-26T21:11:40", "url": "https://files.pythonhosted.org/packages/c1/0f/7115d3eeb32b65a825c1cdffe091c4ef6fce88382f326994d35de70ac76d/DiscoveryDV-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5116463a8427e5a1f3be3c84f92f8e79", "sha256": "750409579b843216386230093e01ede97c1abbbd8801da95568d98a3435c1c12" }, "downloads": -1, "filename": "DiscoveryDV-0.3.tar.gz", "has_sig": false, "md5_digest": "5116463a8427e5a1f3be3c84f92f8e79", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10470, "upload_time": "2019-09-26T21:11:42", "url": "https://files.pythonhosted.org/packages/3c/c5/38ba77f4527572d869f61eb631f237bc6f43f66ba28ba7f40f75751f8c6c/DiscoveryDV-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "2c2f1e661322f53a39f37b0eb7220679", "sha256": "8939dbc63cf80eac192f44de15908b559a24d10e35380c997f5f4be27becc239" }, "downloads": -1, "filename": "DiscoveryDV-0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "2c2f1e661322f53a39f37b0eb7220679", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 11197, "upload_time": "2019-09-27T13:07:08", "url": "https://files.pythonhosted.org/packages/ab/df/bbf3d06eeff685fb1fc22ac5d87d3ed3c5d9cd50b9f03d15b8e0720356aa/DiscoveryDV-0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3fa585a62c3e8ed700a7883982eb6dea", "sha256": "3a094306bee4f9385fc6b190a5e4ba4453ff609a11a1e19ed8485ce1dbeb49c1" }, "downloads": -1, "filename": "DiscoveryDV-0.4.tar.gz", "has_sig": false, "md5_digest": "3fa585a62c3e8ed700a7883982eb6dea", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10482, "upload_time": "2019-09-27T13:07:09", "url": "https://files.pythonhosted.org/packages/71/e7/9c885d7919d9562740dfb25ec557fe7a8df266d2de8aebf17e9bc7d8178a/DiscoveryDV-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "607b7639e320c8c68d1276155c74ac0b", "sha256": "bd30b372b9f084bac81b6b8181e7da6783dcf2ed5eb49b50dbb2360c541e305d" }, "downloads": -1, "filename": "DiscoveryDV-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "607b7639e320c8c68d1276155c74ac0b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 11201, "upload_time": "2019-09-27T14:21:19", "url": "https://files.pythonhosted.org/packages/97/5e/6323f4bfbc13811465fbccb37eb6b37cd6490af40fc6b3068559be0c80c1/DiscoveryDV-0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c286f51ea161de639c479c125c3b1519", "sha256": "766134831a7d2df727ecad737b1504161188d73bc6a04ddd620acef6ad008ff6" }, "downloads": -1, "filename": "DiscoveryDV-0.5.tar.gz", "has_sig": false, "md5_digest": "c286f51ea161de639c479c125c3b1519", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10490, "upload_time": "2019-09-27T14:21:21", "url": "https://files.pythonhosted.org/packages/36/34/a1279ebe661c89854754d3723b8eb05ecc3908151f248d150934de6ed71c/DiscoveryDV-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "607b7639e320c8c68d1276155c74ac0b", "sha256": "bd30b372b9f084bac81b6b8181e7da6783dcf2ed5eb49b50dbb2360c541e305d" }, "downloads": -1, "filename": "DiscoveryDV-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "607b7639e320c8c68d1276155c74ac0b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 11201, "upload_time": "2019-09-27T14:21:19", "url": "https://files.pythonhosted.org/packages/97/5e/6323f4bfbc13811465fbccb37eb6b37cd6490af40fc6b3068559be0c80c1/DiscoveryDV-0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c286f51ea161de639c479c125c3b1519", "sha256": "766134831a7d2df727ecad737b1504161188d73bc6a04ddd620acef6ad008ff6" }, "downloads": -1, "filename": "DiscoveryDV-0.5.tar.gz", "has_sig": false, "md5_digest": "c286f51ea161de639c479c125c3b1519", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10490, "upload_time": "2019-09-27T14:21:21", "url": "https://files.pythonhosted.org/packages/36/34/a1279ebe661c89854754d3723b8eb05ecc3908151f248d150934de6ed71c/DiscoveryDV-0.5.tar.gz" } ] }