{ "info": { "author": "Hengyue Li", "author_email": "hengyue.li@hengyue.li", "bugtrack_url": null, "classifiers": [], "description": "# HY_sshapi \nA set of APIs used to contact with a remote (linux-like) server. \n# Usage \n```\nfrom SSH_Operation.SSH_Operation import SSH_Operation\nssh = SSH_Operation({})\n```\n# Methods \n```\n\n#\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n# Class: SSH_Operation\n#\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# Author: Hengyue Li\n#\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# Version: \n# 2019/03/16\n# new upload function, to upload dir without compression. \n# 2019/03/09: \n# 1. rebuilt interface of InteractiveConnectionSSH\n# 2. change filename to from RemoteContral1\n# 3. make a package contains interface.py\n# 2019/03/01\n# 2018/06/01\n# 2018/02/28\n# 2017/09/04\n#\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# discription:\n# operation between local PC with a remote server\n# remember to call connect or disconnect for some function.\n#\n#\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# Imported :\n# shutil , tempfile , stat\nimport paramiko\nimport shutil,os,tempfile,random\nfrom .interactive import * \n# import SSH_Operation.interactive as interactive\n#\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# Interface:\n#\n# [ini] SSHDict ( see details in paramiko )\n#\n# [sub] connect()\n# connect to server.\n# \n# [sub] connectIfNotConnected() \n#\n# [sub] disconnect()\n# disconnect to server.\n#\n# [fun] IsRemotePathExist(remotepah)\n# check if a remote path is existed or not.\n#\n# [fun] IsRemoteDirExisted(remotepah):\n# for a given remote path, check if it is directory and existed.\n#\n# [fun] RemoveRemoteDIr(remoeDir):\n# remove remote directory\n#\n# [fun] send_commandlist(commandlist)\n# return error\n#\n# [sub] upload_file(localfile,remotedestination)\n# if we call self.upload_file( \"test.file\" , \"/here\" )\n# then \"test.file\" will be renamed to \"here\" and be put at root (\"/\").\n# if there is file (the same name as localfile) existed at server, it will be coverd.\n#\n# [sub] download_file(remotefile,localdestination)\n# the \"remotefile\" will be copied and be saved as \"localdestination\"\n# \"remotefile\" and \"localdestination\" are all files exactly. The same as upload\n#\n# [sub] CompressUploadDir(localdirectoy,remotedestination): !!!! linux dependent (\"tar\" is used)\n# The upload file can only be directory and compression will be used. Faster!\n# usage:\n# localdirectoy = \"some/path/directory\"\n# remotedestination = \"other/path\"\n# the directory would be put at: \"other/path/directory\"\n#\n# [sub] upload_dir(localdirectoy,remotedestination)\n# the same as CompressUploadDir without compression\n#\n# [sub] CompressDownloadDir(Remotedirectoy,localdestination): !!!! linux dependent (\"zip/unzip\" is also used)\n# The download file can only be directory and compression will be used. Faster!\n# usage:\n# Remotedirectoy = \"some/path/directory\"\n# localdestination = \"other/path\"\n# the directory would be put at: \"other/path/directory\"\n# This function is not well designed. Tempral file will be created in the folder.\n# But it looks working fine.\n#\n#-------------------------------------------------------------------------------------\n# || linux server actions ||\n#-------------------------------------------------------------------------------------\n# [fun] IsUserExist(username):\n# return True of False\n# check if username is exist in remote server.\n#\n# [fun] CreatUser(username):\n# return possible errors.\n# 1. Maybe only root user can use this command.\n# 2. not forget to call IsUserExist to check if it is existed or not!\n#\n# [fun] RemoveUser(username):\n# like \"CreatUser\".\n#\n# [fun] GetHomePath(): (make connection before this sub)\n# get the home path of the remote\n#\n#\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "LICENSE.md", "maintainer": "", "maintainer_email": "", "name": "HY-sshapi", "package_url": "https://pypi.org/project/HY-sshapi/", "platform": "", "project_url": "https://pypi.org/project/HY-sshapi/", "project_urls": null, "release_url": "https://pypi.org/project/HY-sshapi/2019.9.29.2335/", "requires_dist": null, "requires_python": "", "summary": "A tool based on paramiko used to connect to remote server.", "version": "2019.9.29.2335" }, "last_serial": 5904674, "releases": { "2019.3.15.1101": [ { "comment_text": "", "digests": { "md5": "5ded82c3a5f02e72960e1e8268934ac9", "sha256": "c296933f5fee3da87db08eab2293da326c760e0b80bd33bc340bc8dabb4ea1b0" }, "downloads": -1, "filename": "HY_sshapi-2019.3.15.1101.tar.gz", "has_sig": false, "md5_digest": "5ded82c3a5f02e72960e1e8268934ac9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5993, "upload_time": "2019-03-15T03:02:14", "url": "https://files.pythonhosted.org/packages/e5/fc/04c814469703843ad70c04c97f39db372d028d3be826980267527bf479b1/HY_sshapi-2019.3.15.1101.tar.gz" } ], "2019.3.16.2122": [ { "comment_text": "", "digests": { "md5": "423a7865d3a41e66edc61e885064f77f", "sha256": "5275fb9ab3302c2ae6d9e3cf1ab53f2bcaebe448b55fc95785ef1e6a2cd1eac1" }, "downloads": -1, "filename": "HY_sshapi-2019.3.16.2122.tar.gz", "has_sig": false, "md5_digest": "423a7865d3a41e66edc61e885064f77f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6487, "upload_time": "2019-03-16T13:23:02", "url": "https://files.pythonhosted.org/packages/ae/c0/92c262feae3d8e0f3f052cdb973d0d23b90f5fc8c3fc43b39a00179d6c51/HY_sshapi-2019.3.16.2122.tar.gz" } ], "2019.3.18.939": [ { "comment_text": "", "digests": { "md5": "711863e3c80c2d9585f0bd5a0c24f71c", "sha256": "8587bc38c8349b225383e4f5e78083edf05919655e3d6a8a3e219334ff7f52f3" }, "downloads": -1, "filename": "HY_sshapi-2019.3.18.939.tar.gz", "has_sig": false, "md5_digest": "711863e3c80c2d9585f0bd5a0c24f71c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6498, "upload_time": "2019-03-18T01:40:01", "url": "https://files.pythonhosted.org/packages/ed/eb/ee178345df471dcdd3eea9f52d471d8f266f38196955b4a45da82cad67c6/HY_sshapi-2019.3.18.939.tar.gz" } ], "2019.3.26.1057": [ { "comment_text": "", "digests": { "md5": "79889009a75709ac6440535cf3ee3ac3", "sha256": "b30a16c64c0e925cd8e0344c76f0433c34c617372aed7d50a70c1db9fd925ee0" }, "downloads": -1, "filename": "HY_sshapi-2019.3.26.1057.tar.gz", "has_sig": false, "md5_digest": "79889009a75709ac6440535cf3ee3ac3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6733, "upload_time": "2019-03-26T02:57:38", "url": "https://files.pythonhosted.org/packages/1c/92/25fec92874801173afa4185b258e13cf65396ebee3df9b6fe04899e9585a/HY_sshapi-2019.3.26.1057.tar.gz" } ], "2019.4.11.2029": [ { "comment_text": "", "digests": { "md5": "d222e7bd9b4a5d070bac3bb804d60f12", "sha256": "e3d83a70ce4fd7d00671997a38480ff5a9e41df5c3e7cea05096fcda25e5c9d8" }, "downloads": -1, "filename": "HY_sshapi-2019.4.11.2029.tar.gz", "has_sig": false, "md5_digest": "d222e7bd9b4a5d070bac3bb804d60f12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9360, "upload_time": "2019-04-11T12:29:44", "url": "https://files.pythonhosted.org/packages/82/07/dbe9ad4281a651db084424dbdfef55593227d587849200240f76755195e5/HY_sshapi-2019.4.11.2029.tar.gz" } ], "2019.4.3.1009": [ { "comment_text": "", "digests": { "md5": "fbdf32e24d25c85ccede12926cefcbaf", "sha256": "11b6a9db55ea3d5c8b8c2bbc18ea147659c4ce08b61a66de9821e30653735c35" }, "downloads": -1, "filename": "HY_sshapi-2019.4.3.1009.tar.gz", "has_sig": false, "md5_digest": "fbdf32e24d25c85ccede12926cefcbaf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7131, "upload_time": "2019-04-03T02:09:36", "url": "https://files.pythonhosted.org/packages/3a/08/5836b6b135b152adf21f724e01a5b699cdde8965703bbec6a21569ba42d3/HY_sshapi-2019.4.3.1009.tar.gz" } ], "2019.4.7.1307": [ { "comment_text": "", "digests": { "md5": "86bf841604d56c270dd929b70c30e6a1", "sha256": "6850455761158bf0009a90c4ff6e29afab1210f89b931052e7661d66c6cc23f8" }, "downloads": -1, "filename": "HY_sshapi-2019.4.7.1307.tar.gz", "has_sig": false, "md5_digest": "86bf841604d56c270dd929b70c30e6a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7464, "upload_time": "2019-04-07T05:07:47", "url": "https://files.pythonhosted.org/packages/de/d5/086a816612aad58582a763d14013e4aa399eb6f5b964f8b8e98359bcdf1a/HY_sshapi-2019.4.7.1307.tar.gz" } ], "2019.9.29.2335": [ { "comment_text": "", "digests": { "md5": "24fa5ea58b11b912d7a8f271cbe2e11f", "sha256": "87fc5b9fee4f76cb91143b85e33ca6ce25516b6cb62c537d1740d11b24a1094c" }, "downloads": -1, "filename": "HY_sshapi-2019.9.29.2335.tar.gz", "has_sig": false, "md5_digest": "24fa5ea58b11b912d7a8f271cbe2e11f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9505, "upload_time": "2019-09-30T03:35:31", "url": "https://files.pythonhosted.org/packages/36/71/41561356df9b706d0bf59b4fe96dd463bb1ee16258f183ff754465f224a3/HY_sshapi-2019.9.29.2335.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "24fa5ea58b11b912d7a8f271cbe2e11f", "sha256": "87fc5b9fee4f76cb91143b85e33ca6ce25516b6cb62c537d1740d11b24a1094c" }, "downloads": -1, "filename": "HY_sshapi-2019.9.29.2335.tar.gz", "has_sig": false, "md5_digest": "24fa5ea58b11b912d7a8f271cbe2e11f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9505, "upload_time": "2019-09-30T03:35:31", "url": "https://files.pythonhosted.org/packages/36/71/41561356df9b706d0bf59b4fe96dd463bb1ee16258f183ff754465f224a3/HY_sshapi-2019.9.29.2335.tar.gz" } ] }