Name | slurpkit JSON |
Version |
0.9.18
JSON |
| download |
home_page | None |
Summary | A robust Python SDK for slurpit |
upload_time | 2024-05-21 08:37:36 |
maintainer | None |
docs_url | None |
author | PkServices |
requires_python | None |
license | None |
keywords |
sdk
slurpit
slurpkit
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Slurpit SDK
The Slurpit SDK is a Python package for interacting with the Slurpit API, enabling developers to easily manage devices and planning resources. It is designed for simplicity and flexibility, offering methods for listing devices, retrieving planning data, and exporting information to CSV format.
## Installation
You can install the Slurpit SDK using pip with the following command:
```bash
pip install slurpkit
```
Alternatively, if you prefer to install from source, clone the repository and run the setup script:
```bash
git clone https://gitlab.com/slurpit.io/python-sdk.git
cd slurpit
python setup.py install
```
## Quick Start
To use the SDK, start by importing the package and setting up the API client:
```python
import slurpit
api = slurpit.api(
host="http://localhost:8000",
api_key="1234567890abcdefghijklmnopqrstuvwxqz"
)
```
Replace the `host` and `api_key` with the URL of your Slurpit instance and your API key respectively.
## Working with Devices
Retrieve and print the hostnames of all devices:
```python
devices = api.device.get_devices()
for device in devices:
print(device.hostname)
```
## Exporting Data to CSV
To export planning data to a CSV file:
```python
plannings_csvdata = api.planning.get_plannings(export_csv=True)
result = api.device.save_csv_bytes(plannings_csvdata, "csv/plannings.csv")
```
## Exporting Data as Pandas DataFrame
To export planning data as a pandas dataframe
```python
plannings_df = api.planning.get_plannings(export_df=True)
```
## Pagination
Handle large sets of devices with pagination:
```python
devices = api.device.get_devices(offset=100, limit=1000)
for device in devices:
print(device.hostname)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "slurpkit",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "sdk slurpit slurpkit",
"author": "PkServices",
"author_email": "info@slurpit.io",
"download_url": "https://files.pythonhosted.org/packages/66/45/e6c26752f41dda8959ee469c8a1098f33e89dafc3a5516f4bc8734551a64/slurpkit-0.9.18.tar.gz",
"platform": null,
"description": "# Slurpit SDK\n\nThe Slurpit SDK is a Python package for interacting with the Slurpit API, enabling developers to easily manage devices and planning resources. It is designed for simplicity and flexibility, offering methods for listing devices, retrieving planning data, and exporting information to CSV format.\n\n## Installation\n\nYou can install the Slurpit SDK using pip with the following command:\n\n```bash\npip install slurpkit\n```\n\nAlternatively, if you prefer to install from source, clone the repository and run the setup script:\n\n```bash\ngit clone https://gitlab.com/slurpit.io/python-sdk.git\ncd slurpit\npython setup.py install\n```\n\n## Quick Start\n\nTo use the SDK, start by importing the package and setting up the API client:\n\n```python\nimport slurpit\napi = slurpit.api(\n host=\"http://localhost:8000\", \n api_key=\"1234567890abcdefghijklmnopqrstuvwxqz\"\n)\n```\n\nReplace the `host` and `api_key` with the URL of your Slurpit instance and your API key respectively.\n\n## Working with Devices\n\nRetrieve and print the hostnames of all devices:\n\n```python\ndevices = api.device.get_devices()\nfor device in devices:\n print(device.hostname)\n```\n\n## Exporting Data to CSV\n\nTo export planning data to a CSV file:\n\n```python\nplannings_csvdata = api.planning.get_plannings(export_csv=True)\nresult = api.device.save_csv_bytes(plannings_csvdata, \"csv/plannings.csv\")\n```\n## Exporting Data as Pandas DataFrame\n\nTo export planning data as a pandas dataframe\n\n```python\nplannings_df = api.planning.get_plannings(export_df=True)\n```\n\n## Pagination\n\nHandle large sets of devices with pagination:\n\n```python\ndevices = api.device.get_devices(offset=100, limit=1000)\nfor device in devices:\n print(device.hostname)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "A robust Python SDK for slurpit",
"version": "0.9.18",
"project_urls": null,
"split_keywords": [
"sdk",
"slurpit",
"slurpkit"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6645e6c26752f41dda8959ee469c8a1098f33e89dafc3a5516f4bc8734551a64",
"md5": "b52a6bdeb3849758b880810006f13bc0",
"sha256": "ee700996ac164e7738d032a86b3cd1dfe8408aa38cef78bfecd13f384b4e3493"
},
"downloads": -1,
"filename": "slurpkit-0.9.18.tar.gz",
"has_sig": false,
"md5_digest": "b52a6bdeb3849758b880810006f13bc0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14336,
"upload_time": "2024-05-21T08:37:36",
"upload_time_iso_8601": "2024-05-21T08:37:36.257302Z",
"url": "https://files.pythonhosted.org/packages/66/45/e6c26752f41dda8959ee469c8a1098f33e89dafc3a5516f4bc8734551a64/slurpkit-0.9.18.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-21 08:37:36",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "slurpkit"
}