{ "info": { "author": "CDP Technologies AS", "author_email": "info@cdptech.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development" ], "description": "CDP-Client\n==========\n\nA simple python interface for the CDP Studio development platform that allows Python scripts to interact with CDP Applications - retrieve CDP Application structures and read-write object values. For more information about CDP Studio see https://cdpstudio.com/\n\nThe API makes heavy use of promise library for asynchronous operations. For more information see https://pypi.python.org/pypi/promise\n\nInstallation\n------------\n\n::\n\n $ pip install cdp-client\n\nUsage\n-----\n\nThe example below shows how you subscribe to CDP signal value changes.\n\n.. code:: python\n\n from cdp_client import cdp\n\n def on_value_changed(value, timestamp):\n print(value)\n\n def subscribe_to_value_changes(node):\n node.subscribe_to_value_changes(on_value_changed)\n\n client = cdp.Client('127.0.0.1')\n client.find_node('AppName.ComponentName.SignalName').then(subscribe_to_value_changes)\n client.run_event_loop()\n\nAPI\n---\n\nBefore all examples, you need:\n\n.. code:: python\n\n from cdp_client import cdp\n\nGlobal API\n~~~~~~~~~~\n\nClient(host, port, auto_reconnect)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n- Arguments\n\n host - String for hosts ip address\n\n port - Optional port number to connect to. If not specified default port 7689 is used.\n\n auto_reconnect - Optional argument to enable/disable automatic reconnect when connection is lost. Defaults to True if not specified.\n\n- Returns\n\n The connected client object.\n\n- Usage\n\n .. code:: python\n\n client = cdp.Client('127.0.0.1')\n\nInstance Methods / Client\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nclient.root_node()\n^^^^^^^^^^^^^^^^^^\n\nGets the application Node object of the connected application.\n\n- Returns\n\n Promise containing root Node object when fulfilled.\n\n- Usage\n\n .. code:: python\n\n client.root_node().then(on_success).catch(on_error)\n\nclient.find_node(path)\n^^^^^^^^^^^^^^^^^^^^^^\n\nSearches for the node specified by full dot separated path. **The requested node must reside in the application client was connected to. Root node is not considered part of the path.**\n\n- Arguments\n\n path - Dot separated string to target node\n\n- Returns\n\n Promise containing requested Node object when fulfilled. Otherwise NotFoundError when rejected.\n\n- Usage\n\n .. code:: python\n\n client.find_node('AppName.ComponentName.SignalName').then(on_success).catch(on_error)\n\nclient.run_event_loop()\n^^^^^^^^^^^^^^^^^^^^^^^\n\nRuns the event loop that serves network communication layer for incoming/outgoing data. **This is a blocking call that must be run for any communication to happen.** The method can be cancelled by calling disconnect.\n\nclient.disconnect()\n^^^^^^^^^^^^^^^^^^^\n\nStops the event loop and closes the connection to connected application. This method also releases the blocking run_event_loop call.\n\nInstance Methods / Node\n~~~~~~~~~~~~~~~~~~~~~~~\n\nnode.name()\n^^^^^^^^^^^\n\n- Returns\n\n The name of the Node object. Names in a parent node are all unique.\n\nnode.path()\n^^^^^^^^^^^\n\n- Returns\n\n A dot separated path of the Node object starting with application name.\n\nnode.parent()\n^^^^^^^^^^^^^\n\n- Returns\n\n The parent Node object.\n\nnode.type()\n^^^^^^^^^^^\n\n- Returns\n\n The type of the Node object returned as one of the cdp.NodeType values.\n\nnode.last_value()\n^^^^^^^^^^^^^^^^^\n\n- Returns\n\n The last known value received by the Node object.\n\nnode.set_value(value, timestamp)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSets a new value for the Node object. Timestamp will be ignored in current implementation.\n\n- Arguments\n\n value - New value\n\n timestamp - UTC time in nanoseconds since Epoch\n\nnode.is_read_only()\n^^^^^^^^^^^^^^^^^^^\n\n- Returns\n\n False if nodes value cannot be set, otherwise True.\n\nnode.is_leaf()\n^^^^^^^^^^^^^^\n\n- Returns\n\n True if node doesn't have any children, otherwise False.\n\nnode.child(name)\n^^^^^^^^^^^^^^^^\n\n- Arguments\n\n name - Child nodes name to search for\n\n- Returns\n\n Promise containing requested Node object when fulfilled.\n\n- Usage\n\n .. code:: python\n\n node.child('NodeName').then(on_success).catch(on_error)\n\nnode.children()\n^^^^^^^^^^^^^^^\n\n- Returns\n\n Promise containing all children of this Node object when fulfilled.\n\n- Usage\n\n .. code:: python\n\n node.children().then(on_success).catch(on_error)\n\nnode.for_each_child(callback)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nLoops through all children and calls callback function for each of them\n\n- Arguments\n\n callback - Function(node)\n\n- Returns\n\n Promise containing all children of this Node object when fulfilled.\n\n- Usage\n\n .. code:: python\n\n def on_callback(child):\n do something\n\n node.for_each_child(on_callback)\n\nnode.subscribe_to_structure_changes(callback)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nStarts listening structure changes and passes the changes to provided callback funtion\n\n- Arguments\n\n callback - Function(added_nodes, removed_nodes) where added_nodes and removed_nodes is a list\n\n- Usage\n\n .. code:: python\n\n def on_change(added_nodes, removed_nodes):\n do something\n\n node.subscribe_to_structure_changes(on_change)\n\nnode.subscribe_to_value_changes(callback)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nStarts listening value changes and passes the changes to provided callback function\n\n- Arguments\n\n callback - Function(value, timestamp)\n\n- Usage\n\n .. code:: python\n\n def on_change(value, timestamp):\n do something\n\n node.subscribe_to_value_changes(on_change)\n\n\nnode.unsubscribe_from_structure_changes(callback)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nStops listening previously subscribed structure changes\n\n- Arguments\n\n callback - Function(added_nodes, removed_nodes) where added_nodes and removed_nodes is a list\n\n- Usage\n\n .. code:: python\n\n def on_change(added_nodes, removed_nodes):\n do something\n\n node.unsubscribe_from_structure_changes(on_change)\n\nnode.unsubscribe_from_value_changes(callback)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nStops listening previously subscribed value changes\n\n- Arguments\n\n callback - Function(value, timestamp)\n\n- Usage\n\n .. code:: python\n\n def on_change(value, timestamp):\n do something\n\n node.unsubscribe_from_value_changes(on_change)\n\nTests\n-----\n\nTo run the test suite execute the following command in package root folder:\n\n.. code:: sh\n\n $ python setup.py test\n\nLicense\n-------\n\n`MIT\nLicense `__\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/CDPTechnologies/PythonCDPClient", "keywords": "cdp cdpstudio studio client cdp-client cdp_client", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cdp-client", "package_url": "https://pypi.org/project/cdp-client/", "platform": "", "project_url": "https://pypi.org/project/cdp-client/", "project_urls": { "Homepage": "https://github.com/CDPTechnologies/PythonCDPClient" }, "release_url": "https://pypi.org/project/cdp-client/1.1.1/", "requires_dist": [ "promise (==2.2.1)", "websocket-client (==0.56.0)", "protobuf (==3.7.1)", "mock (==3.0.5)" ], "requires_python": "", "summary": "Provides an API that allows to interact with CDP applications", "version": "1.1.1" }, "last_serial": 5276765, "releases": { "1.0.2": [ { "comment_text": "", "digests": { "md5": "e96407d29e909f8c6f8a0d270e41b1a0", "sha256": "76d9f7006e2edc5bf495e089ff75f04d63006d15e300a06b491304cb00265594" }, "downloads": -1, "filename": "cdp_client-1.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "e96407d29e909f8c6f8a0d270e41b1a0", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 18308, "upload_time": "2018-05-29T07:25:24", "url": "https://files.pythonhosted.org/packages/4a/e2/06d6baadb92b04ed17b46675caf2e584aa59f90783e40ea863fcd4618be4/cdp_client-1.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3b27b5efd8c60ebf80400723b4fd7dd2", "sha256": "8f6ce5bab5d55c5a6684698168d33527bd0f3e0274a2c2a8f9b5f220a1c1ed7f" }, "downloads": -1, "filename": "cdp-client-1.0.2.tar.gz", "has_sig": false, "md5_digest": "3b27b5efd8c60ebf80400723b4fd7dd2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16320, "upload_time": "2018-05-29T07:25:25", "url": "https://files.pythonhosted.org/packages/dc/c8/6f576b85b979d4338b87e777fe09cecf6608104c5659a9b8f92dc606bdaa/cdp-client-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "f13bf45ac4faeac4ea0bfca85a832bfd", "sha256": "06ebd467abaff465a4aeb6712f1bb72214d0b33525e359d1c0ce5d257013187e" }, "downloads": -1, "filename": "cdp_client-1.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "f13bf45ac4faeac4ea0bfca85a832bfd", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 18350, "upload_time": "2018-06-29T09:51:50", "url": "https://files.pythonhosted.org/packages/f4/e5/b8a62946dd3faf6ab706c691e8964359adef9326a66ac9b7b262d98ddf80/cdp_client-1.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7111e513ecd8e58dffe832b2055f5b9", "sha256": "7b667a808c31d52a488b9d9a1880a3e452f9a6f43f4a4d59b10092faacdc7913" }, "downloads": -1, "filename": "cdp-client-1.0.3.tar.gz", "has_sig": false, "md5_digest": "a7111e513ecd8e58dffe832b2055f5b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16369, "upload_time": "2018-06-29T09:51:52", "url": "https://files.pythonhosted.org/packages/61/b6/8f348caa9d6a715edefc8ef8bb661643dc8e0e40aca33940c1f0369f9e96/cdp-client-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "21b95221f071ff61d743665868740b78", "sha256": "62663225c281f69cbc16d9630fe59f6cae6520a17fb618c01721aaa2ea139f7d" }, "downloads": -1, "filename": "cdp_client-1.0.4-py2-none-any.whl", "has_sig": false, "md5_digest": "21b95221f071ff61d743665868740b78", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 18305, "upload_time": "2018-06-29T15:04:01", "url": "https://files.pythonhosted.org/packages/2e/b6/88c9fd8e2660ff5ed0c3a6735d8191502ff2a877837adb90d0cde915bb24/cdp_client-1.0.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1342e744b394da703dcecc0be63349fc", "sha256": "506526655914d66b3af0cb35b0a52d70b83b884b150d6515fe58b0798edbd701" }, "downloads": -1, "filename": "cdp-client-1.0.4.tar.gz", "has_sig": false, "md5_digest": "1342e744b394da703dcecc0be63349fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16316, "upload_time": "2018-06-29T15:04:02", "url": "https://files.pythonhosted.org/packages/38/e8/4235e5dad93190f5342029743c896c573fd6b6e727afae79d9363dcbf93d/cdp-client-1.0.4.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "e11508fdbb2d41d122671a5a655d4090", "sha256": "fe101a5f71b6f16ecf24c5233e753b4d0f225b0f42b127309bd7101070cb5d9d" }, "downloads": -1, "filename": "cdp_client-1.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "e11508fdbb2d41d122671a5a655d4090", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 19416, "upload_time": "2018-08-22T14:50:03", "url": "https://files.pythonhosted.org/packages/59/0d/64b1f60c972236db709ba262b9971e8ae87474e0c3ea69c14c4bafcd48e6/cdp_client-1.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4293508f8b13d3bd2fa50d585e90a174", "sha256": "ae8ba2554c0b29a0a5291193eba53c50cee7b1b5a4e83a5f5a09b70a25af100a" }, "downloads": -1, "filename": "cdp-client-1.1.0.tar.gz", "has_sig": false, "md5_digest": "4293508f8b13d3bd2fa50d585e90a174", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17375, "upload_time": "2018-08-22T14:50:05", "url": "https://files.pythonhosted.org/packages/0a/5e/086efc87371389d8e0b35f551603f719206820c58422b888d62cf1dd565b/cdp-client-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "b16d8752b4f86107de1ac4d9c4bb8d9a", "sha256": "44cc39b2f62e34f7183aa006fc19efbe9d603886e099f62a7c88725454ebf383" }, "downloads": -1, "filename": "cdp_client-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b16d8752b4f86107de1ac4d9c4bb8d9a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20210, "upload_time": "2019-05-16T10:25:29", "url": "https://files.pythonhosted.org/packages/b7/93/57a382071072db7e8274ac1d6ddd5146e1e0a3d58920d8e3aa813736a5c4/cdp_client-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b11b7b8d81344b6f1aa47ce23681fea3", "sha256": "05b0c8c7a8b692d4ee41be3d19168e1852bd23b7a96ac9f549a5a207904d7002" }, "downloads": -1, "filename": "cdp-client-1.1.1.tar.gz", "has_sig": false, "md5_digest": "b11b7b8d81344b6f1aa47ce23681fea3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19417, "upload_time": "2019-05-16T10:25:31", "url": "https://files.pythonhosted.org/packages/b3/c8/2ac0487b68b5336b097c9c2d8c97e297a93537670f5df6ac9fb8b7b19937/cdp-client-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b16d8752b4f86107de1ac4d9c4bb8d9a", "sha256": "44cc39b2f62e34f7183aa006fc19efbe9d603886e099f62a7c88725454ebf383" }, "downloads": -1, "filename": "cdp_client-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b16d8752b4f86107de1ac4d9c4bb8d9a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20210, "upload_time": "2019-05-16T10:25:29", "url": "https://files.pythonhosted.org/packages/b7/93/57a382071072db7e8274ac1d6ddd5146e1e0a3d58920d8e3aa813736a5c4/cdp_client-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b11b7b8d81344b6f1aa47ce23681fea3", "sha256": "05b0c8c7a8b692d4ee41be3d19168e1852bd23b7a96ac9f549a5a207904d7002" }, "downloads": -1, "filename": "cdp-client-1.1.1.tar.gz", "has_sig": false, "md5_digest": "b11b7b8d81344b6f1aa47ce23681fea3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19417, "upload_time": "2019-05-16T10:25:31", "url": "https://files.pythonhosted.org/packages/b3/c8/2ac0487b68b5336b097c9c2d8c97e297a93537670f5df6ac9fb8b7b19937/cdp-client-1.1.1.tar.gz" } ] }