# ipsdk
The Itential Python SDK provides a client implementation in Python for writing
scripts that can make API calls to Itential Platform or Itential Automation
Gateway 4.x.
## Features
- Easy API requests with automatic authentication
- Support for OAuth and user/password login
- Customizable connection settings
- Centralized logging configuration
## Getting started
## Requirements
- Python 3.8 or higher
- httpx >= 0.28.1
## Installation
Install `ipsdk` using pip:
```bash
$ pip install ipsdk
```
Or using uv (recommended for development):
```bash
$ uv add ipsdk
```
The `ipsdk` package provides factory functions for connecting to either
Itential Platform or Itential Automation Gateway.
The `platform_factory(...)` function creates a connection to Itential Platform
The `gateway_factory(...)` function creates a connection to Itential Automation Gateway
Use one of the factory functions to create a new connection to the server
and send requests.
```python
>>> import ipsdk
>>> platform = ipsdk.platform_factory(host="platform.itential.dev", user="admin@pronghorn")
>>> res = platform.get("/health/server")
>>> res
<Response [200 OK]>
>>> res.text
'{"version":"15.8.10-2023.2.44","release":"2023.2.9"...`
```
The above works the same for Itential Automation Gateway, simply use
`gateway_factory` instead of `platform_factory` to connect to Itential
Automation Gateway.
Itential Python SDK also supports using `asyncio` to connect to servers as
well. The example below demonstrates how to connect to the server using an
async connection.
```python
import asyncio
import ipsdk
async def main():
p = ipsdk.platform_factory(
host="platform.itential.dev",
user="admin@pronghorn",
want_async=True
)
res = await p.get("/adapters")
if __name__ == "__main__":
asyncio.run(main())
```
The connection object supports the following HTTP methods:
- `GET` - Sends a HTTP GET request to the server and returns the results
- `POST` - Sends a HTTP POST request to the server and returns the results
- `PUT` - Sends a HTTP PUT request to the server and returns the results
- `DELETE` - Sends a HTTP DELETE request to the server and returns the results
- `PATCH` - Sends a HTTP PATCH request to the server and returns the results
The following table shows the keyword arguments for each HTTP method:
| Keyword | `GET` | `POST` | `PUT` | `DELETE` | `PATCH` |
|----------|---------------|----------|----------|---------------|----------|
| `path` | Required | Required | Required | Required | Required |
| `params` | Optional | Optional | Optional | Optional | Optional |
| `json` | Not Supported | Optional | Optional | Not Supported | Optional |
The `path` argument specifies the relative path of the URI. This value is
prepended to the base URL. The base URL for Itential Platform is `<host>` and
the base URL for Itential Automation Gateway is `<host>/api/v2.0`.
The `params` argument accepts a `dict` object that is transformed into the URL
query string. For example, if `params={"foo": "bar"}` the resulting query
string would be `?foo=bar`
The `json` argument accepts the payload to send in the request as JSON. This
argument accepts either a `list` or `dict` object. When specified, the data
will automatically be converted to a JSON string and the `Content-Type` and
`Accept` headers will be set to `application/json`.
## Configuration
Both the `platform_factory` and `gateway_factory` functions support
configuration using keyword arguments. The table below shows the keyword
arguments for each function along with their default value.
| Keyword | `platform_factory` | `gateway_factory` |
|-----------------|--------------------|-------------------|
| `host` | `localhost` | `localhost` |
| `port` | `0` | `0` |
| `use_tls` | `True` | `True` |
| `verify` | `True` | `True` |
| `user` | `admin` | `admin@itential` |
| `password` | `admin` | `admin` |
| `client_id` | `None` | Not Supported |
| `client_secret` | `None` | Not Supported |
| `timeout` | `30` | `30` |
| `want_async` | `False` | `False` |
## Development
For development setup, testing, and contribution guidelines, see the [Development Guide](docs/development.md).
## License
This project is licensed under the GPLv3 open source license. See
[license](LICENSE)
Raw data
{
"_id": null,
"home_page": null,
"name": "ipsdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "api, automation, gateway, itential, platform, rest",
"author": null,
"author_email": "Itential <opensource@itential.com>",
"download_url": "https://files.pythonhosted.org/packages/64/9d/9429b2404d4d21734ef77e6e3aad280040bf0b8921e43309cf02d51d8fb2/ipsdk-0.3.0.tar.gz",
"platform": null,
"description": "# ipsdk\n\nThe Itential Python SDK provides a client implementation in Python for writing\nscripts that can make API calls to Itential Platform or Itential Automation\nGateway 4.x.\n\n## Features\n\n- Easy API requests with automatic authentication\n- Support for OAuth and user/password login\n- Customizable connection settings\n- Centralized logging configuration\n\n## Getting started\n\n## Requirements\n\n- Python 3.8 or higher\n- httpx >= 0.28.1\n\n## Installation\n\nInstall `ipsdk` using pip:\n\n```bash\n$ pip install ipsdk\n```\n\nOr using uv (recommended for development):\n\n```bash\n$ uv add ipsdk\n```\n\nThe `ipsdk` package provides factory functions for connecting to either\nItential Platform or Itential Automation Gateway.\n\nThe `platform_factory(...)` function creates a connection to Itential Platform\nThe `gateway_factory(...)` function creates a connection to Itential Automation Gateway\n\nUse one of the factory functions to create a new connection to the server\nand send requests.\n\n```python\n>>> import ipsdk\n>>> platform = ipsdk.platform_factory(host=\"platform.itential.dev\", user=\"admin@pronghorn\")\n>>> res = platform.get(\"/health/server\")\n>>> res\n<Response [200 OK]>\n>>> res.text\n'{\"version\":\"15.8.10-2023.2.44\",\"release\":\"2023.2.9\"...`\n```\n\nThe above works the same for Itential Automation Gateway, simply use\n`gateway_factory` instead of `platform_factory` to connect to Itential\nAutomation Gateway.\n\nItential Python SDK also supports using `asyncio` to connect to servers as\nwell. The example below demonstrates how to connect to the server using an\nasync connection.\n\n```python\nimport asyncio\nimport ipsdk\n\nasync def main():\n p = ipsdk.platform_factory(\n host=\"platform.itential.dev\",\n user=\"admin@pronghorn\",\n want_async=True\n )\n\n res = await p.get(\"/adapters\")\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\nThe connection object supports the following HTTP methods:\n\n- `GET` - Sends a HTTP GET request to the server and returns the results\n- `POST` - Sends a HTTP POST request to the server and returns the results\n- `PUT` - Sends a HTTP PUT request to the server and returns the results\n- `DELETE` - Sends a HTTP DELETE request to the server and returns the results\n- `PATCH` - Sends a HTTP PATCH request to the server and returns the results\n\nThe following table shows the keyword arguments for each HTTP method:\n\n | Keyword | `GET` | `POST` | `PUT` | `DELETE` | `PATCH` |\n |----------|---------------|----------|----------|---------------|----------|\n | `path` | Required | Required | Required | Required | Required |\n | `params` | Optional | Optional | Optional | Optional | Optional |\n | `json` | Not Supported | Optional | Optional | Not Supported | Optional |\n\nThe `path` argument specifies the relative path of the URI. This value is\nprepended to the base URL. The base URL for Itential Platform is `<host>` and\nthe base URL for Itential Automation Gateway is `<host>/api/v2.0`.\n\nThe `params` argument accepts a `dict` object that is transformed into the URL\nquery string. For example, if `params={\"foo\": \"bar\"}` the resulting query\nstring would be `?foo=bar`\n\nThe `json` argument accepts the payload to send in the request as JSON. This\nargument accepts either a `list` or `dict` object. When specified, the data\nwill automatically be converted to a JSON string and the `Content-Type` and\n`Accept` headers will be set to `application/json`.\n\n## Configuration\n\nBoth the `platform_factory` and `gateway_factory` functions support\nconfiguration using keyword arguments. The table below shows the keyword\narguments for each function along with their default value.\n\n | Keyword | `platform_factory` | `gateway_factory` |\n |-----------------|--------------------|-------------------|\n | `host` | `localhost` | `localhost` |\n | `port` | `0` | `0` |\n | `use_tls` | `True` | `True` |\n | `verify` | `True` | `True` |\n | `user` | `admin` | `admin@itential` |\n | `password` | `admin` | `admin` |\n | `client_id` | `None` | Not Supported |\n | `client_secret` | `None` | Not Supported |\n | `timeout` | `30` | `30` |\n | `want_async` | `False` | `False` |\n\n## Development\n\nFor development setup, testing, and contribution guidelines, see the [Development Guide](docs/development.md).\n\n\n## License\n\nThis project is licensed under the GPLv3 open source license. See\n[license](LICENSE)\n",
"bugtrack_url": null,
"license": "GPL-3.0-or-later",
"summary": "Itential Python SDK",
"version": "0.3.0",
"project_urls": {
"Documentation": "https://github.com/itential/ipsdk",
"Homepage": "https://itential.com",
"Repository": "https://github.com/itential/ipsdk"
},
"split_keywords": [
"api",
" automation",
" gateway",
" itential",
" platform",
" rest"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e9f4df66b3239449b6f240e963fdaa2e2cdac329597421e4e943bd2ea86622f3",
"md5": "2f43beb632d5e635f3addd77127e6daa",
"sha256": "05204b9ab646e89060d7ea8f44f26411e446582e6111702e69f77d950ad0d444"
},
"downloads": -1,
"filename": "ipsdk-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2f43beb632d5e635f3addd77127e6daa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 31340,
"upload_time": "2025-08-12T21:33:42",
"upload_time_iso_8601": "2025-08-12T21:33:42.323996Z",
"url": "https://files.pythonhosted.org/packages/e9/f4/df66b3239449b6f240e963fdaa2e2cdac329597421e4e943bd2ea86622f3/ipsdk-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "649d9429b2404d4d21734ef77e6e3aad280040bf0b8921e43309cf02d51d8fb2",
"md5": "28aebce8505f0ff69fabf32b9a1a6426",
"sha256": "4fd5bbf724bac2381b68853757edd19fbd44bf41f98d1c550b18cd69145ffe89"
},
"downloads": -1,
"filename": "ipsdk-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "28aebce8505f0ff69fabf32b9a1a6426",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 80477,
"upload_time": "2025-08-12T21:33:43",
"upload_time_iso_8601": "2025-08-12T21:33:43.541183Z",
"url": "https://files.pythonhosted.org/packages/64/9d/9429b2404d4d21734ef77e6e3aad280040bf0b8921e43309cf02d51d8fb2/ipsdk-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-12 21:33:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "itential",
"github_project": "ipsdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ipsdk"
}