{ "info": { "author": "Microsoft Corporation", "author_email": "BigCompute@microsoft.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development" ], "description": "===============================\nAzure Batch Apps Python Client\n===============================\n\nThe package is to enable Azure Batch Apps customers to interact with the\nManagement API using Python.\n\nThis client module is designed to work with the applications set up within an \nexisting Batch Apps service.\nYou can upload your Application Image and Cloud Assembly via the `Batch Apps Portal `_.\nFor more information on setting this up, `check out this article `_.\n\n\nLicense\n========\n\nThis project is licensed under the MIT License.\nFor details see LICENSE.txt or visit ``_\n\nInstallation\n============\n\nThis package has been tested with Python 2.6, 2.7, 3.2, 3.3 and 3.4\n\n>> pip install azure-batch-apps\n\nRequired packages:\n\n* `Requests `_\n\n* `Keyring `_\n\n* `Requests-OAuthlib `_\n\n\nDocumentation\n=============\n\nThe documentation is generated by Sphinx and can be found zipped up in the project \nroot. It is also hosted online `here `_.\n\n\nRelease History\n================\n\nFor full summary of changes, see CHANGES.txt\n\n* 2015-07-15\t- 0.5.2\n\t- Fixed bug in download streaming\n* 2015-07-09\t- 0.5.1\n\t- Added auto-refresh for unattended tokens\n\t- Exposed configuration of block size to vary upload and download callback frequency\n* 2015-07-01\t- 0.5.0\n\t- Added progress callbacks for file upload and download\n\t- Removed 3 instance minimum for pool creation\n* 2015-05-11\t- 0.4.0\n\t- Added optional auth config validation\n\t- Added JobSubmission.settings attribute\n* 2015-01-13\t- 0.3.0\n\t- Added preliminary support for Batch Apps pool management\n* 2014-11-26\t- 0.2.0\t\n\t- Changed file upload format\n\t- Changed Authentication config format\n\t- Changed terminology: application to jobtype\n\t- Changed terminology: service principal to unattended account\n\t- Added FileCollection.index method\n\t- Added better handling for missing auth values in Configuration\n* 2014-11-03\t- 0.1.1 \n\t- Authentication bug fixes\n* 2014-10-28\t- 0.1.0\t\n\t- Beta Release\n\n\nUsage\n============\n\nApplication Configuration\n--------------------------\n\nIn order to interact with the applications set up in your services in your Batch Apps \naccount, you will need to configure the python client.\n\nWhen you instantiate a Configuration object for the first time, the configuration \nfile will be created by default as::\n\n\t$HOME/BatchAppsData/batch_apps.ini\n\nA single configuration object represent a single service in your Batch Apps account.\nThis means that each configuration needs an endpoint and client ID.\n\nTo set up a new job type reference you can add it to the configuration file, \nalong with any custom parameters you want associated with it.\n\nYou can edit the file directly, or via the Configuration class::\n\n\tfrom batchapps import Configuration\n\n\t# These can be retrieved when creating an unattended account in the Batch Apps portal.\n\t# See the authentication section below for more details.\n\tendpoint = 'myservice.batchapps.core.windows.net'\n\taccount_details = 'ClientID=xxxxxxxx;TenantID=abcdefg'\n\taccount_key = '12345'\n\n\tcfg = Configuration(log_level='debug', default=True)\n\tcfg.aad_config(account=account_details, key=account_key,\n\t\tendpoint=endpoint, unattended=True)\n\n\tcfg.add_jobtype('my_job_type')\n\n\t# Set this job type as the current job type\n\tcfg.current_jobtype('my_job_type')\n\n\t# Set the current job type as the default job type for future jobs\n\tcfg.set_default_jobtype()\n\n\t# Set up some default parameter values for the current job type\n\tcfg.set('quality', 10)\n\tcfg.set('timeout', 500)\n\n\t# Save updated configuration to file\n\tcfg.save_config()\n\nAuthentication\n---------------\n\nThe module authenticates with Azure Active Directory (an implementation of OAuth2).\nThe batchapps module provides a helper class to assist in retrieving an AAD token \nusing Requests-OAuthlib. However if you have a preferred OAuth implementation, you \ncan authenticate with this instead.\n\nYou can create a set of \"Unattended Account\" credentials in your \n`Batch Apps account `_. These will be in the \nformat::\n\n\tAccount Id = ClientId=abc;TenantId=xyz\n\tAccount Key = ***********************\n\nOnce you have these credentials, you can authenticate the python client by adding \nthem to the batch_apps.ini configuration either with Python, as described above, \nor by editing the file directly::\n\n\t[Authentication]\n\tendpoint = myservice.batchapps.core.windows.net\n\tunattended_account = ClientID=abc;TenantID=xyz\n\tunattended_key = ***********************\n\nThen you can authenticate with these credentials::\n\n\tfrom batchapps import AzureOAuth\n\n\tcreds = AzureOAuth.get_unattended_session()\n\n\nOr alternatively, if you use a different AAD implementation to retrieve a token::\n\n\tfrom batchapps import Credentials, Configuration\n\timport my_oauth\n\n\tclient_id = \"abc\"\n\tcfg = Configuration()\n\n\taad_token = my_oauth.get_token(client_id)\n\tcreds = Credentials(cfg, client_id, token=aad_token)\n\nAuthentication via logging into a Web UI will be supported soon.\n\n\nJob Management\n---------------\n\nJob management, including submission, monitoring, and accessing outputs is done \nthrough the JobManager class::\n\n\tfrom batchapps import AzureOAuth, JobManager\n\timport time\n\n\tcreds = AzureOAuth.get_unattended_session()\n\tmgr = JobManager(creds)\n\n\tmy_job = mgr.create_job(\"First Job\")\n\t\n\t# Apply any custom parameters and source files here\n\tmy_job.example_parameter = \"test123\"\n\n\t# Then submit the job\n\tnew_job = my_job.submit()\n\n\tjob_progress = mgr.get_job(url=new_job['link'])\n\t\n\t# Let's allow up to 30 minutes for the job to complete\n\ttimeout = time.time() + 1800\n\n\twhile time.time() < timeout:\n\n\t\tif job_progress.status is 'Complete':\n\t\t\tjob_progress.get_output('c:\\\\my_download_dir')\n\t\t\tbreak\n\n\t\tif job_progress.status is 'Error':\n\t\t\tbreak\n\n\t\ttime.sleep(30)\n\t\tjob_progress.update()\n\t\n\telse:\n\t\tjob_progress.cancel()\n\n\nFile Management\n----------------\n\nFile management, including syncing job source files and dependencies to \nthe cloud can be done using the FileManager class::\n\n\tfrom batchapps import AzureOAuth, FileManager\n\n\tcreds = AzureOAuth.get_unattended_session()\n\tmgr = FileManager(creds)\n\n\tfile_collection = mgr.files_from_dir('c:\\\\my_job_assets')\n\tjob_source = mgr.file_from_path('C:\\\\start_job.bat')\n\tfile_collection.add(job_source)\n\n\tfile_collection.upload()\n\n\t# Check files previously uploaded matching a certain name\n\tmgr.find_files('start_job.bat')\n\n\t# Retrieve a list of all uploaded files\n\tmgr.list_files()\n\n\nPool Management\n----------------\n\nPool management, including creating, resizing and deleting pools can\nbe done using the PoolManager class.\n\nOnce a pool has been created, jobs can be submitted to it. By default, \nwhen a job has been submitted without referencing an existing pool, it will \nuse an auto-pool which will be created for the running of the job, then \ndeleted on completion::\n\n\tfrom batchapps import AzureOAuth, PoolManager\n\n\tcreds = AzureOAuth.get_unattended_session()\n\tmgr = PoolManager(creds)\n\n\tnew_pool = mgr.create_pool(target_size=5)\n\n\t# Create new job submission, then submit to pool\n\tmy_job.pool = new_pool\n\tmy_job.submit()\n\n\t# After job has completed, and we no longer need the pool\n\tpool.delete()", "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/Azure/azure-batch-apps-python", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "azure-batch-apps", "package_url": "https://pypi.org/project/azure-batch-apps/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/azure-batch-apps/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Azure/azure-batch-apps-python" }, "release_url": "https://pypi.org/project/azure-batch-apps/0.5.2/", "requires_dist": null, "requires_python": null, "summary": "Batch Apps Python Client", "version": "0.5.2" }, "last_serial": 1959778, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "da04a19a8e1557070ea65eb35256b0ea", "sha256": "e587b69a81709d712084fc70734ec5a395cf506ab198a0fde1ff65184e965982" }, "downloads": -1, "filename": "azure-batch-apps-0.1.0.tar.gz", "has_sig": false, "md5_digest": "da04a19a8e1557070ea65eb35256b0ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 301244, "upload_time": "2014-10-28T01:06:08", "url": "https://files.pythonhosted.org/packages/f0/3a/c223a82e5d6de7f35d50385819fcefd555affeb29fcd4ec3387a0f0f266c/azure-batch-apps-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "256f494f2db5237beb777817dac99abb", "sha256": "c9b0b5faabff1e3dd49aaacb54ef3c97c5f0991b34c7a59743c0283255a5b80f" }, "downloads": -1, "filename": "azure-batch-apps-0.1.1.tar.gz", "has_sig": false, "md5_digest": "256f494f2db5237beb777817dac99abb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 301477, "upload_time": "2014-11-03T02:26:26", "url": "https://files.pythonhosted.org/packages/0b/a0/dd19d2f2a5d314321417ebdcb31724ee1c0a7093239554b3866f8f603798/azure-batch-apps-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "d660a41212b5c2c9af8937863e732046", "sha256": "9d6617d4f643133f4c368025fa02eaeda6e85f61e36c8785426b14c7c7ea6a84" }, "downloads": -1, "filename": "azure-batch-apps-0.2.0.tar.gz", "has_sig": false, "md5_digest": "d660a41212b5c2c9af8937863e732046", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 308478, "upload_time": "2014-12-09T01:57:04", "url": "https://files.pythonhosted.org/packages/96/79/2c7bfb96718537fa0adb05114414118f73bb8cb1f73d9612ce6c1038d709/azure-batch-apps-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "1645fa3fdb8f5ec0fea7cfaea5c01547", "sha256": "649a8095cf7840e88c502ea47c57c78de541175c34182895744bf7617fb21cb9" }, "downloads": -1, "filename": "azure-batch-apps-0.3.0.tar.gz", "has_sig": false, "md5_digest": "1645fa3fdb8f5ec0fea7cfaea5c01547", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 316341, "upload_time": "2015-01-13T01:57:14", "url": "https://files.pythonhosted.org/packages/8d/af/9fe21691f7d81f842b9e8b06b24d7512b46c84caca9f598e9671f11dc056/azure-batch-apps-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "7f8d75cb9381161c19063e3c259a7aba", "sha256": "d72db6457e90ffdf6dd570d3e4f99d97097e55a69cd953fed7e2754d30038fbb" }, "downloads": -1, "filename": "azure-batch-apps-0.4.0.tar.gz", "has_sig": false, "md5_digest": "7f8d75cb9381161c19063e3c259a7aba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 316554, "upload_time": "2015-05-10T23:36:42", "url": "https://files.pythonhosted.org/packages/4c/da/bfa37b222893f7f0673f3bd4aa3e8a30d695e454cb0dce168cc19587c1e3/azure-batch-apps-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "d544b0ba40113a80b37f5de81b389f0f", "sha256": "617c01daae114b04f8164b09e25479a84d8fee83e360afbb702b73c483317800" }, "downloads": -1, "filename": "azure-batch-apps-0.5.0.tar.gz", "has_sig": false, "md5_digest": "d544b0ba40113a80b37f5de81b389f0f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 318173, "upload_time": "2015-07-02T22:25:58", "url": "https://files.pythonhosted.org/packages/7e/14/7999dfd232be107f3c2d32585d131c1f334aff2b99377be475014e7ec132/azure-batch-apps-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "f1224f333c97334e659bcb348ff679d0", "sha256": "f0abe341ef7a95bcd4301d0c7fce4cb6553bd2487c598fed2581d557780b4414" }, "downloads": -1, "filename": "azure-batch-apps-0.5.1.tar.gz", "has_sig": false, "md5_digest": "f1224f333c97334e659bcb348ff679d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 319254, "upload_time": "2015-07-09T00:54:01", "url": "https://files.pythonhosted.org/packages/5b/31/a66d06246a3408f23cde5616b5e83cb67ef15b4dd0a8e36b7c374c0f194b/azure-batch-apps-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "1ac12ac8c5a70f896f2711724ce57d8e", "sha256": "d6fca8f936389ef212adc44d7f3a2a77e4d429fab95402c9021cbf3a5d4edbef" }, "downloads": -1, "filename": "azure-batch-apps-0.5.2.tar.gz", "has_sig": false, "md5_digest": "1ac12ac8c5a70f896f2711724ce57d8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 319279, "upload_time": "2015-07-15T03:21:12", "url": "https://files.pythonhosted.org/packages/8d/d3/11d974f546bf999a3bf58be6b4c9b8d4dc5231755911a58fced00a28bcfe/azure-batch-apps-0.5.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1ac12ac8c5a70f896f2711724ce57d8e", "sha256": "d6fca8f936389ef212adc44d7f3a2a77e4d429fab95402c9021cbf3a5d4edbef" }, "downloads": -1, "filename": "azure-batch-apps-0.5.2.tar.gz", "has_sig": false, "md5_digest": "1ac12ac8c5a70f896f2711724ce57d8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 319279, "upload_time": "2015-07-15T03:21:12", "url": "https://files.pythonhosted.org/packages/8d/d3/11d974f546bf999a3bf58be6b4c9b8d4dc5231755911a58fced00a28bcfe/azure-batch-apps-0.5.2.tar.gz" } ] }