{ "info": { "author": "YPlan", "author_email": "julius@yplanapp.com", "bugtrack_url": null, "classifiers": [], "description": "Salesforce Bulk\n===============\n\nPython client library for accessing the asynchronous Salesforce.com Bulk\nAPI.\n\n\nInstallation\n------------\n\n.. code-block:: python\n\n pip install salesforce-bulk-yplan\n\n\nAuthentication\n--------------\n\nTo access the Bulk API you need to authenticate a user into Salesforce.\nThe easiest way to do this is just to supply ``username`` and\n``password``. This library will use the ``salesforce-oauth-request``\npackage (which you must install) to run the Salesforce OAUTH2 Web flow\nand return an access token.\n\n.. code-block:: python\n\n from salesforce_bulk import SalesforceBulk\n bulk = SalesforceBulk(username=username,password=password)\n\nAlternatively if you run have access to a session ID and instance\\_url\nyou can use those directly:\n\n.. code-block:: python\n\n from urlparse import urlparse\n from salesforce_bulk import SalesforceBulk\n bulk = SalesforceBulk(sessionId=sessionId, host=urlparse(instance_url).hostname)\n\n\nOperations\n----------\n\nThe basic sequence for driving the Bulk API is:\n\n1. Create a new job\n2. Add one or more batches to the job\n3. Wait for each batch to finish\n4. Close the job\n\n\nBulk Query\n----------\n\n.. code-block:: python\n\n SalesforceBulk.create_query_job(object_name, contentType='CSV', concurrency=None)\n\nExample\n\n.. code-block:: python\n\n job = bulk.create_query_job(\"Contact\", contentType='CSV')\n batch = bulk.query(job, \"select Id,LastName from Contact\")\n while not bulk.is_batch_done(job, batch):\n sleep(10)\n bulk.close_job(job)\n >>>\n for row in bulk.get_batch_result_iter(job, batch, parse_csv=True):\n ... print row #row is a dict\n\n\nBulk Insert, Update, Delete\n---------------------------\n\nAll Bulk upload operations work the same. You set the operation when you\ncreate the job. Then you submit one or more documents that specify\nrecords with columns to insert/update/delete. When deleting you should\nonly submit the Id for each record.\n\nFor efficiency you should use the ``post_bulk_batch`` method to post\neach batch of data. (Note that a batch can have a maximum 10,000 records\nand be 1GB in size.) You pass a generator or iterator into this function\nand it will stream data via POST to Salesforce. For help sending CSV\nformatted data you can use the salesforce\\_bulk.CsvDictsAdapter class.\nIt takes an iterator returning dictionaries and returns an iterator\nwhich produces CSV data.\n\nFull example:\n\n.. code-block:: python\n\n from salesforce_bulk import CsvDictsAdapter\n job = bulk.create_insert_job(\"Account\", contentType='CSV')\n accounts = [dict(Name=\"Account%d\" % idx) for idx in xrange(5)]\n csv_iter = CsvDictsAdapter(iter(accounts))\n batch = bulk.post_bulk_batch(job, csv_iter)\n bulk.wait_for_batch(job, batch)\n bulk.close_job(job)\n print \"Done. Accounts uploaded.\"\n\n\nConcurrency mode\n~~~~~~~~~~~~~~~~\n\nWhen creating the job, pass ``concurrency=Serial`` or\n``concurrency=Parallel`` to set the concurrency mode for the job.\n\n\n\n\nHistory\n-------\n\n1.2.1 (2016-07-15)\n------------------\n\n* Remove ``salesforce-oauth-request-yplan`` as a hard requirement in ``setup.py`` (to closer match the original).\n\n\n1.2.0 (2016-07-14)\n------------------\n\n* Brought back ``HISTORY.rst``.\n* Python2 and Python3 compatibility.\n* Forked ``salesforce-bulk-yplan`` package.\n* Depends on ``salesforce-oauth-request-yplan`` from now on.", "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/YPlan/salesforce-bulk", "keywords": null, "license": "Copyright (c) 2013 Scott Persinger\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "salesforce-bulk-yplan", "package_url": "https://pypi.org/project/salesforce-bulk-yplan/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/salesforce-bulk-yplan/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/YPlan/salesforce-bulk" }, "release_url": "https://pypi.org/project/salesforce-bulk-yplan/1.2.1/", "requires_dist": null, "requires_python": null, "summary": "Python interface to the Salesforce.com Bulk API.", "version": "1.2.1" }, "last_serial": 2222811, "releases": { "1.2.0": [ { "comment_text": "", "digests": { "md5": "0084b734eae34771a0fb758d07f46256", "sha256": "1189ce048e0094b6be737fd03bffec53d9863031000cec277d2319ca7f6a1ae2" }, "downloads": -1, "filename": "salesforce-bulk-yplan-1.2.0.tar.gz", "has_sig": false, "md5_digest": "0084b734eae34771a0fb758d07f46256", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14730, "upload_time": "2016-07-15T09:31:21", "url": "https://files.pythonhosted.org/packages/ac/90/c102560a40a4668e30be4bc176105297832ac3982045a23ad967ba974a8b/salesforce-bulk-yplan-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "cfb7939c78d4344cdaa763da711ff67d", "sha256": "27b46a0b824df42272631efb2f4c547673d5672258b92395de7c0e4e820f9e36" }, "downloads": -1, "filename": "salesforce-bulk-yplan-1.2.1.tar.gz", "has_sig": false, "md5_digest": "cfb7939c78d4344cdaa763da711ff67d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14870, "upload_time": "2016-07-15T10:18:58", "url": "https://files.pythonhosted.org/packages/ca/f7/40ffbefd4093ec7358612bb5ba88c546e9153086221d34b874d863ec0225/salesforce-bulk-yplan-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cfb7939c78d4344cdaa763da711ff67d", "sha256": "27b46a0b824df42272631efb2f4c547673d5672258b92395de7c0e4e820f9e36" }, "downloads": -1, "filename": "salesforce-bulk-yplan-1.2.1.tar.gz", "has_sig": false, "md5_digest": "cfb7939c78d4344cdaa763da711ff67d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14870, "upload_time": "2016-07-15T10:18:58", "url": "https://files.pythonhosted.org/packages/ca/f7/40ffbefd4093ec7358612bb5ba88c546e9153086221d34b874d863ec0225/salesforce-bulk-yplan-1.2.1.tar.gz" } ] }