{ "info": { "author": "Gokhan Mankara", "author_email": "gokhan@mankara.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Topic :: System :: Systems Administration" ], "description": "# PSYSTEM\n\nPsystem aims to collect system modules ( like psutil, netifaces etc. ) under the one roof \nfor linux platform developers or sysadmins. You can change system, network settings, \nget current settings and send e-mail with mail module.\n\n# SETUP\n\n```\n pip3 install -r requirements.txt\n\n python3 setup.py install\n```\n\n# Python Version\n\n```\n>= 3.4\n>= 2.7\n\n```\n2.7.x, Not compatible\n\n# USAGE\n\n## System Get Usage\n\n```python\n >>> from psystem import system\n\n >>> get = system.Get()\n >>> get.hostname\n >>> 'localhost.localdomain'\n\n >>> get.kernel_version\n '3.16.0-4-amd64'\n\n >>> get.ntp_current_time\n 'Thu Apr 21 10:34:43 2016'\n\n >>> get.ntp_host = \"us.pool.ntp.org\"\n >>> get.ntp_current_time\n 'Thu Apr 21 10:35:10 2016'\n\n >>> get.pid('crypto')\n 33\n\n >>> get.uptime\n '1:03:58'\n\n```\n\n## System Set Usage\n\n```python\n >>> from psystem import system\n >>> get = system.Get()\n >>> set = system.Set()\n\n >>> get.hostname\n 'gokhan'\n >>> set.hostname('gokhan.localhost')\n >>> get.hostname\n 'gokhan.localhost'\n\n\n```\n\n## Network Get Usage\n\n```python\n >>> from psystem import network\n\n >>> get = network.Get()\n\n >>> get.interfaces\n ['lo', 'eth0', 'docker0']\n\n >>> get.ip('eth0')\n [{'addr': '10.41.0.164', 'netmask': '255.255.255.0', 'broadcast': '10.41.0.255'}]\n\n >>> get.mac('eth0')\n [{'addr': 'e4:11:5b:30:2e:c7', 'broadcast': 'ff:ff:ff:ff:ff:ff'}]\n\n >>> get.default_gateway\n ('10.41.0.1', 'eth0')\n\n >>> get.all_gateways\n {'default': {2: ('10.41.0.1', 'eth0')}, 2: [('10.41.0.1', 'eth0', True)]}\n\n >>> get.is_up('eth0')\n True\n\n >>> get.netmask('eth0')\n '255.255.255.0'\n```\n\n## Network Set Usage\n\n```python\n >>> from psystem import network\n >>> set = network.Set()\n\n >>> set.ip('eth0', '10.10.10.10')\n\n >>> set.netmask('eth0', '255.255.255.0'\n```\n\n## System Stats\n\n```python\n\n >>> from psystem import stats\n >>> get = stats.Get()\n \n >>> get.memory\n {'swap': {'percent': 0.0, 'total': '2 GB', 'free': '2 GB', 'used': '0'}, \n 'virtual': {'percent': 15.6, 'total': '993.34 MB', 'free': '631.95 MB', 'used': '361.39 MB'}}\n\n >>> get.cpu()\n 0.1\n\n >>> get.cpu(percpu=True)\n [0.1]\n\n >>> get.disk\n {'/boot': {'percent': 26.5, 'total': '496.67 MB', 'free': '365.29 MB', 'used': '131.38 MB'}, \n '/': {'percent': 7.2, 'total': '17.46 GB', 'free': '16.21 GB', 'used': '1.25 GB'}}\n\n >>> get.network(all_interface=True)\n {'lo': {'errorout': 0, 'packets_sent': '0', 'dropout': 0, 'dropin': 0, 'errin': 0, 'bytes_send': '0',\n 'bytes_recv': '0', 'packets_recv': '0'},\n 'eth0': {'errorout': 0, 'packets_sent': '6.2 KB', 'dropout': 0, 'dropin': 0, 'errin': 0, 'bytes_send': '683.88 KB',\n 'bytes_recv': '5.46 MB', 'packets_recv': '30.55 KB'}}\n \n >>> get.network()\n {'errorout': 0, 'packets_sent': '6.22 KB', 'dropin': 0, 'errin': 0, 'dropout': 0, 'bytes_sent': '686.43 KB',\n 'bytes_recv': '5.47 MB', 'packets_recv': '30.63 KB'}\n\n\n```\n\n## Shell Local\n```python\n >>> from psystem import shell\n >>> shell_local = shell.Local()\n >>> result = shell_local.run(['echo', '-n', 'hello'])\n >>> print(result)\n 'hello'\n```\n\n## Shell Ssh\n```python\n >>> from psystem import shell\n >>> shell_ssh = shell.Ssh(hostname='localhost', username='sam', password='password1')\n >>> result = shell_ssh.run(['echo', '-n', 'hello'])\n >>> print(result)\n 'hello'\n```\n\n## Sending Mail\n```python\n >>> from psystem import mail\n >>> m = mail.Email('mail.domain.com', username=username, password=password, port=587)\n >>> m.send('destination@domain.com', 'from@domain.com', 'subject', 'message')\n\n # Multi destinations\n >>> destinations = \"dest1@domain.com, dest2@domain.com\"\n >>> m.send(destinations, 'from@domain.com', 'subject', 'message')\n \n```\n\n## TODO\n\nSystem\n\nNetwork\n\n## Requirements\n\nPlease see the [requirements text file](requirements.txt)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gokhanm/psystem", "keywords": "linux system,network,mail,shell,log", "license": "GNU GENERAL PUBLIC LICENSE", "maintainer": null, "maintainer_email": null, "name": "psystem", "package_url": "https://pypi.org/project/psystem/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/psystem/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/gokhanm/psystem" }, "release_url": "https://pypi.org/project/psystem/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Linux System Python Module", "version": "0.2.0" }, "last_serial": 2487892, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "66714dbe2982b473439cbadaa55d0de6", "sha256": "999308fef505dac73975f35971e3177a622cce7a97f2928e3bd2a1ece94607f0" }, "downloads": -1, "filename": "psystem-0.2.0.tar.gz", "has_sig": false, "md5_digest": "66714dbe2982b473439cbadaa55d0de6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9973, "upload_time": "2016-11-28T17:40:28", "url": "https://files.pythonhosted.org/packages/39/94/09688cf67b6cc4e803a027393f445a289e5d23ab90344cce7bdc962ef5f5/psystem-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "66714dbe2982b473439cbadaa55d0de6", "sha256": "999308fef505dac73975f35971e3177a622cce7a97f2928e3bd2a1ece94607f0" }, "downloads": -1, "filename": "psystem-0.2.0.tar.gz", "has_sig": false, "md5_digest": "66714dbe2982b473439cbadaa55d0de6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9973, "upload_time": "2016-11-28T17:40:28", "url": "https://files.pythonhosted.org/packages/39/94/09688cf67b6cc4e803a027393f445a289e5d23ab90344cce7bdc962ef5f5/psystem-0.2.0.tar.gz" } ] }