Metadata-Version: 2.1
Name: searpent-classy-sdk
Version: 0.0.3
Summary: SDK for Searpent Classy API
Home-page: https://github.com/searpent/classy-sdk-python
Author: Searpent s.r.o.
Author-email: support@searpent.com
License: MIT License
Project-URL: API documentation, https://searpentclassy.docs.apiary.io
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6, <4
Description-Content-Type: text/markdown
License-File: LICENSE

# Python SDK for Searpent Classy API

Simplify your calls to Searpent Classy API in Python.

## Installation

You can install the Searpent Python SDK from PyPI:

`pip install searpent-classy-sdk`

The SDK is supported on Python 3.6 to 3.9.

## How to use

1. Before you begin, make sure you have the API token and you know the name of your organization in the Classy API, e.g. 'dev.cz'.

2. Store your API_URL and API_TOKEN in local environment variables and run:

```
from classy_sdk import ClassySDK

client = ClassySDK('dev.cz')
```

or pass them as arguments to the class:

```
client = ClassySDK(source='dev.cz', api_url='some_url', api_token='your_token')
```

you can also specify a timeout (in seconds):

```
client = ClassySDK(source='dev.cz', timeout=10)
```

3. Use your `client` to make API calls. For instance:

```
client.list_cases(from_time='2021-09-01T13:00:00.000Z',
                  to_time='2021-10-02T13:00:00.000Z')
client.get_case('ce4c0299-6518-441b-b43d-1eeae666db36')
new_name = client.create_case('test_case')
client.update_case(new_name, 'test_case_updated')
client.upload_photo_from_file(new_name, 'tests/data/test_image.jpg',
                              'test_image', 'test_image')
```

4. These are the methods that are currently available: 

* list_cases:
    Retrieves a list of cases within an indicated time period.
* get_case:
    Retrieves one particular case.
* create_case:
    Creates a new case.
* update_case:
    Updates the case name as displayed in the Classy interface.
* upload_photo:
    Uploads a photo in base64 format to the case.
* upload_photo_from_file:
    Uploads a photo file to the case.
* list_exports:
    Retrieves a list of performed exports.
* get_export:
    Retrieves one particular export.
* get_export_csv:
    Retrieves a csv file with requested export.
* get_export_download_url:
    Retrieves a csv download url for the requested export.
* list_inspections:
    Retrieves a list of performed inspections.
* create_inspection:
    Creates a new inspection.

## API documentation

See the complete API documentation: [searpentclassy.docs.apiary.io](https://searpentclassy.docs.apiary.io).

