{ "info": { "author": "Chad Smith", "author_email": "grassfedcode@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only" ], "description": "# pyxterm.js\nA fully functional terminal in your browser.\n\n![screenshot](https://github.com/cs01/pyxterm.js/raw/master/pyxtermjs.gif)\n\n## How does this work?\n\nOn the backend:\n* A [Flask](http://flask.pocoo.org/) server is running\n* The Flask server uses [flask-socketio](https://flask-socketio.readthedocs.io/en/latest/), a websocket library for Flask and socketio\n* A [pty](https://docs.python.org/3/library/pty.html) (\"pseudo-terminal\") is spawned that runs bash.\n * You can think of a pty as a way to serialize/deserialize a terminal session. The Python docs describe it as \"starting another process and being able to write to and read from its controlling terminal programmatically\".\n\nOn the frontend:\n* [Xterm.js](https://xtermjs.org/) is used to render [Xterm](https://en.wikipedia.org/wiki/Xterm) output data in the browser.\n * This means [escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) used by terminals to control the cursor location, color, and other options can be passed directly to Xterm.js and Xterm.js will faithfully render them as a terminal would.\n * Output from the pty process on the backend is fed into it.\n * Input from the browser is passed via websocket to the pty's input\n\n\n## Why?\nThe real purpose of this is to show a basic proof of concept on how to bring Xterm.js, Python, Flask, and Websockets together to run a pty in the browser.\n\nThis is a\n* starting point to build your own web app with a terminal\n* learning tool to understand what a `pty` is, and how to use one in Python\n* way to see Flask and Flask-SocketIO in action\n* way to play around with Xterm.js in a meaningful environment\n\n## Installation\n\n### Option 1\nRun pyxtermjs with no commitment in an ephemeral environment with [pipx](https://github.com/pipxproject/pip-app)\n```\npipx run pyxtermjs # install and run in ephemeral environment\n```\n\n### Option 2\nClone this repository, enter the `pyxtermjs` directory, create a virtual environment (`python3 -m venv venv`), activate it (`source venv/bin/activate`) then run\n```\npip install -r requirements.txt\npython -m pyxtermjs\n```\n\n## Documentation\n```\n>> pyxtermjs --help\nusage: pyxtermjs [-h] [-p PORT] [--debug] [--version] [--command COMMAND]\n [--cmd-args CMD_ARGS]\n\nA fully functional terminal in your browser.\nhttps://github.com/cs01/pyxterm.js\n\noptional arguments:\n -h, --help show this help message and exit\n -p PORT, --port PORT port to run server on (default: 5000)\n --debug debug the server (default: False)\n --version print version and exit (default: False)\n --command COMMAND Command to run in the terminal (default: bash)\n --cmd-args CMD_ARGS arguments to pass to command (i.e. --cmd-args='arg1\n arg2 --flag') (default: )\n\n```\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/cs01/pyxtermjs", "keywords": "xterm,xterm.js,javascript,terminal-emulators,browser,tty,pty,console,terminal", "license": "License :: OSI Approved :: MIT License", "maintainer": "", "maintainer_email": "", "name": "pyxtermjs", "package_url": "https://pypi.org/project/pyxtermjs/", "platform": "", "project_url": "https://pypi.org/project/pyxtermjs/", "project_urls": { "Homepage": "https://github.com/cs01/pyxtermjs" }, "release_url": "https://pypi.org/project/pyxtermjs/0.4.0.1/", "requires_dist": [ "flask-socketio (<=4.0,>=3.0)" ], "requires_python": ">=3.6", "summary": "interactive terminal in the browser", "version": "0.4.0.1" }, "last_serial": 4903536, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "db59505dbcd40699a1602b7796f69b47", "sha256": "5ce4cbc7db4f3a4339fd2f9dcc67d022a01117f05cb1eed74583d51a673854a9" }, "downloads": -1, "filename": "pyxtermjs-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "db59505dbcd40699a1602b7796f69b47", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 7434, "upload_time": "2018-09-05T16:19:48", "url": "https://files.pythonhosted.org/packages/50/44/eae29ece07c502f32686c4a9d3d2808cf7ccc5662845233ca4c8c83f84d8/pyxtermjs-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "839565b1855efcfa7023047d6c70a01b", "sha256": "53dddfda4b854aa34971b567329e4d870449bdd468dbed2876d068fa18701013" }, "downloads": -1, "filename": "pyxtermjs-0.1.0.tar.gz", "has_sig": false, "md5_digest": "839565b1855efcfa7023047d6c70a01b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 3896, "upload_time": "2018-09-05T16:19:50", "url": "https://files.pythonhosted.org/packages/cf/57/d2fe16261a8a5a18ad551cf83ce137c0cfe761f1060004d99d90beddba78/pyxtermjs-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "c0f8452b9cc3969be28eac35c198d624", "sha256": "ca4a5248967aafe29fe5d456ad805032fe99d239240550e7b4333ea91dca7bb0" }, "downloads": -1, "filename": "pyxtermjs-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c0f8452b9cc3969be28eac35c198d624", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 7738, "upload_time": "2018-09-07T01:25:17", "url": "https://files.pythonhosted.org/packages/10/88/5eceeaf78e7fd838c7a226525bfcc02dc4f4330051009c6a414bbbf4f510/pyxtermjs-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "31b9e5632478d5fd961eab3643aa2bee", "sha256": "32119f6368f8a6e952e16122f21243f80866834992847fbb2fc66fd9aef1578d" }, "downloads": -1, "filename": "pyxtermjs-0.2.0.tar.gz", "has_sig": false, "md5_digest": "31b9e5632478d5fd961eab3643aa2bee", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 4054, "upload_time": "2018-09-07T01:25:18", "url": "https://files.pythonhosted.org/packages/10/1c/66d962861191de2ac30d6ea79086a2fe9bf43e4142803cbc3248b08c21ea/pyxtermjs-0.2.0.tar.gz" } ], "0.3.0.0": [ { "comment_text": "", "digests": { "md5": "a87c82b267d7e0572bfccea350b91efb", "sha256": "a2b896097f0895c3c5a0343f9e444c024fb4176e49c28cc8462b27782d6e1aac" }, "downloads": -1, "filename": "pyxtermjs-0.3.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a87c82b267d7e0572bfccea350b91efb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 9738, "upload_time": "2018-09-07T16:48:22", "url": "https://files.pythonhosted.org/packages/0d/af/d8144b89cf9971e9047cef4623e1d826bd0618d0a60670e0ce0c16bf81f6/pyxtermjs-0.3.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2558d6af5f52e697de82902e844c201b", "sha256": "0ffb1e8101a576652aadda032025b3017497ab234fdd01019d1b5e773226f128" }, "downloads": -1, "filename": "pyxtermjs-0.3.0.0.tar.gz", "has_sig": false, "md5_digest": "2558d6af5f52e697de82902e844c201b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 5189, "upload_time": "2018-09-07T16:48:24", "url": "https://files.pythonhosted.org/packages/90/f3/7c7d9cc054c9848ce98c847e87507aa3606d2ff10cc1d22e918db8040562/pyxtermjs-0.3.0.0.tar.gz" } ], "0.4.0.0": [ { "comment_text": "", "digests": { "md5": "43e379d9191e28e3b5759cbca904d63f", "sha256": "c094791e893679712d78b1abb6a2ec02ad98c9be5a003a3a8d13f1bc99b55c32" }, "downloads": -1, "filename": "pyxtermjs-0.4.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "43e379d9191e28e3b5759cbca904d63f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 5394, "upload_time": "2019-03-06T04:55:42", "url": "https://files.pythonhosted.org/packages/8b/8a/5b08c1007b45e1b24b30154d94ebfa74871dbf30b2a28f98f6860495baae/pyxtermjs-0.4.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e92fd992f96e8fe515bd632d97fe7ee6", "sha256": "9468e4a7f602b22eb0d673ffa1863137df7ecfea96126e27fcea0717c5053060" }, "downloads": -1, "filename": "pyxtermjs-0.4.0.0.tar.gz", "has_sig": false, "md5_digest": "e92fd992f96e8fe515bd632d97fe7ee6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5320, "upload_time": "2019-03-06T04:55:43", "url": "https://files.pythonhosted.org/packages/9d/31/9a452f927714267c21c0650da5a4ef98833e709d72eb72aff1af8c4466ac/pyxtermjs-0.4.0.0.tar.gz" } ], "0.4.0.1": [ { "comment_text": "", "digests": { "md5": "639130da423d8c4432916159873fbf06", "sha256": "02e426af145e7f28212eaf426dd089d4f6bc1e13f7f6319a8d5e10a27fa195d0" }, "downloads": -1, "filename": "pyxtermjs-0.4.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "639130da423d8c4432916159873fbf06", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6876, "upload_time": "2019-03-06T05:06:30", "url": "https://files.pythonhosted.org/packages/91/e7/08566695e619d4cd1d6f7f07adc35871ff75a890a55592e6488ced1b8e83/pyxtermjs-0.4.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e9a0b1fb4779ce1af54344c8dad7e08e", "sha256": "cbb05c5821b67890b255b54b81f742ea30045d45b5601683d7bf4e14c8096d2c" }, "downloads": -1, "filename": "pyxtermjs-0.4.0.1.tar.gz", "has_sig": false, "md5_digest": "e9a0b1fb4779ce1af54344c8dad7e08e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6402, "upload_time": "2019-03-06T05:06:31", "url": "https://files.pythonhosted.org/packages/37/00/57a0f752f518eda2a471c38f9526f8e0906a91df0559e703da41e7b0277b/pyxtermjs-0.4.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "639130da423d8c4432916159873fbf06", "sha256": "02e426af145e7f28212eaf426dd089d4f6bc1e13f7f6319a8d5e10a27fa195d0" }, "downloads": -1, "filename": "pyxtermjs-0.4.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "639130da423d8c4432916159873fbf06", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6876, "upload_time": "2019-03-06T05:06:30", "url": "https://files.pythonhosted.org/packages/91/e7/08566695e619d4cd1d6f7f07adc35871ff75a890a55592e6488ced1b8e83/pyxtermjs-0.4.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e9a0b1fb4779ce1af54344c8dad7e08e", "sha256": "cbb05c5821b67890b255b54b81f742ea30045d45b5601683d7bf4e14c8096d2c" }, "downloads": -1, "filename": "pyxtermjs-0.4.0.1.tar.gz", "has_sig": false, "md5_digest": "e9a0b1fb4779ce1af54344c8dad7e08e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6402, "upload_time": "2019-03-06T05:06:31", "url": "https://files.pythonhosted.org/packages/37/00/57a0f752f518eda2a471c38f9526f8e0906a91df0559e703da41e7b0277b/pyxtermjs-0.4.0.1.tar.gz" } ] }