# salespyforce
A Python toolset for performing Salesforce API calls
<table>
<tr>
<td>Latest Stable Release</td>
<td>
<a href='https://pypi.org/project/salespyforce/'>
<img alt="PyPI" src="https://img.shields.io/pypi/v/salespyforce">
</a>
</td>
</tr>
<tr>
<td>Latest Beta/RC Release</td>
<td>
<a href='https://pypi.org/project/salespyforce/#history'>
<img alt="PyPI" src="https://img.shields.io/badge/pypi-1.2.2rc1-blue">
</a>
</td>
</tr>
<tr>
<td>Build Status</td>
<td>
<a href="https://github.com/jeffshurtliff/salespyforce/blob/master/.github/workflows/pythonpackage.yml">
<img alt="GitHub Workflow Status"
src="https://img.shields.io/github/actions/workflow/status/jeffshurtliff/salespyforce/pythonpackage.yml?branch=master">
</a>
</td>
</tr>
<tr>
<td>Supported Versions</td>
<td>
<a href='https://pypi.org/project/salespyforce/'>
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/salespyforce">
</a>
</td>
</tr>
<tr>
<td>Code Coverage</td>
<td>
<a href="https://codecov.io/gh/jeffshurtliff/salespyforce">
<img src="https://codecov.io/gh/jeffshurtliff/salespyforce/branch/master/graph/badge.svg" />
</a>
</td>
</tr>
<tr>
<td>Documentation</td>
<td>
<a href='https://salespyforce.readthedocs.io/en/latest/?badge=latest'>
<img src='https://readthedocs.org/projects/salespyforce/badge/?version=latest' alt='Documentation Status' />
</a>
</td>
</tr>
<tr>
<td>Security Audits</td>
<td>
<a href="https://github.com/marketplace/actions/python-security-check-using-bandit">
<img alt="Bandit" src="https://img.shields.io/badge/security-bandit-yellow.svg">
</a>
</td>
</tr>
<tr>
<td>License</td>
<td>
<a href="https://github.com/jeffshurtliff/salespyforce/blob/master/LICENSE">
<img alt="License (GitHub)" src="https://img.shields.io/github/license/jeffshurtliff/salespyforce">
</a>
</td>
</tr>
<tr>
<td style="vertical-align: top;">Issues</td>
<td>
<a href="https://github.com/jeffshurtliff/salespyforce/issues">
<img style="margin-bottom:5px;" alt="GitHub open issues" src="https://img.shields.io/github/issues-raw/jeffshurtliff/salespyforce"><br />
</a>
<a href="https://github.com/jeffshurtliff/salespyforce/issues">
<img alt="GitHub closed issues" src="https://img.shields.io/github/issues-closed-raw/jeffshurtliff/salespyforce">
</a>
</td>
</tr>
<tr>
<td style="vertical-align: top;">Pull Requests</td>
<td>
<a href="https://github.com/jeffshurtliff/salespyforce/pulls">
<img style="margin-bottom:5px;" alt="GitHub pull open requests" src="https://img.shields.io/github/issues-pr-raw/jeffshurtliff/salespyforce"><br />
</a>
<a href="https://github.com/jeffshurtliff/salespyforce/pulls">
<img alt="GitHub closed pull requests" src="https://img.shields.io/github/issues-pr-closed-raw/jeffshurtliff/salespyforce">
</a>
</td>
</tr>
</table>
## Installation
The package can be installed via pip using the syntax below.
```sh
pip install salespyforce --upgrade
```
You may also clone the repository and install from source using below.
```sh
git clone git://github.com/jeffshurtliff/salespyforce.git
cd salespyforce/
python setup.py install
```
## Change Log
The change log can be found in the [documentation](https://salespyforce.readthedocs.io/en/latest/changelog.html).
## Usage
This section provides basic usage instructions for the package.
### Importing the package
Rather than importing the base package, it is recommended that you import the primary `Salesforce` class using the
syntax below.
```python
from salespyforce import Salesforce
```
### Initializing a Salesforce object instance
The primary `Salesforce` object serves many purposes, the most important being to establish a connection to the
Salesforce environment with which you intend to interact. As such, when initializing an instance of the `Salesforce`
object, you will need to pass it the following information:
* The username and password of the API user
* The Organization ID of the Salesforce environment
* The Base URL and Endpoint URL
* The client ID, client secret, and security token
The `Salesforce` object can be initiated in two different ways:
* Passing the information directly into the object
* Leveraging a "helper" configuration file
#### Passing the information directly into the object
The environment and connection information can be passed directly into the `Salesforce` object when initializing it,
as demonstrated in the example below.
```python
sfdc = Salesforce(
username='admin.user@example.com',
password='example123',
org_id='4DJ000000CeMFYA0',
base_url='https://example-dev-ed.lightning.force.com/',
endpoint_url='https://example-dev-ed.my.salesforce.com/services/oauth2/token',
client_id='3MVG9gTv.DiE8cKRIpEtSN_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_TAoy1Zk_AKGukbqa4KbhM6nVYVUu6md',
client_secret='7536F4A7865559XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX53797BEA88174713CC3C',
security_token='2muXaXXXXXXXXXXXXXXXoVKxz'
)
```
#### Leveraging a "helper" configuration file
As an alternative to passing the connection information to the `Salesforce` class in the way demonstrated above, a
"helper" configuration file in `yaml` or `json` format can be leveraged instead and passed to the `Salesforce` class
when initializing the object.
This is an example of how the configuration file would be written in YAML format:
```yaml
# Helper configuration file for the SalesPyForce package
# Define how to obtain the connection information
connection:
# Define the credentials
username: admin.user@example.com
password: example123
# Define the org information
org_id: 4DJ000000CeMFYA0
base_url: https://example-dev-ed.lightning.force.com/
endpoint_url: https://example-dev-ed.my.salesforce.com/services/oauth2/token
# Define the API connection info
client_key: 3MVG9gTv.DiE8cKRIpEtSN_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_TAoy1Zk_AKGukbqa4KbhM6nVYVUu6md
client_secret: 7536F4A7865559XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX53797BEA88174713CC3C
security_token: 2muXaXXXXXXXXXXXXXXXoVKxz
# Define if SSL certificates should be verified when making API calls
ssl_verify: yes
```
The file can then be referenced using the `helper` argument when initializing the object instance, as shown below.
```python
HELPER_FILE = '/path/to/helper.yml'
sfdc = Salesforce(helper=HELPER_FILE)
```
## Documentation
The documentation is located here: [https://salespyforce.readthedocs.io/en/latest/](https://salespyforce.readthedocs.io/en/latest/)
## License
[MIT License](https://github.com/jeffshurtliff/salespyforce/blob/master/LICENSE)
## Reporting Issues
Issues can be reported within the [GitHub repository](https://github.com/jeffshurtliff/salespyforce/issues).
## Donations
If you would like to donate to this project then you can do so using [this PayPal link](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=XDZ8M6UV6EFK6&item_name=SalesPyForce+Python+API¤cy_code=USD).
## Disclaimer
This package is considered unofficial and is in no way endorsed or supported by [Salesforce Inc](https://www.salesforce.com).
Raw data
{
"_id": null,
"home_page": "https://github.com/jeffshurtliff/salespyforce",
"name": "salespyforce",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Jeff Shurtliff",
"author_email": "jeff.shurtliff@rsa.com",
"download_url": "https://files.pythonhosted.org/packages/e7/b0/948134dbfd07373987a09cad522b33c57116af159629952c6b5ed5944a2d/salespyforce-1.2.2.tar.gz",
"platform": null,
"description": "# salespyforce\nA Python toolset for performing Salesforce API calls\n\n<table>\n <tr>\n <td>Latest Stable Release</td>\n <td>\n <a href='https://pypi.org/project/salespyforce/'>\n <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/salespyforce\">\n </a>\n </td>\n </tr>\n <tr>\n <td>Latest Beta/RC Release</td>\n <td>\n <a href='https://pypi.org/project/salespyforce/#history'>\n <img alt=\"PyPI\" src=\"https://img.shields.io/badge/pypi-1.2.2rc1-blue\">\n </a>\n </td>\n </tr>\n <tr>\n <td>Build Status</td>\n <td>\n <a href=\"https://github.com/jeffshurtliff/salespyforce/blob/master/.github/workflows/pythonpackage.yml\">\n <img alt=\"GitHub Workflow Status\" \n src=\"https://img.shields.io/github/actions/workflow/status/jeffshurtliff/salespyforce/pythonpackage.yml?branch=master\">\n </a>\n </td>\n </tr>\n <tr>\n <td>Supported Versions</td>\n <td>\n <a href='https://pypi.org/project/salespyforce/'>\n <img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/salespyforce\">\n </a>\n </td>\n </tr>\n <tr>\n <td>Code Coverage</td>\n <td>\n <a href=\"https://codecov.io/gh/jeffshurtliff/salespyforce\">\n <img src=\"https://codecov.io/gh/jeffshurtliff/salespyforce/branch/master/graph/badge.svg\" />\n </a>\n </td>\n </tr>\n <tr>\n <td>Documentation</td>\n <td>\n <a href='https://salespyforce.readthedocs.io/en/latest/?badge=latest'>\n <img src='https://readthedocs.org/projects/salespyforce/badge/?version=latest' alt='Documentation Status' />\n </a>\n </td>\n </tr>\n <tr>\n <td>Security Audits</td>\n <td>\n <a href=\"https://github.com/marketplace/actions/python-security-check-using-bandit\">\n <img alt=\"Bandit\" src=\"https://img.shields.io/badge/security-bandit-yellow.svg\">\n </a>\n </td>\n </tr>\n <tr>\n <td>License</td>\n <td>\n <a href=\"https://github.com/jeffshurtliff/salespyforce/blob/master/LICENSE\">\n <img alt=\"License (GitHub)\" src=\"https://img.shields.io/github/license/jeffshurtliff/salespyforce\">\n </a>\n </td>\n </tr>\n <tr>\n <td style=\"vertical-align: top;\">Issues</td>\n <td>\n <a href=\"https://github.com/jeffshurtliff/salespyforce/issues\">\n <img style=\"margin-bottom:5px;\" alt=\"GitHub open issues\" src=\"https://img.shields.io/github/issues-raw/jeffshurtliff/salespyforce\"><br />\n </a>\n <a href=\"https://github.com/jeffshurtliff/salespyforce/issues\">\n <img alt=\"GitHub closed issues\" src=\"https://img.shields.io/github/issues-closed-raw/jeffshurtliff/salespyforce\">\n </a>\n </td>\n </tr>\n <tr>\n <td style=\"vertical-align: top;\">Pull Requests</td>\n <td>\n <a href=\"https://github.com/jeffshurtliff/salespyforce/pulls\">\n <img style=\"margin-bottom:5px;\" alt=\"GitHub pull open requests\" src=\"https://img.shields.io/github/issues-pr-raw/jeffshurtliff/salespyforce\"><br />\n </a>\n <a href=\"https://github.com/jeffshurtliff/salespyforce/pulls\">\n <img alt=\"GitHub closed pull requests\" src=\"https://img.shields.io/github/issues-pr-closed-raw/jeffshurtliff/salespyforce\">\n </a>\n </td>\n </tr>\n</table>\n\n## Installation\nThe package can be installed via pip using the syntax below.\n\n```sh\npip install salespyforce --upgrade\n```\n\nYou may also clone the repository and install from source using below.\n\n```sh\ngit clone git://github.com/jeffshurtliff/salespyforce.git\ncd salespyforce/\npython setup.py install\n```\n\n## Change Log\nThe change log can be found in the [documentation](https://salespyforce.readthedocs.io/en/latest/changelog.html).\n\n## Usage\nThis section provides basic usage instructions for the package.\n\n### Importing the package\nRather than importing the base package, it is recommended that you import the primary `Salesforce` class using the \nsyntax below.\n\n```python\nfrom salespyforce import Salesforce\n```\n\n### Initializing a Salesforce object instance\nThe primary `Salesforce` object serves many purposes, the most important being to establish a connection to the \nSalesforce environment with which you intend to interact. As such, when initializing an instance of the `Salesforce` \nobject, you will need to pass it the following information:\n* The username and password of the API user\n* The Organization ID of the Salesforce environment\n* The Base URL and Endpoint URL\n* The client ID, client secret, and security token\n\nThe `Salesforce` object can be initiated in two different ways:\n* Passing the information directly into the object\n* Leveraging a \"helper\" configuration file\n\n#### Passing the information directly into the object\nThe environment and connection information can be passed directly into the `Salesforce` object when initializing it, \nas demonstrated in the example below.\n\n```python\nsfdc = Salesforce(\n username='admin.user@example.com',\n password='example123',\n org_id='4DJ000000CeMFYA0',\n base_url='https://example-dev-ed.lightning.force.com/',\n endpoint_url='https://example-dev-ed.my.salesforce.com/services/oauth2/token',\n client_id='3MVG9gTv.DiE8cKRIpEtSN_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_TAoy1Zk_AKGukbqa4KbhM6nVYVUu6md',\n client_secret='7536F4A7865559XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX53797BEA88174713CC3C',\n security_token='2muXaXXXXXXXXXXXXXXXoVKxz'\n)\n```\n\n#### Leveraging a \"helper\" configuration file\nAs an alternative to passing the connection information to the `Salesforce` class in the way demonstrated above, a\n\"helper\" configuration file in `yaml` or `json` format can be leveraged instead and passed to the `Salesforce` class\nwhen initializing the object.\n\nThis is an example of how the configuration file would be written in YAML format:\n\n```yaml\n# Helper configuration file for the SalesPyForce package\n\n# Define how to obtain the connection information\nconnection:\n # Define the credentials\n username: admin.user@example.com\n password: example123\n\n # Define the org information\n org_id: 4DJ000000CeMFYA0\n base_url: https://example-dev-ed.lightning.force.com/\n endpoint_url: https://example-dev-ed.my.salesforce.com/services/oauth2/token\n\n # Define the API connection info\n client_key: 3MVG9gTv.DiE8cKRIpEtSN_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_TAoy1Zk_AKGukbqa4KbhM6nVYVUu6md\n client_secret: 7536F4A7865559XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX53797BEA88174713CC3C\n security_token: 2muXaXXXXXXXXXXXXXXXoVKxz\n\n# Define if SSL certificates should be verified when making API calls\nssl_verify: yes\n```\n\nThe file can then be referenced using the `helper` argument when initializing the object instance, as shown below.\n\n```python\nHELPER_FILE = '/path/to/helper.yml'\nsfdc = Salesforce(helper=HELPER_FILE)\n```\n\n## Documentation\nThe documentation is located here: [https://salespyforce.readthedocs.io/en/latest/](https://salespyforce.readthedocs.io/en/latest/)\n\n## License\n[MIT License](https://github.com/jeffshurtliff/salespyforce/blob/master/LICENSE)\n\n## Reporting Issues\nIssues can be reported within the [GitHub repository](https://github.com/jeffshurtliff/salespyforce/issues).\n\n## Donations\nIf you would like to donate to this project then you can do so using [this PayPal link](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=XDZ8M6UV6EFK6&item_name=SalesPyForce+Python+API¤cy_code=USD).\n\n## Disclaimer\nThis package is considered unofficial and is in no way endorsed or supported by [Salesforce Inc](https://www.salesforce.com).\n",
"bugtrack_url": null,
"license": "",
"summary": "A Python toolset for performing Salesforce API calls",
"version": "1.2.2",
"project_urls": {
"Homepage": "https://github.com/jeffshurtliff/salespyforce",
"Issue Tracker": "https://github.com/jeffshurtliff/salespyforce/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e7b0948134dbfd07373987a09cad522b33c57116af159629952c6b5ed5944a2d",
"md5": "9dd3ebc7717873bcc1370ab699593750",
"sha256": "4d39b13dd11809ebc5d36a18738e48e82c3f25dd03b7dfef975bf7dc4b5f592a"
},
"downloads": -1,
"filename": "salespyforce-1.2.2.tar.gz",
"has_sig": false,
"md5_digest": "9dd3ebc7717873bcc1370ab699593750",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 32868,
"upload_time": "2023-11-14T23:05:17",
"upload_time_iso_8601": "2023-11-14T23:05:17.870001Z",
"url": "https://files.pythonhosted.org/packages/e7/b0/948134dbfd07373987a09cad522b33c57116af159629952c6b5ed5944a2d/salespyforce-1.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-14 23:05:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jeffshurtliff",
"github_project": "salespyforce",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "salespyforce"
}