{ "info": { "author": "oznu", "author_email": "dev@oz.nu", "bugtrack_url": null, "classifiers": [], "description": "Python cPanel\n=============\n\n.. image:: https://pypip.in/v/pycpanel/badge.png\n :target: https://crate.io/packages/pycpanel\n\n.. image:: https://pypip.in/d/pycpanel/badge.png\n :target: https://crate.io/packages/pycpanel\n\nA Python client for the cPanel API and CSF.\n\n.. contents::\n :local:\n \n.. _installation:\n\n============\nInstallation\n============\n\nUsing pip::\n\n $ pip install pycpanel\n \n==============\nAuthentication\n==============\n\n\nYou may use either remote access hash or basic user/password authentication. Remote access hash authentication is the prefered method.\n\nBasic user/password authentication\n----------------------------------\n\nWarning: Do not perform authentication this way over an unsecured connection (ssl=False). The use of this method over an unsecured connection can compromise your server.\n\n.. code:: python\n\n import pycpanel\n \n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n \nAccess hash authentication\n--------------------------\n\nhttp://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/RemoteAccess\n\n.. code:: python\n\n import pycpanel\n \n hash = remote_access_hash\n server = pycpanel.conn(hostname='myserver.com.au', hash=hash)\n \nConnection Options\n------------------\n\nThe default options connect to the server as root using SSL on port 2087 without verifying the SSL certificate.\n\n.. code:: python\n\n import pycpanel\n \n server = pycpanel.conn(hostname, username='root', hash=None, password=None, ssl=True, verify=False, check_conn=False)\n \n\n- hostname (required) - the hostname or ip address of the cPanel server.\n- username (optional, default='root') - the authenticating user's username.\n- hash (optional) - The remote access hash for the cPanel server. If not provided a password must be provided instead.\n- password (optional) - The password for the authenticating user. If not provided the remote access hash must be provided instead.\n- ssl (optional, boolean, default=True) - If set to False pycpanel will connect on HTTP port 2086 rather than HTTPS port 2087.\n- verify (optional, boolean, default=False) - If set to True the SSL certificate of the server will be verifying to ensure it is valid.\n- check_conn (optional, boolean, default=True) - If set to True pycpanel will test and authenticate against the server after setting up the connection.\n\n===================\ncPanel External API\n===================\n\nDetailed documentation for the cPanel External API can be found here:\nhttp://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/XmlApi\n\n.. code:: python\n\n pycpanel.api(function, params=None)\n\nExternal API without params\n---------------------------\n\nThis example will print a dict with all the cPanel accounts on the server. No additional params are passed in this example.\n\n.. code:: python\n\n import pycpanel\n\n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n print server.api('listaccts')\n \n \nExternal API with params\n------------------------\n \nThis exmaple will adjust the cPanel account with username 'user1' to have a limit of 10 addon domains.\n\n.. code:: python\n\n import pycpanel\n \n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n \n params = {\n 'user' : 'user1',\n 'MAXADDON ' : 10,\n }\n \n server.api('modifyacct', params=params)\n \n====================\ncPanel API Functions\n====================\n\nDetailed documentation for the cPanel API 2 Functions can be found here:\nhttp://docs.cpanel.net/twiki/bin/view/ApiDocs/Api2/WebHome\n\n.. code:: python\n\n pycpanel.cpanel_api(module, function, user, params=None, version=2)\n\n\nAPI 2 Function without params\n-----------------------------\n\nThis example retrieves a list of email accounts associated with a cPanel account with username 'user1'.\n\n.. code:: python\n\n import pycpanel\n \n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n \n print server.cpanel_api('Email', 'listpops', 'user1')\n \n \nAPI 2 Function with params\n--------------------------\n\nThis example creates a new email account (steve@mydomain.com.au) for the user account 'user1'.\n\n.. code:: python\n\n import pycpanel\n \n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n \n params = {\n 'domain' : 'mydomain.com.au',\n 'email' : 'steve',\n 'password' : '@#fwefq122442',\n 'quota' : 0\n }\n \n server.cpanel_api('Email', 'addpop', 'user1', params=params)\n \n\nUsing cPanel API 1\n------------------\n\nYou can cPanel API 1 calls by specifically making the API call as version 1.\n\n.. code:: python\n\n import pycpanel\n\n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n\n params = {\n 'arg-0' : 'username',\n 'arg-1' : 'password',\n 'arg-2' : 'domain.tld',\n }\n\n server.cpanel_api('Email', 'addpop', 'user1', params=params, version=1)\n\n \n=========================\nConfigServer Firewall API\n=========================\n\nTo use the ConfigServer Firewall (CSF) API, the CSF cPanel plugin must be installed and active on your cPanel server.\n \n\nUnblock IP Address\n------------------\n\nThis function will remove an IP address from the firewall (temp and perm blocks). \n\n.. code:: python\n\n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n \n server.csf.unblock('192.168.0.1')\n \n # Returns True if succesfull.\n\nBlock IP Address\n----------------\n\nThis function will block an IP address on the firewall and add it to the deny file (csf.deny).\n\n.. code:: python\n\n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n \n server.csf.deny('192.168.0.1')\n \n # Returns True if succesfull.\n\nOptionaly, a comment may be left to explain why the IP address was blocked:\n\n.. code:: python\n\n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n \n server.csf.deny('192.168.0.1', comment='Why the IP was blocked\")\n \n # Returns True if succesfull.\n \n \nAllow IP Address\n----------------\n\nThis function will allow an IP address through the firewall and add it to the allow file (csf.allow).\n\n.. code:: python\n\n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n \n server.csf.allow('192.168.0.1')\n \n # Returns True if succesfull.\n\nOptionaly, a comment may be left to explain why the IP address was allowed through the firewall:\n\n.. code:: python\n\n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n\n server.csf.allow('192.168.0.1', comment='Why the IP was allowed\")\n \n # Returns True if succesfull.\n\n\nIgnore IP Address\n-----------------\n\nThis function will ignore an IP address in lfd and add it to the ignore file (csf.ignore) and restart lfd.\n\n.. code:: python\n\n server = pycpanel.conn(hostname='myserver.com.au', password='mypassword')\n \n server.csf.ignore('192.168.0.1')\n \n # Returns True if succesfull.", "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/oznu/pycpanel", "keywords": null, "license": "Apache License", "maintainer": null, "maintainer_email": null, "name": "pycpanel", "package_url": "https://pypi.org/project/pycpanel/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pycpanel/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/oznu/pycpanel" }, "release_url": "https://pypi.org/project/pycpanel/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "Python Client for the cPanel API and CSF.", "version": "0.1.5" }, "last_serial": 1110209, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "07d64b0a9f4d2e48ffd9c0568825aa86", "sha256": "a7737bee0564da4d8386a03ec223e8eff076b3f152a5e16a13dcad2300e8596e" }, "downloads": -1, "filename": "pycpanel-0.1.0.tar.gz", "has_sig": false, "md5_digest": "07d64b0a9f4d2e48ffd9c0568825aa86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2760, "upload_time": "2013-11-24T09:30:18", "url": "https://files.pythonhosted.org/packages/95/df/2b4029471d88c5dfd113c156691010664cae76810cec8c0eecf1a98bc5d4/pycpanel-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f3629c1b613f7ae95a21091a53ee3632", "sha256": "36393f8631ee2091e76faf9dbb26d0c82b76e502f5706e388df19f7b5f517a28" }, "downloads": -1, "filename": "pycpanel-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f3629c1b613f7ae95a21091a53ee3632", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5473, "upload_time": "2013-11-24T11:35:57", "url": "https://files.pythonhosted.org/packages/60/47/534e6104e011d932b63053cb9bd7942beaf1c36de842d1e5dd6b79f79a61/pycpanel-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "24d4f0c0c7cf40068f2c4a218a56a94e", "sha256": "b5f4218d4016a5d2e193e62f2c2e0ca6f395d9f6b394274e536105b6a2273a40" }, "downloads": -1, "filename": "pycpanel-0.1.2.tar.gz", "has_sig": false, "md5_digest": "24d4f0c0c7cf40068f2c4a218a56a94e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6919, "upload_time": "2013-11-28T07:57:36", "url": "https://files.pythonhosted.org/packages/b2/f0/30a6460e8eaa3c8c545b98b11fdb3c80c74e8ab17004afafb4d25174ae51/pycpanel-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "fc21b7e461b47a013b3a24a057c80063", "sha256": "7c4a7f8c6db13376f1c08259985a91d0fa6f8721f324ffcdfa2d7b13593d0e2c" }, "downloads": -1, "filename": "pycpanel-0.1.3.tar.gz", "has_sig": false, "md5_digest": "fc21b7e461b47a013b3a24a057c80063", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8100, "upload_time": "2013-12-08T09:55:38", "url": "https://files.pythonhosted.org/packages/7b/ea/d2b58b7a6da50e89bcf8eae2d480f4a64eea5d66b251e3bd9881404e905f/pycpanel-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "ff3458543fcc17ab87e0d1d0f131ccaf", "sha256": "9d3c43d1769a15065ebd5456ad11512d3fb03203727cddd78fcb9971e5236c1c" }, "downloads": -1, "filename": "pycpanel-0.1.4.macosx-10.8-x86_64.exe", "has_sig": false, "md5_digest": "ff3458543fcc17ab87e0d1d0f131ccaf", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 71998, "upload_time": "2014-04-06T02:30:34", "url": "https://files.pythonhosted.org/packages/df/2c/6026d4a5051c99600fba9536b582d932b9cd1c71b53ecf9f78d041ebc028/pycpanel-0.1.4.macosx-10.8-x86_64.exe" }, { "comment_text": "", "digests": { "md5": "3e40313e6720a48016ffe06da0b65713", "sha256": "30ac9213aa295003d4343badd3d62b9c435a6f88e7e133db6c230573a678fdd1" }, "downloads": -1, "filename": "pycpanel-0.1.4.tar.gz", "has_sig": false, "md5_digest": "3e40313e6720a48016ffe06da0b65713", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8072, "upload_time": "2014-04-06T02:30:31", "url": "https://files.pythonhosted.org/packages/73/ef/ff4da6ab525e43bf25871f84e1c0ec720e2e026e6888e2f9e675b51a3727/pycpanel-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "6e74423245cdb7313f4a5f2676f03294", "sha256": "53d37a7982dfd7dfdebd79a11cb92079eb3388c301c703b113456c80f293e639" }, "downloads": -1, "filename": "pycpanel-0.1.5.tar.gz", "has_sig": false, "md5_digest": "6e74423245cdb7313f4a5f2676f03294", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8293, "upload_time": "2014-06-01T09:14:20", "url": "https://files.pythonhosted.org/packages/93/c6/57815a19790af568adb346fa62d15759eba19aec344ca3a744299ef1a91f/pycpanel-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6e74423245cdb7313f4a5f2676f03294", "sha256": "53d37a7982dfd7dfdebd79a11cb92079eb3388c301c703b113456c80f293e639" }, "downloads": -1, "filename": "pycpanel-0.1.5.tar.gz", "has_sig": false, "md5_digest": "6e74423245cdb7313f4a5f2676f03294", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8293, "upload_time": "2014-06-01T09:14:20", "url": "https://files.pythonhosted.org/packages/93/c6/57815a19790af568adb346fa62d15759eba19aec344ca3a744299ef1a91f/pycpanel-0.1.5.tar.gz" } ] }