aiosalesforce


Nameaiosalesforce JSON
Version 0.6.0 PyPI version JSON
download
home_pageNone
SummarySalesforce REST API client
upload_time2024-04-26 22:02:32
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseCopyright 2024 Georgii Bocharov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords rest api asyncio salesforce
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center" style="font-size:40px; margin:0px 10px 0px 10px">
    <em>⚡ aiosalesforce ⚡</em>
</p>
<p align="center">
    <em>Asynchronous Python client for Salesforce APIs</em>
</p>
<p align="center">
<a href="https://github.com/georgebv/aiosalesforce/actions/workflows/test.yml" target="_blank">
    <img src="https://github.com/georgebv/aiosalesforce/actions/workflows/test.yml/badge.svg?event=pull_request" alt="Test">
</a>
<a href="https://codecov.io/gh/georgebv/aiosalesforce" target="_blank">
    <img src="https://codecov.io/gh/georgebv/aiosalesforce/graph/badge.svg?token=KVMS7YVODO" alt="Coverage"/>
</a>
<a href="https://pypi.org/project/aiosalesforce" target="_blank">
    <img src="https://badge.fury.io/py/aiosalesforce.svg" alt="PyPI Package">
</a>
</p>

**Documentation:** https://georgebv.github.io/aiosalesforce

**License:** [MIT](https://opensource.org/licenses/MIT)

**Support:** [ask a question](https://github.com/georgebv/aiosalesforce/discussions)
or [create an issue](https://github.com/georgebv/aiosalesforce/issues/new/choose),
any input is appreciated and would help develop the project

# About

`aiosalesforce` is a modern, production-ready asynchronous Python client
for Salesforce APIs.
It is built on top of the `httpx` library and provides a simple and intuitive API
for interacting with Salesforce's APIs (such as REST and Bulk).

- **Fast:** designed from the ground up to be fully asynchronous :rocket:
- **Resilient:** flexible and robust retrying configuration :gear:
- **Fully typed:** every part of the library is fully typed and annotated :label:
- **Intuitive:** API follows naming conventions of Salesforce's APIs while
  staying idiomatic to Python :snake:
- **Salesforce first:** built with years of experience working with the Salesforce API
  it is configured to work out of the box and incorporates best practices and
  latest Salesforce API features :cloud:
- **Track your API usage:** built-in support for tracking Salesforce API usage
  :chart_with_upwards_trend:

## Requirements

`aiosalesforce` depends on:

- Python 3.11+
- [httpx](https://github.com/encode/httpx)
- [orjson](https://github.com/ijl/orjson)

Optional dependencies:

- [PyJWT](https://github.com/jpadilla/pyjwt)
- [cryptography](https://github.com/pyca/cryptography)

## Installation

```shell
pip install aiosalesforce
```

To use the JWT Bearer Flow authentication install with the `jwt` extra:

```shell
pip install aiosalesforce[jwt]
```

# Demo

Example below shows how to:

- Authenticate against Salesforce using the SOAP login method
- Create a Salesforce client
- Create a new Contact
- Read a Contact by ID
- Execute a SOQL query

```python
import asyncio

from aiosalesforce import Salesforce
from aiosalesforce.auth import SoapLogin
from httpx import AsyncClient

# Reuse authentication session across multiple clients (refreshes automatically)
auth = SoapLogin(
    username="your-username",
    password="your-password",
    security_token="your-security-token",
)

async def main():
    async with AsyncClient() as client:
        # Create a Salesforce client
        salesforce = Salesforce(
            client,
            base_url="https://your-instance.my.salesforce.com",
            auth=auth,
        )

        # Create a new Contact
        contact_id = await salesforce.sobject.create(
            "Contact",
            {
                "FirstName": "John",
                "LastName": "Doe",
                "Email": "john.doe@example.com",
            },
        )
        print(f"Created Contact with ID: {contact_id}")

        # Read Contact by ID
        contact = await salesforce.sobject.get("Contact", contact_id)
        print(contact)

        # Execute a SOQL query
        async for record in salesforce.query("SELECT Id, Name FROM Contact"):
            print(record)


if __name__ == "__main__":
    asyncio.run(main())
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "aiosalesforce",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "REST API, asyncio, salesforce",
    "author": null,
    "author_email": "Georgii Bocharov <bocharovgeorgii@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/1e/b7/180a11d7b49a82caf7d09d9d188a50ebde5dae90750b81f3d7f44d7e2095/aiosalesforce-0.6.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\" style=\"font-size:40px; margin:0px 10px 0px 10px\">\n    <em>\u26a1 aiosalesforce \u26a1</em>\n</p>\n<p align=\"center\">\n    <em>Asynchronous Python client for Salesforce APIs</em>\n</p>\n<p align=\"center\">\n<a href=\"https://github.com/georgebv/aiosalesforce/actions/workflows/test.yml\" target=\"_blank\">\n    <img src=\"https://github.com/georgebv/aiosalesforce/actions/workflows/test.yml/badge.svg?event=pull_request\" alt=\"Test\">\n</a>\n<a href=\"https://codecov.io/gh/georgebv/aiosalesforce\" target=\"_blank\">\n    <img src=\"https://codecov.io/gh/georgebv/aiosalesforce/graph/badge.svg?token=KVMS7YVODO\" alt=\"Coverage\"/>\n</a>\n<a href=\"https://pypi.org/project/aiosalesforce\" target=\"_blank\">\n    <img src=\"https://badge.fury.io/py/aiosalesforce.svg\" alt=\"PyPI Package\">\n</a>\n</p>\n\n**Documentation:** https://georgebv.github.io/aiosalesforce\n\n**License:** [MIT](https://opensource.org/licenses/MIT)\n\n**Support:** [ask a question](https://github.com/georgebv/aiosalesforce/discussions)\nor [create an issue](https://github.com/georgebv/aiosalesforce/issues/new/choose),\nany input is appreciated and would help develop the project\n\n# About\n\n`aiosalesforce` is a modern, production-ready asynchronous Python client\nfor Salesforce APIs.\nIt is built on top of the `httpx` library and provides a simple and intuitive API\nfor interacting with Salesforce's APIs (such as REST and Bulk).\n\n- **Fast:** designed from the ground up to be fully asynchronous :rocket:\n- **Resilient:** flexible and robust retrying configuration :gear:\n- **Fully typed:** every part of the library is fully typed and annotated :label:\n- **Intuitive:** API follows naming conventions of Salesforce's APIs while\n  staying idiomatic to Python :snake:\n- **Salesforce first:** built with years of experience working with the Salesforce API\n  it is configured to work out of the box and incorporates best practices and\n  latest Salesforce API features :cloud:\n- **Track your API usage:** built-in support for tracking Salesforce API usage\n  :chart_with_upwards_trend:\n\n## Requirements\n\n`aiosalesforce` depends on:\n\n- Python 3.11+\n- [httpx](https://github.com/encode/httpx)\n- [orjson](https://github.com/ijl/orjson)\n\nOptional dependencies:\n\n- [PyJWT](https://github.com/jpadilla/pyjwt)\n- [cryptography](https://github.com/pyca/cryptography)\n\n## Installation\n\n```shell\npip install aiosalesforce\n```\n\nTo use the JWT Bearer Flow authentication install with the `jwt` extra:\n\n```shell\npip install aiosalesforce[jwt]\n```\n\n# Demo\n\nExample below shows how to:\n\n- Authenticate against Salesforce using the SOAP login method\n- Create a Salesforce client\n- Create a new Contact\n- Read a Contact by ID\n- Execute a SOQL query\n\n```python\nimport asyncio\n\nfrom aiosalesforce import Salesforce\nfrom aiosalesforce.auth import SoapLogin\nfrom httpx import AsyncClient\n\n# Reuse authentication session across multiple clients (refreshes automatically)\nauth = SoapLogin(\n    username=\"your-username\",\n    password=\"your-password\",\n    security_token=\"your-security-token\",\n)\n\nasync def main():\n    async with AsyncClient() as client:\n        # Create a Salesforce client\n        salesforce = Salesforce(\n            client,\n            base_url=\"https://your-instance.my.salesforce.com\",\n            auth=auth,\n        )\n\n        # Create a new Contact\n        contact_id = await salesforce.sobject.create(\n            \"Contact\",\n            {\n                \"FirstName\": \"John\",\n                \"LastName\": \"Doe\",\n                \"Email\": \"john.doe@example.com\",\n            },\n        )\n        print(f\"Created Contact with ID: {contact_id}\")\n\n        # Read Contact by ID\n        contact = await salesforce.sobject.get(\"Contact\", contact_id)\n        print(contact)\n\n        # Execute a SOQL query\n        async for record in salesforce.query(\"SELECT Id, Name FROM Contact\"):\n            print(record)\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n",
    "bugtrack_url": null,
    "license": "Copyright 2024 Georgii Bocharov  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Salesforce REST API client",
    "version": "0.6.0",
    "project_urls": {
        "Documentation": "https://github.com/georgebv/aiosalesforce",
        "Homepage": "https://github.com/georgebv/aiosalesforce",
        "Repository": "https://github.com/georgebv/aiosalesforce"
    },
    "split_keywords": [
        "rest api",
        " asyncio",
        " salesforce"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d299f4f4d9717e3b49c0bb6c888cbd36165cc4c0b6aca7b35160534ba3f20fd5",
                "md5": "ede50ab12dbeaa19327b33f34c8c1ef6",
                "sha256": "d6e72fba0ef4fb7eeffdc0c196b9de5a24fd573846e2721315e442402bfce696"
            },
            "downloads": -1,
            "filename": "aiosalesforce-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ede50ab12dbeaa19327b33f34c8c1ef6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 42042,
            "upload_time": "2024-04-26T22:02:31",
            "upload_time_iso_8601": "2024-04-26T22:02:31.246357Z",
            "url": "https://files.pythonhosted.org/packages/d2/99/f4f4d9717e3b49c0bb6c888cbd36165cc4c0b6aca7b35160534ba3f20fd5/aiosalesforce-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1eb7180a11d7b49a82caf7d09d9d188a50ebde5dae90750b81f3d7f44d7e2095",
                "md5": "c477023fa2892f30be6f1dfa01478204",
                "sha256": "700cbc313b248b2d0c51d5059abedf0dcd606b93fda180ff9271e14ac47f387d"
            },
            "downloads": -1,
            "filename": "aiosalesforce-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c477023fa2892f30be6f1dfa01478204",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 27471,
            "upload_time": "2024-04-26T22:02:32",
            "upload_time_iso_8601": "2024-04-26T22:02:32.369178Z",
            "url": "https://files.pythonhosted.org/packages/1e/b7/180a11d7b49a82caf7d09d9d188a50ebde5dae90750b81f3d7f44d7e2095/aiosalesforce-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-26 22:02:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "georgebv",
    "github_project": "aiosalesforce",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aiosalesforce"
}
        
Elapsed time: 0.23727s