{ "info": { "author": "SAS", "author_email": "Robert.Levey@sas.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Science/Research", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering" ], "description": "# SAS Event Stream Processing Python Interface\n\nThe ESPPy package enables you to create\n[SAS Event Stream Processing (ESP)](https://www.sas.com/en_us/software/event-stream-processing.html)\nmodels programmatically in Python. Using ESPPy, you can connect to \nan ESP server and interact with projects and their components as \nPython objects. These objects include projects, continuous queries, \nwindows, events, loggers, SAS Micro Analytic Service modules, \nrouters, and analytical algorithms.\n\nESPPy has full integration with [Jupyter](https://jupyter.org/) notebooks including visualizing \ndiagrams of your ESP projects, and support for streaming charts and \nimages. This allows you to easily explore and prototype your ESP \nprojects in a familiar notebook interface.\n\n## Installation\n\nTo install ESPPy, you can use either `pip` or `conda`. This will install\nESPPy as well as the Python package dependencies.\n\n```\npip install sas-esppy\n```\n\nor, if you are using an Anaconda distribution:\n\n```\nconda install -c sas-institute sas-esppy\n```\n\n### Additional Requirements\n\nIn addition to the Python package dependencies, you will also need the \n`graphviz` command-line tools to fully take advantage of ESPPy. These can\nbe downloaded from http://www.graphviz.org/download/.\n\n### Performance Enhancement\n\nAlso, ESPPy uses the `ws4py` websocket Python package. In some cases\nyou can improve performance greatly by installing the `wsaccel` package.\nThis may not be available on all platforms though, and is left up to \nthe user to install.\n\n## The Basics\n\nImporting the package is done just as it is with any other Python package.\n\n```\n>>> import esppy\n```\n\nTo connect to an ESP server, you use the `ESP` class. In most cases, the only\ninformation that is needed is the hostname and port.\n\n```\n>>> esp = esppy.ESP('http://myesp.com:8777')\n```\n\n### Getting Information about the Server\n\nNow that we have a connection to the server, we can get information about the\nserver and projects.\n\n```\n>>> esp.server_info\n{'analytics-license': True,\n 'engine': 'esp',\n 'http-admin': 8777,\n 'pubsub': 8778,\n 'version': '5.2'}\n\n# Currently no projects are loaded\n>>> esp.get_projects()\n{}\n```\n\n### Loading a Project\n\nLoading a project is done with the `load_project` method.\n\n```\n>>> esp.load_project('project.xml')\n\n>>> esp.get_projects()\n{'project': Project(name='project')}\n```\n\nContinous queries and windows within projects can be accessed using\nthe `queries` and `windows` attributes of the `Project` and\n`ContinuousQuery` objects, respectively.\n\n```\n>>> proj = esp.get_project('project')\n>>> proj.queries\n{'contquery': ContinuousQuery(name='contquery', project='project')}\n\n>>> proj.queries['contquery'].windows\n{'w_data': CopyWindow(name='w_data', continuous_query='contquery', project='project'),\n 'w_request': SourceWindow(name='w_request', continuous_query='contquery', project='project'),\n 'w_calculate': CalculateWindow(name='w_calculate', continuous_query='contquery', project='project')}\n\n>>> dataw = proj.queries['contquery'].windows['w_data']\n```\n\nYou can even drop the `queries` and `windows` attribute name as a shortcut.\nprojects and continuous queries act like dictionaries of those components.\n\n```\n>>> dataw = proj['contquery']['w_data']\n```\n\n### Publishing Event Data\n\nTo publish events to a window, you simply use the `publish_events` method.\nIt will accept a file name, file-like object, DataFrame, or a string of\nCSV, XML, or JSON data.\n\n```\n>>> dataw.publish_events('data.csv')\n```\n\n### Monitoring Events\n\nYou can subscribe to the events of any window in a project. By default,\nall event data will be cached in the local window object.\n\n```\n>>> dataw.subscribe()\n>>> dataw\n time x y z\nid \n6 0.15979 -2.30180 0.23155 10.6510\n7 0.18982 -1.41650 1.18500 11.0730\n8 0.22040 -0.27241 2.22010 11.9860\n9 0.24976 -0.61292 2.22010 11.9860\n10 0.27972 1.33480 4.24950 11.4140\n11 0.31802 3.44590 7.58650 12.5990\n```\n\nYou can limit the number of cached events using the `limit`\nparameter. For example, to only keep the last 20 events, you would do\nthe following.\n\n```\n>>> dataw.subscribe(limit=20)\n```\n\nYou can also limit the amount of time that events are collected using\nthe `horizon` parameter. It will take a `datetime`, `date`, `time`,\nor `timedelta` object.\n\n```\n>>> dataw.subscribe(horizon=datetime.timedelta(hours=1))\n```\n\nYou can also perform any DataFrame operation on your ESP windows.\n\n```\n>>> dataw.info()\n\nInt64Index: 2108 entries, 6 to 2113\nData columns (total 4 columns):\ntime 2108 non-null float64\nx 2108 non-null float64\ny 2108 non-null float64\nz 2108 non-null float64\ndtypes: float64(4)\nmemory usage: 82.3 KB\n\n>>> dataw.describe()\n time x y z\ncount 20.000000 20.000000 20.000000 20.000000\nmean 69.655050 -4.365320 8.589630 -1.675292\nstd 0.177469 1.832482 2.688911 2.108300\nmin 69.370000 -7.436700 4.862500 -5.175700\n25% 69.512500 -5.911250 7.007675 -3.061150\n50% 69.655000 -4.099700 7.722700 -1.702500\n75% 69.797500 -2.945400 9.132350 -0.766110\nmax 69.940000 -1.566300 14.601000 3.214400\n```\n\n### Documentation\n\nThe full API documentation of ESPPy is available at \nhttps://sassoftware.github.io/python-esppy/.\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://github.com/sassoftware/python-esppy/", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "sas-esppy", "package_url": "https://pypi.org/project/sas-esppy/", "platform": "", "project_url": "https://pypi.org/project/sas-esppy/", "project_urls": { "Homepage": "https://github.com/sassoftware/python-esppy/" }, "release_url": "https://pypi.org/project/sas-esppy/6.2/", "requires_dist": [ "pandas (>=0.16.0)", "pillow", "six (>=1.9.0)", "plotly", "ipywidgets", "requests", "graphviz", "ws4py" ], "requires_python": "", "summary": "SAS Event Stream Processing Python Interface", "version": "6.2" }, "last_serial": 5971139, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "9f410255f8ab8535ee4e499e4bfe2f55", "sha256": "23f03fef7f5fdfb97c7c06a76a6300a4fc248e49dc845c1677f6574e8951ca51" }, "downloads": -1, "filename": "sas-esppy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9f410255f8ab8535ee4e499e4bfe2f55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 175579, "upload_time": "2018-10-05T17:48:43", "url": "https://files.pythonhosted.org/packages/7d/43/f9770c9637556a6eb5ea0e63bf90654a98f7d72d8916916e3af74512cc2e/sas-esppy-1.0.0.tar.gz" } ], "5.2": [ { "comment_text": "", "digests": { "md5": "eae2eaad4d45af360a8de1e81428c6df", "sha256": "06d122547fde9d1c6be3721a39e1aafe160e1a7afae81cc627d663c71d7047b5" }, "downloads": -1, "filename": "sas_esppy-5.2-py3-none-any.whl", "has_sig": false, "md5_digest": "eae2eaad4d45af360a8de1e81428c6df", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 308449, "upload_time": "2019-05-23T16:44:07", "url": "https://files.pythonhosted.org/packages/45/15/f236011aeb6b0bb5a876e9de0ccce582b8cb203a8fe90fe2c8e629dcdf64/sas_esppy-5.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9eef72f9c17f63100a58004341b7e5f7", "sha256": "951ffdcc664aee00285b220349231fc6f095db67fc0183c2dfc3c16d8a5c25be" }, "downloads": -1, "filename": "sas-esppy-5.2.tar.gz", "has_sig": false, "md5_digest": "9eef72f9c17f63100a58004341b7e5f7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 179044, "upload_time": "2019-05-23T16:44:09", "url": "https://files.pythonhosted.org/packages/c9/11/a14e2728a9fe3009f5737d487b827a19ec134a77cd95f569fdbf579f54af/sas-esppy-5.2.tar.gz" } ], "6.1": [ { "comment_text": "", "digests": { "md5": "8f1e1c49c906886e4e0f2342429dfdb7", "sha256": "e8d33d0d91afbff8bc107e74056be1c0316cae90b4832c3fa9e93a88dd47fde2" }, "downloads": -1, "filename": "sas_esppy-6.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8f1e1c49c906886e4e0f2342429dfdb7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 321508, "upload_time": "2019-05-23T16:59:21", "url": "https://files.pythonhosted.org/packages/70/88/298e81d94312efad25a9c67e934fcf07d7d7b4ad967e6c8694e70c1eb586/sas_esppy-6.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "568dfb2b934ecc78b20a6a9e6fce1aea", "sha256": "663621c4c3f66e307b470d8a488427d60b554492e2d7a0a92746fff2bed3ce76" }, "downloads": -1, "filename": "sas-esppy-6.1.tar.gz", "has_sig": false, "md5_digest": "568dfb2b934ecc78b20a6a9e6fce1aea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 189525, "upload_time": "2019-05-23T16:59:23", "url": "https://files.pythonhosted.org/packages/7e/0b/7273531e2fb391c6aa2cbef958f684613938bfef00102004b9569a108146/sas-esppy-6.1.tar.gz" } ], "6.2": [ { "comment_text": "", "digests": { "md5": "8af8adb2e5d884f1879485cab9d431ee", "sha256": "2b2beb2098a746b382c212df44fcd74b06c671d5f5b8f2bb84141e62e6a7edf7" }, "downloads": -1, "filename": "sas_esppy-6.2-py3-none-any.whl", "has_sig": false, "md5_digest": "8af8adb2e5d884f1879485cab9d431ee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 359620, "upload_time": "2019-10-14T11:53:38", "url": "https://files.pythonhosted.org/packages/ab/9b/609ef9097596bf8a6c32fb1dbab7b126c17cfe46ff9dd9f99b79bf6b6e9a/sas_esppy-6.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f808235470b3b3e1f36e597b7f4dc247", "sha256": "f76196d09ad05b6a5b0b89cd01be4f580cfe92a102331ec0a50d52e83f7e0eae" }, "downloads": -1, "filename": "sas-esppy-6.2.tar.gz", "has_sig": false, "md5_digest": "f808235470b3b3e1f36e597b7f4dc247", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 224902, "upload_time": "2019-10-14T11:53:41", "url": "https://files.pythonhosted.org/packages/3e/93/65458cf3b4eef795edfddce3ad839b5d799b5d97912ae084f63cd7df636f/sas-esppy-6.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8af8adb2e5d884f1879485cab9d431ee", "sha256": "2b2beb2098a746b382c212df44fcd74b06c671d5f5b8f2bb84141e62e6a7edf7" }, "downloads": -1, "filename": "sas_esppy-6.2-py3-none-any.whl", "has_sig": false, "md5_digest": "8af8adb2e5d884f1879485cab9d431ee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 359620, "upload_time": "2019-10-14T11:53:38", "url": "https://files.pythonhosted.org/packages/ab/9b/609ef9097596bf8a6c32fb1dbab7b126c17cfe46ff9dd9f99b79bf6b6e9a/sas_esppy-6.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f808235470b3b3e1f36e597b7f4dc247", "sha256": "f76196d09ad05b6a5b0b89cd01be4f580cfe92a102331ec0a50d52e83f7e0eae" }, "downloads": -1, "filename": "sas-esppy-6.2.tar.gz", "has_sig": false, "md5_digest": "f808235470b3b3e1f36e597b7f4dc247", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 224902, "upload_time": "2019-10-14T11:53:41", "url": "https://files.pythonhosted.org/packages/3e/93/65458cf3b4eef795edfddce3ad839b5d799b5d97912ae084f63cd7df636f/sas-esppy-6.2.tar.gz" } ] }