{ "info": { "author": "Jaime Loeuf", "author_email": "jaimeloeuf@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3.7", "Topic :: Utilities" ], "description": "### Package name: Jevents\n- Author: Jaime Loeuf\n- License: MIT\n- Package Desciption:\n\t- This package contains classes/functions to implement data_observer patterns and use of EventEmitters like those provided by NodeJS runtime and other languages.\n\t- This package does not have any external dependencies.\n\t- Currently this package contains the\n\t\t1. 'Watch' class\n\t\t2. 'wait_for_daemons' function\n\t- Currently lacking more documentation. For now please view test scripts for the different modules to see how to use this Package.\n\n##### Below is a watered down example on how to use the Watch class. The full version is available inside the test_watch.py script in the 'test' directory.\n```python\nfrom Jevents import Watch\nfrom Jevents import wait_for_daemons\n\n# Create a new data variable and store in the watchData object\nsensorData = Watch(12)\n# The data stored in the object can be accessed via the value property\nprint(sensorData.value)\n# Alternatively it can also be accessed by calling itself with the help of the __repr__\nprint(sensorData)\n\n\n# Define a callback function. All callback functions can expect a input parameter of the data watched.\ndef chicken(data):\n\tprint('Chicken nuggets ', data)\n\n\n# Using __iadd__ magic method to set/append an on_change callback function\nsensorData.on_change += chicken\n\n# Add a time delay to simulate real life async operations\nsleep(1.4)\n# Update the data in the object, this will cause all the callbacks to be called.\nsensorData(1)\n# Print out the updated value stored in the object.\nprint(sensorData)\n\n# Add a time delay to simulate real life async operations\nsleep(1.4)\n# Update the data in the object. Notice nothing happens even when a new value is being set.\nsensorData(5)\n# Print out the updated value stored in the object.\nprint(sensorData)\n\n# Call the wait function to stop main thread from ending before the daemonic threads finnish\nwait_for_daemons()\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/Jaimeloeuf/Jevents", "keywords": "data_observer EventEmitters events observers watch", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Jevents", "package_url": "https://pypi.org/project/Jevents/", "platform": "", "project_url": "https://pypi.org/project/Jevents/", "project_urls": { "Homepage": "https://github.com/Jaimeloeuf/Jevents" }, "release_url": "https://pypi.org/project/Jevents/1.1.3/", "requires_dist": null, "requires_python": "", "summary": "Simple to use Utilities package for creating EventEmitters and implementing data observers.", "version": "1.1.3" }, "last_serial": 4831278, "releases": { "1.1.3": [ { "comment_text": "", "digests": { "md5": "cb10b9da7a97a778512360c1a7e94a1e", "sha256": "87106d55934a4bf9187d8b36636dfccd3b0eee4df8fcd43b14455b311ee8414c" }, "downloads": -1, "filename": "Jevents-1.1.3.tar.gz", "has_sig": false, "md5_digest": "cb10b9da7a97a778512360c1a7e94a1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5194, "upload_time": "2019-02-17T11:16:15", "url": "https://files.pythonhosted.org/packages/11/5a/62106b35a6c81bdc3f0ffc43272dd53c5bb83eb75724e09720cd001e6819/Jevents-1.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cb10b9da7a97a778512360c1a7e94a1e", "sha256": "87106d55934a4bf9187d8b36636dfccd3b0eee4df8fcd43b14455b311ee8414c" }, "downloads": -1, "filename": "Jevents-1.1.3.tar.gz", "has_sig": false, "md5_digest": "cb10b9da7a97a778512360c1a7e94a1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5194, "upload_time": "2019-02-17T11:16:15", "url": "https://files.pythonhosted.org/packages/11/5a/62106b35a6c81bdc3f0ffc43272dd53c5bb83eb75724e09720cd001e6819/Jevents-1.1.3.tar.gz" } ] }