{ "info": { "author": "Jeremy Kanovsky", "author_email": "kanovsky.jeremy@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3" ], "description": "# socket.py\n\n## Installation\n\nNode.js installation:\n```\nnpm install socket.py\n```\n\nPython installation:\n```\npip install NodeSocket\n```\n\nThese libraries are developed in parallel, and designed to be used together.\n\n## Features\n\nSocket.py enables real-time bidirectional communication between a Node.js server, and a Python process. It consists of:\n\n- a Node.js server\n- a Python process with NodeSocket\n\nIts main features are:\n\n### Speed\n\nConnections are made using Unix sockets and can pass information from processes extremely quickly and reliably.\n\n### Auto-connection support\n\nUnless specifically disabled, this library will automatically connect the Node.js and Python process to ensure the connection is accessible in all parts of the program. Future versions will support auto-reconnection as well.\n\n### Disconnection detection\n\nAn event is triggered in the Node.js server when a Python process disconnects. The library will also keep track of the state of the socket connection and allow querying of the connection status.\n\n### Easy to use\n\nThis library was designed to lower the barrier to entry as much as possible. As such there are built in functions that can send and receive strings, JSON data, and raw binary data.\n\n## How to use \u2014 Node.js\n\nThe following example imports and creates the data socket in Node.js, and then sets up a listener event.\n```javascript\nconst socket = require('socket.py');\n\nvar channel = 'channel_1';\n\nsocket.write(channel, 'Hello from Node.js!');\n\nsocket.on('channel', (data) => {\n\t/* your code here */\n});\n```\n\nChannels can be written to and read from. Channels do not need to be declared by either Node.js or Python ahead of time.\nChannels do not even need to match between the processes. When the `write` command is called, a channel name and a message must be passed. This message can be of any JSON supported data type. When a message is received from Python, the channel it was passed through will emit the data.\n\nThere are also the following methods exported as part of socket.py:\n```\ngetAddress() => will return the socket address (returns a string)\n\nopenSocket() => will open the data socket (called automatically, not necessary to use unless the connection is interrupted)\n\nisOpen() => will return the state of the socket (returns a boolean)\n\nwrite(channel, msg) => write to Python\n\npipe(msg) => pipe data to python (WARNING: This function is not fully tested)\n\ngetSocket() => returns the socket object itself (for advanced users only)\n\nget(channel) => returns the last piece of data received over the on a specified channel\n```\n\n## How to use \u2014 Python\n\nThe following is a simple example of how to use NodeSocket in Python:\n```python\nfrom NodeSocket import NodeSocket\n\nsocket = NodeSocket.NodeSocket()\n\nchannel = 'channel_1'\n\nsocket.write(channel, 'Hello from Python!')\n\nresponse = socket.get(channel)\n```\n\nHere are the functions accessible from the NodeSocket library:\n```\nopen() => will open the data socket (called by default, do not call unless the connection is interrupted)\n\nclose() => will close the data socket\n\nisOpen() => returns if the socket is open (returns a boolean)\n\nget(channel) => will return the most recent data to a specific channel\n```\n\nThe socket is read from automatically and runs on a separate thread. When the socket is created it will block until the socket is open, but will otherwise not interrupt program flow.\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/0xJeremy/socket.py", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "NodeSocket", "package_url": "https://pypi.org/project/NodeSocket/", "platform": "", "project_url": "https://pypi.org/project/NodeSocket/", "project_urls": { "Homepage": "https://github.com/0xJeremy/socket.py" }, "release_url": "https://pypi.org/project/NodeSocket/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "A lightweight Node.js \u2194 Python data socket", "version": "0.3.1" }, "last_serial": 5733946, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "05273311e5d293fa033bc974ae4884a4", "sha256": "9009081ad1aed523990c21cbb7cefe42b11a9ac8cc1518e241f66ad85fe0997e" }, "downloads": -1, "filename": "NodeSocket-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "05273311e5d293fa033bc974ae4884a4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 1975, "upload_time": "2019-08-18T04:21:04", "url": "https://files.pythonhosted.org/packages/b9/df/6e441976ea0382d7f5a735836a402effa0e7275759974b52b4628d5c5204/NodeSocket-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a612ede4dbd9faba3e0ef8e8d1bb087", "sha256": "dbf34b32b4fc4ae3bc69057cf1fcd2605f5d2db1b7b517a092b783447b1e5f7e" }, "downloads": -1, "filename": "NodeSocket-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4a612ede4dbd9faba3e0ef8e8d1bb087", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 769, "upload_time": "2019-08-18T04:21:08", "url": "https://files.pythonhosted.org/packages/91/05/69d3229f962420869e9bd143e372756735a54380e116b341250cd4f57d20/NodeSocket-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "2411faf1f2deff5731408b5c574b3895", "sha256": "5c3deed308b8b848ad709ac33dfedd940a897f815bd35b97bbf6f546cc00cb8c" }, "downloads": -1, "filename": "NodeSocket-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2411faf1f2deff5731408b5c574b3895", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2847, "upload_time": "2019-08-19T02:57:12", "url": "https://files.pythonhosted.org/packages/b0/f4/9052ab10b3906c2ea6a523b9527941d909ee2f387dac6460eb449ff6e6be/NodeSocket-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fa57ae2eaf13008d92f7acdda4ff6873", "sha256": "89f88989c008bb913bc302b98cae24100b7786200c594924511a7b6967ab810a" }, "downloads": -1, "filename": "NodeSocket-0.2.0.tar.gz", "has_sig": false, "md5_digest": "fa57ae2eaf13008d92f7acdda4ff6873", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2711, "upload_time": "2019-08-19T02:57:14", "url": "https://files.pythonhosted.org/packages/a8/fa/480bbcad67881519a11ba2c823ffb8872be664df06597419122d101c00b5/NodeSocket-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "ce3386418f62b3f29bda57b56689dde4", "sha256": "b416281019648c1c92970d4fd4a7eb392cda0f8f9991c4b07ca3e11a1fd13e36" }, "downloads": -1, "filename": "NodeSocket-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ce3386418f62b3f29bda57b56689dde4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4159, "upload_time": "2019-08-19T03:02:57", "url": "https://files.pythonhosted.org/packages/dd/1d/4583f7fa018bd8abe1520d30400a1ddf8177c094532069488521d53f78d4/NodeSocket-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c1bed312f87d571963393e43b5fd4e9d", "sha256": "d77bf9f8b6827401f0dd8cbfcb4ead4e7e0f98e0458fa0daa427354494f772a7" }, "downloads": -1, "filename": "NodeSocket-0.2.1.tar.gz", "has_sig": false, "md5_digest": "c1bed312f87d571963393e43b5fd4e9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3167, "upload_time": "2019-08-19T03:02:59", "url": "https://files.pythonhosted.org/packages/65/40/6223b3f1b4961b85e505f818d6c0e652fcb2c96880f86b8f4db719fda3f5/NodeSocket-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "569a2756590d3e7083015295704e502a", "sha256": "c80e3ca7326d13ed7dc582a00e19e292424791dcca0db88ef5fb703fd1dab33f" }, "downloads": -1, "filename": "NodeSocket-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "569a2756590d3e7083015295704e502a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4259, "upload_time": "2019-08-26T23:37:00", "url": "https://files.pythonhosted.org/packages/86/c7/8211813b9c853caaf776e1b5489173b59076f59b59cb4019c9eba8baa0b4/NodeSocket-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4f2959b35c05432da832c4feb14441e4", "sha256": "ec09d1e55f23c1db2e6ae76a993870dd9d9bf371120e70e7aea75f2206575bd5" }, "downloads": -1, "filename": "NodeSocket-0.3.0.tar.gz", "has_sig": false, "md5_digest": "4f2959b35c05432da832c4feb14441e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3236, "upload_time": "2019-08-26T23:37:02", "url": "https://files.pythonhosted.org/packages/86/cb/a88da56f78d661d1d50b3172c331e23a53fa530429324ce11a57a807968b/NodeSocket-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "0e70c6ed1f0a36768d2a583e21542fb5", "sha256": "6498bfbb44eb0a68bdcec21c87f210040f905a271e3dc64c15854ae31a55a9e6" }, "downloads": -1, "filename": "NodeSocket-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0e70c6ed1f0a36768d2a583e21542fb5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4297, "upload_time": "2019-08-27T01:31:11", "url": "https://files.pythonhosted.org/packages/3d/ac/e33a0b7529b28713d392cde1b89cf2897a15c435722e598dba660fe6b3b3/NodeSocket-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7e25ef5c3e8956800032dafcb2d48c9c", "sha256": "a226756cac8193c4d014ee7bf090ac9ffc7e032a7cafb6f5807de960eb827cd7" }, "downloads": -1, "filename": "NodeSocket-0.3.1.tar.gz", "has_sig": false, "md5_digest": "7e25ef5c3e8956800032dafcb2d48c9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3268, "upload_time": "2019-08-27T01:31:13", "url": "https://files.pythonhosted.org/packages/b2/b9/85b1ce547620d225ae60e95033e330b4abc8787db4c9bb85a4b6c8bebff2/NodeSocket-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0e70c6ed1f0a36768d2a583e21542fb5", "sha256": "6498bfbb44eb0a68bdcec21c87f210040f905a271e3dc64c15854ae31a55a9e6" }, "downloads": -1, "filename": "NodeSocket-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0e70c6ed1f0a36768d2a583e21542fb5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4297, "upload_time": "2019-08-27T01:31:11", "url": "https://files.pythonhosted.org/packages/3d/ac/e33a0b7529b28713d392cde1b89cf2897a15c435722e598dba660fe6b3b3/NodeSocket-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7e25ef5c3e8956800032dafcb2d48c9c", "sha256": "a226756cac8193c4d014ee7bf090ac9ffc7e032a7cafb6f5807de960eb827cd7" }, "downloads": -1, "filename": "NodeSocket-0.3.1.tar.gz", "has_sig": false, "md5_digest": "7e25ef5c3e8956800032dafcb2d48c9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3268, "upload_time": "2019-08-27T01:31:13", "url": "https://files.pythonhosted.org/packages/b2/b9/85b1ce547620d225ae60e95033e330b4abc8787db4c9bb85a4b6c8bebff2/NodeSocket-0.3.1.tar.gz" } ] }