{ "info": { "author": "Canonical Landscape team", "author_email": "juju@lists.ubuntu.com", "bugtrack_url": null, "classifiers": [], "description": "***********************************\ntxjuju: a twisted-based Juju client\n***********************************\n\n``txjuju`` provides `twisted `_-based tools\nfor interacting with `Juju `_. This\nincludes both an API client and a CLI wrapper. The library is limited\nto Python 2, but does support both Juju 1.x and 2.x. Support for\nPython 3 is on the radar.\n\nNote that only a portion of Juju's capability is exposed in txjuju.\nThis is because the code originates in the\n`Landscape `_ project and did not grow\nmuch beyond the needs of Landscape. The official Python bindings for\nJuju (`python-libjuju `_)\nwill usually offer a better experience. At some point python-libjuju\nmay entirely supercede txjuju.\n\n\nKey Components\n==============\n\nHere are the essential classes of txjuju:\n\n* `txjuju.api.Endpoint `_\n* `txjuju.api.Juju2APIClient `_ and `txjuju.api.Juju1APIClient `_\n* `txjuju.cli.Juju2CLI `_ and `txjuju.cli.Juju1CLI `_\n\nAdditionally, `txjuju.prepare_for_bootstrap() `_ is especially useful.\n\nFor more information see `DOC.rst `_.\n\n\nExample Usage\n=============\n\nAPI Client\n----------\n\n.. code:: python\n\n from twisted.internet import reactor\n from twisted.internet.defer import inlineCallbacks\n from txjuju.api import Endpoint\n\n endpoint = Endpoint(reactor, \"ec2-1-2-3-4.compute-1.amazonaws.com\")\n deferred = endpoint.connect()\n\n @inlineCallbacks\n def connected(client):\n yield client.login(\"user-admin\", \"54830489236383334d1d9fd84adae72c\")\n yield client.setAnnotations(\"unit\", \"1\", {\"foo\": \"bar\"})\n\n deferred.addCallback(connected)\n\n reactor.run()\n\nCLI Wrapper\n-----------\n\n.. code:: python\n\n import pprint\n from twisted.internet import reactor\n from twisted.internet.defer import inlineCallbacks, returnValue\n from txjuju import prepare_for_bootstrap\n from txjuju.cli import BootstrapSpec, Juju1CLI\n\n cfgdir = \"/tmp/my-juju\"\n spec = BootstrapSpec(\"my-env\", \"lxd\")\n cli = Juju1CLI(cfgdir)\n\n @inlineCallbacks\n def bootstrap():\n prepare_for_bootstrap(spec, \"1.25.6\", cfgdir)\n yield cli.boostrap(spec.name, \"0\")\n raw = yield cli.api_info(spec.name)\n returnValue(raw)\n\n deferred = bootstrap()\n deferred.addCallback(lambda v: pprint.pprint(v))\n\n reactor.run()\n\n\nContributing\n============\n\nIf you'd like to contribute to txjuju, feel free to open an issue or\nsend us a pull request. As far as borrowing from txjuju goes, the\ncode is LGPLv3-licensed.\n\nPackaging\n---------\n\nA Python package may be created using ``python2 setup.py sdist``.\nFor building a debian package see `BUILD `_ and\n`build.sh `_.\n\nStyle\n---------\n\nThe txjuju code follows PEP 8. It is a good idea to frequently run\nsomething like `flake8 `_ when\nmaking changes. Other txjuju-specific guidelines:\n\n* use double quotes for strings\n* test methods should have docstrings\n\nTesting\n---------\n\nTo run the test suite, run ``make test`` or\n``python2 -m unittest txjuju.tests.test_XXX``.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/juju/txjuju", "keywords": "", "license": "LGPLv3", "maintainer": "", "maintainer_email": "", "name": "txjuju", "package_url": "https://pypi.org/project/txjuju/", "platform": "", "project_url": "https://pypi.org/project/txjuju/", "project_urls": { "Homepage": "https://github.com/juju/txjuju" }, "release_url": "https://pypi.org/project/txjuju/0.9.0a2/", "requires_dist": null, "requires_python": "", "summary": "A twisted-based Juju client.", "version": "0.9.0a2" }, "last_serial": 2509945, "releases": { "0.9.0a1": [ { "comment_text": "", "digests": { "md5": "5f37613a8fab93806098bb830ab83e55", "sha256": "fc2501709189b99ef3dbe9c528135f3ab079de5d7af4b671087fb7f156a7bc04" }, "downloads": -1, "filename": "txjuju-0.9.0a1.tar.gz", "has_sig": false, "md5_digest": "5f37613a8fab93806098bb830ab83e55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39625, "upload_time": "2016-12-09T22:33:28", "url": "https://files.pythonhosted.org/packages/06/d4/b17dc04c721d9633b295bc71a9aec0ab37325bf1b6a5694e9b0908bd3154/txjuju-0.9.0a1.tar.gz" } ], "0.9.0a2": [ { "comment_text": "", "digests": { "md5": "5e428fc681850cf4f959bc9f015eaf07", "sha256": "c1d33b23ac0faf3386ad35f1c66fec12ac58a3e103663b097510a529fe9a13dc" }, "downloads": -1, "filename": "txjuju-0.9.0a2.tar.gz", "has_sig": false, "md5_digest": "5e428fc681850cf4f959bc9f015eaf07", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41121, "upload_time": "2016-12-09T22:40:52", "url": "https://files.pythonhosted.org/packages/ec/00/22038c507789d93188393e0f1032927bee21aaebb3b2e4c40e5720a50541/txjuju-0.9.0a2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5e428fc681850cf4f959bc9f015eaf07", "sha256": "c1d33b23ac0faf3386ad35f1c66fec12ac58a3e103663b097510a529fe9a13dc" }, "downloads": -1, "filename": "txjuju-0.9.0a2.tar.gz", "has_sig": false, "md5_digest": "5e428fc681850cf4f959bc9f015eaf07", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41121, "upload_time": "2016-12-09T22:40:52", "url": "https://files.pythonhosted.org/packages/ec/00/22038c507789d93188393e0f1032927bee21aaebb3b2e4c40e5720a50541/txjuju-0.9.0a2.tar.gz" } ] }