{ "info": { "author": "Simon Fell et al. reluctantly Forked by idbentley", "author_email": "ian.bentley@gmail.com, alanjcastonguay@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "![Pypi Version](https://img.shields.io/pypi/v/pyforce.svg) ![Pypi Downloads](https://img.shields.io/pypi/dm/pyforce.svg)\n\nIntroduction\n============\n\nThis is a reluctant fork of the beatbox project originally authored by Simon\nFell, (his version locked at 0.92) later drastically changed by these guys\nhttps://code.google.com/p/salesforce-beatbox/ (versioned at 20.0).\n\nRenamed to `pyforce` to avoid confusion related to the fractured community\nversion. (https://github.com/superfell/Beatbox/issues/6) Long story short,\nthe python client in the fork at version 20.0 is exceptionally useful, so\ngoing back to 0.92 would be a mistake, however the beatbox version at 20.0 is\nalso no longer maintained (judging by the issues). `pyforce` builds off of\nthe version available there, integrating bug fixes, and new features.\n\nThis module contains 2 versions of the Salesforce.com client:\n\n XMLClient\n An xmltramp wrapper that handles the xml fun.\n PythonClient\n Marshalls the returned objects into proper Python data types. e.g. integer\n fields return integers.\n\nCompatibility\n=============\n\n`pyforce` supports versions 16.0 through 20.0 of the Salesforce Partner Web\nServices API. However, the following API calls have not been implemented at\nthis time:\n\n * emptyRecycleBin\n * invalidateSessions\n * merge\n * process\n * queryAll\n * undelete\n * describeSObject\n * describeDataCategoryGroups\n * describeDataCategoryGroupStructures\n\n`pyforce` supports python 2.x for values of x >=6. It probably works in 2.4,\nbut not officially supported.\n\nBasic Usage Examples\n====================\n\nInstantiate a Python Salesforce.com client:\n >>> svc = pyforce.PythonClient()\n >>> svc.login('username', 'passwordTOKEN')\n\n(Note that interacting with Salesforce.com via the API requires the use of a\n'security token' which must be appended to the password. See sfdc docs for\ndetails)\n\nThe pyforce client allows you to query with sfdc SOQL.\n\nHere's an example of a query for contacts with last name 'Doe':\n\n res = svc.query(\"SELECT Id, FirstName, LastName FROM Contact WHERE LastName='Doe'\")\n res[0]\n {'LastName': 'Doe', 'type': 'Contact', 'Id': '0037000000eRf6vAAC', 'FirstName': 'John'}\n res[0].Id\n '0037000000eRf6vAAC'\n\nAdd a new Lead:\n\n contact = {\n 'type': 'Lead',\n 'LastName': 'Ian',\n 'FirstName': 'Bentley',\n 'Company': '10gen'\n }\n res = svc.create(contact)\n if not res[0]['errors']:\n contact_id = res[0]['id']\n else:\n raise Exception('Contact creation failed {0}'.format(res[0]['errors']))\n\nBatches work automatically (though sfdc limits the number to 200 maximum):\n\n contacts = [\n {\n 'type': 'Lead',\n 'LastName': 'Glick',\n 'FirstName': 'David',\n 'Company': 'Individual'\n },\n {\n 'type': 'Lead',\n 'LastName': 'Ian',\n 'FirstName': 'Bentley',\n 'Company': '10gen'\n }\n ]\n res = svc.create(contacts)\n\nSend a new email, optionally using templates, including attachments and creating activities for associated objects:\n\n simple_email = {\n 'subject': 'Test of Salesforce sendEmail()',\n 'plainTextBody': 'This is a simple test message.',\n 'toAddresses': 'johndoe@example.com,\n }\n res = svc.sendEmail( [simple_email] )\n res\n [{'errors': [], 'success': True}]\n\n complex_email = {\n 'templateId': '00X80000002h4TV', # Id of an EmailTemplate used for Subject and Body, supports field merge from whatId.\n 'targetObjectId':'003808980000GJ', # Id of a Contact, Lead or User which the email will be sent to.\n 'whatId':'500800000RuJo', # Id of a SObject to create an Activity in.\n 'saveAsActivity': True,\n 'useSignature': True,\n 'inReplyTo': '<1234567890123456789%example@example.com>', # RFC2822, a previous email thread.\n 'references': '<1234567890123456789%example@example.com>',\n 'fileAttachments': [{\n 'body': base64_encoded_png,\n 'contentType':'image/png',\n 'fileName':'salesforce_logo.png',\n 'inline':True\n }]\n }\n res = svc.sendEmail( [complex_email] )\n res\n [{'errors': [], 'success': True}]\n\nMore Examples\n=============\n\nThe examples folder contains the examples for the xml client. For examples on\nhow to use the python client see the tests directory.\n\nSome of these other products that were built on top of beatbox can also provide\nexample of `pyforce` use, though this project may diverge from the beatbox api.\n\n * `Salesforce Base Connector`_\n * `Salesforce PFG Adapter`_\n * `Salesforce Auth Plugin`_\n * `RSVP for Salesforce`_\n\n.. _`Salesforce Base Connector`: http://plone.org/products/salesforcebaseconnector\n.. _`Salesforce PFG Adapter`: http://plone.org/products/salesforcepfgadapter\n.. _`Salesforce Auth Plugin`: http://plone.org/products/salesforceauthplugin\n.. _`RSVP for Salesforce`: http://plone.org/products/collective.salesforce.rsvp\n\n\nAlternatives\n============\n\nDavid Lanstein has created a `Python Salesforce Toolkit` that is based on the\n`suds` SOAP library. That project has not seen any commit since June 2011, so\nit is assumed to be abandoned.\n\n.. `Python Salesforce Toolkit`: http://code.google.com/p/salesforce-python-toolkit/\n\nRunning Tests\n=============\n\nAt the fork time, all tests are integration tests that require access to a\nSalesforce environment. It is my intent to change these tests to be stub\nbased unit tests.\n\nFrom the beatbox documentation:\n\nFirst, we need to add some custom fields to the Contacts object in your Salesforce instance:\n\n * Login to your Salesforce.com instance\n * Browse to Setup --> Customize --> Contacts --> Fields --> \"New\" button\n * Add a Picklist (multi-select) labeled \"Favorite Fruit\", then add\n * Apple\n * Orange\n * Pear\n * Leave default of 3 lines and field name should default to \"Favorite_Fruit\"\n * Add a Number labeled \"Favorite Integer\", with 18 places, 0 decimal places\n * Add a Number labeled \"Favorite Float\", with 13 places, 5 decimal places\n\nCreate a sfconfig file in your python path with the following format::\n\n USERNAME='your salesforce username'\n PASSWORD='your salesforce passwordTOKEN'\n\nwhere TOKEN is your Salesforce API login token.\n\nAdd './src' to your PYTHONPATH\n\nRun the tests::\n\n python src/pyforce/tests/test_xmlclient.py\n python src/pyforce/tests/test_pythonClient.py\n\nChangelog\n=========\n\n1.7.3 (2016-08-22)\n Bugfix: initialize value of reduce in getRecordTypes\n\n1.7.2 (2015-12-21)\n Upgraded xmltramp to 2.18 with some inline patching.\n Experimenting with Travis-CI integration.\n \n1.7.1 (2015-12-14)\n Corrected regression bug in xmltramp when updating to new style classes. Fixes issue 26.\n\n1.7 (2015-12-08)\n Address type marshalling to Dict. PEP8 cleanup. New-style exception classes.\n\n1.6 (2015-04-27)\n Introduce logout functionality. New maintainer.\n\n1.5 (2014-10-30)\n Introduce sendEmail functionality.\n\n1.4 (2014-08-14)\n Introduce convertLead functionality.\n\n1.3 (2013-11-7)\n Bugfix introduced in 1.2\n \n1.2 (2013-10-25)\n * Two bugfixes for supporting Python 2.7\n * Fix some dos encoding issues\n Thanks to: @lociii and @gabber7\n\n1.01 (2013-04-10)\n * Fix MANIFEST.in for releasing to pypi\n\n1.0 (2013-04-01)\n * Rename beatbox to pyforce\n * Support embedded dictionaries in python objects submitted to the python\n client\n * Rename writeStringElement method to writeElement for more accuracy in name\n\nBeatbox forked as Pyforce\n-------------------------\n\n20.0 (2010-11-30)\n-----------------\n\n* Add 'encryptedstring' to the list of types marshalled as strings. Thanks\n sobyone.\n [davisagli]\n\n* Update to use version 20.0 of the Salesforce.com partner WSDL by default.\n [davisagli]\n\n19.0 (2010-08-23)\n-----------------\n\n* Update marshalling of describeGlobal and describeSObjects responses to\n include new properties now returned by the API. For backwards\n compatibility, we set the types property of the describeGlobal response\n to a list of the names of all types (which Salesforce now returns in\n separate DescribeGlobalSObjectResult objects).\n [davisagli]\n\n* Update to use version 19.0 of the Salesforce.com partner WSDL by default.\n Also, use the new login.salesforce.com login endpoint by default.\n [davisagli]\n\n16.1 (2010-03-11)\n-----------------\n\n* Catch and retry on exceptions from the socket library, in addition to ones\n from httplib. This fixes a regression introduced in version 16.0.\n [davisagli]\n\n\n16.0 (2009-11-12)\n-----------------\n\n* Don't strip newlines when marshalling the values of textarea fields.\n [davisagli]\n\n* Make sure to add a field to fieldsToNull if its Python value is None.\n [rhettg, davisagli]\n\n* Fix issue where numbers of type long weren't converted to a string.\n [spleeman, davisagli]\n\n* Only catch HTTP exceptions when retrying a connection.\n [spleeman, davisagli]\n\n\n16.0b1 (2009-09-08)\n-------------------\n\n* Log beatbox calls at the debug level.\n [davisagli]\n\n* Fixed a string exception for compatibility with Python 2.6.\n [davisagli]\n\n* Added support for SOSL searches via the search method. Thanks to Alex Tokar\n of Web Collective.\n [davisagli]\n\n* Added an optional cache for the sObject type descriptions needed for\n marshalling query results into Python objects. This can avoid an extra\n describeSObjects API call for each query, but means that the information\n could become stale if the type metadata is modified in Salesforce.com.\n The cache is off by default. Turn it on by passing\n cacheTypeDescriptions=True when instantiating a Python client. The cache may\n be reset by calling the flushTypeDescriptionsCache method of the Python\n client.\n [davisagli]\n\n* Support a full SOQL statement as a parameter to the query method of the\n Python client. The old 3-part method signature (fields, sObjectType,\n conditionalExpression) should continue to work.\n [davisagli]\n\n* In the Python client, support relationship queries and other queries that may\n return multiple types of objects. Object type descriptions (required for\n marshalling field values into the correct Python type) are cached for the\n duration of the query after the first time they are used. Thanks to\n Melnychuk Taras of Quintagroup.\n [davisagli]\n\n* In the Python client, queries now return a list-like QueryRecordSet holding\n a sequence of dict-like QueryRecord objects, instead of a dict containing a\n list of dicts. This allows for more Pythonic access such as results[0].Id\n instead of results['results'][0]['Id']. The old syntax should still work.\n Thanks to Melnychuk Taras of Quintagroup.\n [davisagli]\n\n* Update to use version 16.0 of the Salesforce.com partner WSDL.\n [davisagli]\n\n\n0.12 (2009-05-13)\n-----------------\n\n* Use the default serverUrl value if the passed value evaluates to boolean\n False.\n [davisagli]\n\n0.11 (2009-05-13)\n-----------------\n\n* Access 'created' instead of 'isCreated' in the upsert result. This closes\n http://code.google.com/p/salesforce-beatbox/issues/detail?id=4\n [davisagli]\n\n10.1 (unreleased)\n-----------------\n\n0.10 (2009-05-06)\n-----------------\n\n* Added optional serverUrl parameter when creating a Client.\n [davisagli]\n\npre 0.9.1.1\n-----------\n\n* ancient history", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alanjcastonguay/pyforce", "keywords": "python salesforce salesforce.com", "license": "GNU GENERAL PUBLIC LICENSE Version 2", "maintainer": "", "maintainer_email": "", "name": "pyforce", "package_url": "https://pypi.org/project/pyforce/", "platform": "", "project_url": "https://pypi.org/project/pyforce/", "project_urls": { "Homepage": "https://github.com/alanjcastonguay/pyforce" }, "release_url": "https://pypi.org/project/pyforce/1.8.0/", "requires_dist": null, "requires_python": "", "summary": "A Python client wrapping the Salesforce.com SOAP API", "version": "1.8.0" }, "last_serial": 5525471, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "47797f4be541dc52697f956af849b310", "sha256": "2cf3365445fe8b0e12fa78004276845b1c01d03f404f302cb76da6be2cb04e08" }, "downloads": -1, "filename": "pyforce-1.0.tar.gz", "has_sig": false, "md5_digest": "47797f4be541dc52697f956af849b310", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32493, "upload_time": "2013-04-10T14:53:23", "url": "https://files.pythonhosted.org/packages/0a/34/72b99e784b9e2951fb25da981c01f6be2e4c6c55e9d61b832eb69fd55915/pyforce-1.0.tar.gz" } ], "1.01": [ { "comment_text": "", "digests": { "md5": "08156dc5ac60418080fa525af87ad8d1", "sha256": "c03eb89140b5a82fc478665b699a13862e8f0c7b6a171c44073187d0459f29f5" }, "downloads": -1, "filename": "pyforce-1.01.tar.gz", "has_sig": false, "md5_digest": "08156dc5ac60418080fa525af87ad8d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34689, "upload_time": "2013-04-10T14:56:42", "url": "https://files.pythonhosted.org/packages/40/6e/9547314e00f80b52eec7f9562e7f90350cde094ba30ff82da19bfbe656c2/pyforce-1.01.tar.gz" } ], "1.1dev": [ { "comment_text": "", "digests": { "md5": "3d6680db295c18da0522aa2248a59746", "sha256": "c702e35f671f277e341d31b027df2b1c9f0e5a4e7b2150fc98b60a0ba947e96e" }, "downloads": -1, "filename": "pyforce-1.1dev.tar.gz", "has_sig": false, "md5_digest": "3d6680db295c18da0522aa2248a59746", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34910, "upload_time": "2013-06-04T15:58:39", "url": "https://files.pythonhosted.org/packages/24/8a/1ceabda2209cc15826f8122ff16cf6c839a402e3051889fd00bacfbc6ac1/pyforce-1.1dev.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "6c7536b72603aebaf402c224ae563e21", "sha256": "5bef0fd12d58c5c1888f496486a4e7caf906e66b38641c9213d7d569275c11ee" }, "downloads": -1, "filename": "pyforce-1.2.tar.gz", "has_sig": false, "md5_digest": "6c7536b72603aebaf402c224ae563e21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33441, "upload_time": "2013-10-25T15:13:30", "url": "https://files.pythonhosted.org/packages/c0/c3/dfdb5a2ae71db2e7add92136a103f717775d17fde6fb241ca59905384098/pyforce-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "98c7689335fefa62d9b7b1771ba3d1b8", "sha256": "755f887a432cd35f4106b63a5ff1f66f43fecae3a0cff728f0f1018237f0f3d1" }, "downloads": -1, "filename": "pyforce-1.3.tar.gz", "has_sig": false, "md5_digest": "98c7689335fefa62d9b7b1771ba3d1b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33462, "upload_time": "2013-11-07T23:25:53", "url": "https://files.pythonhosted.org/packages/bf/41/39542fa755162da2d192662ace20ea610213b471a11888eef7bba26aae2e/pyforce-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "f06b8df535887e58a930fe9bc6733e80", "sha256": "25558cf86a02fe378f1f54d97a2e566feac45b4da2e64176f0713ce1b89cb80d" }, "downloads": -1, "filename": "pyforce-1.4.tar.gz", "has_sig": false, "md5_digest": "f06b8df535887e58a930fe9bc6733e80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33753, "upload_time": "2014-08-14T14:58:21", "url": "https://files.pythonhosted.org/packages/ab/85/ac8e8d8a80da9da941a0dd4515f733a223a059c27ff32ac1a6004881d0dd/pyforce-1.4.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "9d121a934030996a01d243cc6a940f01", "sha256": "2bc550b8e6fdf2ea2b77d67a445bb34b7a9d0d736c5eb70ac08749a08a4b80b7" }, "downloads": -1, "filename": "pyforce-1.5.tar.gz", "has_sig": false, "md5_digest": "9d121a934030996a01d243cc6a940f01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36963, "upload_time": "2014-10-30T19:03:41", "url": "https://files.pythonhosted.org/packages/2a/14/a0400f6c7c08109077e910fdf33171815a17ded1f3daef7222ab7c3a2a66/pyforce-1.5.tar.gz" } ], "1.6": [ { "comment_text": "", "digests": { "md5": "f03116fb81211ce959e411bd9506f51f", "sha256": "e823f7f028681e2dd4316f1fa56b252dbf9141ad792112073eb0f2f042b5b2a6" }, "downloads": -1, "filename": "pyforce-1.6.tar.gz", "has_sig": false, "md5_digest": "f03116fb81211ce959e411bd9506f51f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36766, "upload_time": "2015-04-28T00:30:05", "url": "https://files.pythonhosted.org/packages/5a/6d/23af4dfcbfbddeeab9abca7e861a3e1756e61fc7df4a030918a8a8b7a596/pyforce-1.6.tar.gz" } ], "1.7": [ { "comment_text": "", "digests": { "md5": "2338dc6741edd52c1f2a82295a93683c", "sha256": "b7c6504716a356fd41aee2d4b7f2ef866a11661bdb5ef2a53810013f9ca92a2e" }, "downloads": -1, "filename": "pyforce-1.7.tar.gz", "has_sig": false, "md5_digest": "2338dc6741edd52c1f2a82295a93683c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37343, "upload_time": "2015-12-08T17:41:22", "url": "https://files.pythonhosted.org/packages/94/94/d3a8e5c7f41ba2b9126939bcd3cec77178e1a53c0340676e35f712ac7a89/pyforce-1.7.tar.gz" } ], "1.7.1": [ { "comment_text": "", "digests": { "md5": "abe736342c015ef69eb443a1eca122c2", "sha256": "fb15429466b0d6f0f0a6376294bc03d5b26ac2b1b606e2c300471e2882b2b947" }, "downloads": -1, "filename": "pyforce-1.7.1.tar.gz", "has_sig": false, "md5_digest": "abe736342c015ef69eb443a1eca122c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37530, "upload_time": "2015-12-14T22:33:30", "url": "https://files.pythonhosted.org/packages/2c/4a/7e196932eb8cc67582ddb9dfb8d80eee041dc0de4bb2440fab646ff7be70/pyforce-1.7.1.tar.gz" } ], "1.7.2": [ { "comment_text": "", "digests": { "md5": "7d105bd79b035aa718fc607664b27486", "sha256": "af1e9cf49ca220a38d786f2f2d18743380549b843d9786fa71dc0d2a9fd0d9a7" }, "downloads": -1, "filename": "pyforce-1.7.2.tar.gz", "has_sig": false, "md5_digest": "7d105bd79b035aa718fc607664b27486", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36212, "upload_time": "2015-12-22T02:12:08", "url": "https://files.pythonhosted.org/packages/f5/2c/237066284893f103f9b258e61f5523d26896a884f09e274e5fa3d8974256/pyforce-1.7.2.tar.gz" } ], "1.7.3": [ { "comment_text": "", "digests": { "md5": "a06566aef89ee453d46cd8f923d25df0", "sha256": "dca7f83f16a63c2dcd4f0cd6eb6d88c86fc8a495e5478d0822684395cc43d4cf" }, "downloads": -1, "filename": "pyforce-1.7.3.tar.gz", "has_sig": false, "md5_digest": "a06566aef89ee453d46cd8f923d25df0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36380, "upload_time": "2017-08-24T16:55:50", "url": "https://files.pythonhosted.org/packages/7e/28/4f096fa55895b4bfbe417b03363b08a41cc26fe94d1553742d8e6fa1bffc/pyforce-1.7.3.tar.gz" } ], "1.8.0": [ { "comment_text": "", "digests": { "md5": "dc05f92ccd7898b614d03741aaa19cf2", "sha256": "69e11887d421ae31f3658424b10755a194effd2acb84df991dfd3e33e1c07100" }, "downloads": -1, "filename": "pyforce-1.8.0.tar.gz", "has_sig": false, "md5_digest": "dc05f92ccd7898b614d03741aaa19cf2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36800, "upload_time": "2017-12-01T00:05:14", "url": "https://files.pythonhosted.org/packages/6d/7f/dc049baf5d63e4bdfc0b8b1cd9cc16299713dc19fdb8d607a4b82da626d8/pyforce-1.8.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dc05f92ccd7898b614d03741aaa19cf2", "sha256": "69e11887d421ae31f3658424b10755a194effd2acb84df991dfd3e33e1c07100" }, "downloads": -1, "filename": "pyforce-1.8.0.tar.gz", "has_sig": false, "md5_digest": "dc05f92ccd7898b614d03741aaa19cf2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36800, "upload_time": "2017-12-01T00:05:14", "url": "https://files.pythonhosted.org/packages/6d/7f/dc049baf5d63e4bdfc0b8b1cd9cc16299713dc19fdb8d607a4b82da626d8/pyforce-1.8.0.tar.gz" } ] }