{ "info": { "author": "zig", "author_email": "remember1637@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Description\n===============\n\nWith this module has beed loaded, then we can \"gain\" any module on the fly. Because the python scripts can do almost anything that the C language can do, so with this module's power, we can throw upgrading away from now on.\n\nQuickstart\n===============\n\n1 - Put a python script on the website, I had put one at: http://oeb1qxnpc.bkt.clouddn.com/hello.py, the file's content is:\n\n.. code:: python\n \n #!/usr/bin/env python\n # -*- coding: utf-8 -*-\n # @author: zig(remember1637@gmail.com)\n\n print(\"hello, pygain\")\n\n2 - Load this module from a local test script file \"test.py\", then \"gain\" the remote \"hello.py\":\n\n.. code:: python\n\n import pygain\n\n pygain.gain(\"hello\", \"http://oeb1qxnpc.bkt.clouddn.com\", [\"py\"])\n\n import hello\n\n3 - Execute the test script(tested from python2.6.6 to python3.5.2):\n\n.. code:: bash\n \n > python test.py\n\nif everything is fine, then we can see the \"hello, pygain\" was printed out\n\nMore reality: import zip package\n======================================\n\n\"gain\" remote script one by one is inefficient, so we can zip scripts together, let's do it\n\n1 - Put a zip that contains some scripts, I had put one at: http://oeb1qxnpc.bkt.clouddn.com/demo.zip, the zip's content is:\n\n demo.zip\n /- __init__.py\n\n /- hello.py\n\n /- hello2.py\n\n2 - Load this module from a local test script file \"test.py\", then \"gain\" the remote \"demo.zip\":\n\n.. code:: python\n\n import pygain\n\n pygain.gain(\"demo\", \"http://oeb1qxnpc.bkt.clouddn.com\", [\"zip\", \"py\"])\n\n import demo.hello2\n\n3 - Execute the test script(tested from python2.6.6 to python3.5.2)\n\n.. code:: bash\n \n > python test.py\n\nif everything is fine, then we can see the \"hello, pygain\" was printed out\n\n4 - But we need only fetch the zip file, the scripts that embeded in the zip will import directly from the zip file.\n\nKeyword arguments\n=======================\nBecause of some special situation, we provider some keyword arguments, we can pass it on as below:\n\n.. code:: python\n\n pygain.gain(\"demo\", \"http://zagzig.me/pygain/demo/v1\", [\"zip\", \"py\"],\n httpheaders={\"Referer\": \"xxx\"}, zippw=\"guesswhat\")\n\n1) httpheaders: when we fetch the remote file, we can pass on some http headers\n\n2) zippw: the remote zip file can be encrypted, so pass this password to decrypt&load the remote zip module\n\nInstallation\n======================\n\n.. code:: bash\n\n pip install pygain", "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/shawhen/pygain", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "pygain", "package_url": "https://pypi.org/project/pygain/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pygain/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/shawhen/pygain" }, "release_url": "https://pypi.org/project/pygain/3.1.9/", "requires_dist": null, "requires_python": null, "summary": "import module from the sky", "version": "3.1.9" }, "last_serial": 2381625, "releases": { "3.1.9": [ { "comment_text": "", "digests": { "md5": "37debd96ffb8089cc950b8fca45857b2", "sha256": "2af54cf4b26ac85cf07470705f3ca9049ecb5b0660208ad5d19ae5b7757951d1" }, "downloads": -1, "filename": "pygain-3.1.9.tar.gz", "has_sig": false, "md5_digest": "37debd96ffb8089cc950b8fca45857b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5180, "upload_time": "2016-10-05T09:17:39", "url": "https://files.pythonhosted.org/packages/11/a7/68fbe008594ac06df6272d08d450f1ba163832c3a1ba9c3461c21a306fc6/pygain-3.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "37debd96ffb8089cc950b8fca45857b2", "sha256": "2af54cf4b26ac85cf07470705f3ca9049ecb5b0660208ad5d19ae5b7757951d1" }, "downloads": -1, "filename": "pygain-3.1.9.tar.gz", "has_sig": false, "md5_digest": "37debd96ffb8089cc950b8fca45857b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5180, "upload_time": "2016-10-05T09:17:39", "url": "https://files.pythonhosted.org/packages/11/a7/68fbe008594ac06df6272d08d450f1ba163832c3a1ba9c3461c21a306fc6/pygain-3.1.9.tar.gz" } ] }