Metadata-Version: 2.1
Name: idcloud-python
Version: 0.2.1
Summary: API Client communicating with THALES IdCloud REST API.
Home-page: https://github.com/idcloud-python
Author: Backbone s.r.o.
Author-email: office@backbone.sk
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Database
Classifier: Topic :: Security
Description-Content-Type: text/markdown
Requires-Dist: python-dotenv (==0.18.*)
Requires-Dist: requests (==2.26.*)
Requires-Dist: pyjwt (==2.1.*)

# idcloud-python

API Client communicating with THALES IdCloud REST API.

## Installation

```shell
# pip
pip install idcloud-python

# pipenv
pipenv install idcloud-python

# poetry
poetry add idcloud-python
```

## Example

#### 1. Create Environment object

```python
from idcloud.configuration import Environment

environment = Environment(name='test-api', api_url='http://127.0.0.1:8000/')
```

---

#### 2. Create Configuration object

```python
from idcloud.configuration import Configuration

configuration = Configuration(
    environment=environment,
    api_key='0e5e171f-1163-4277-9b48-68c3ba5816be',
    tenant_id='b179cc92-a79e-4d05-8b28-8ea8006a9510',
    secret_path='path-to-secret',
    roles=["scs:executeScenario"]
)
```

#### 3. Create ApiClient object

```python
from idcloud.api_client import ApiClient

api_client = ApiClient(configuration=configuration)
```

#### 4. Example Connect Verify Document

```python
from idcloud.enums.capture_method import CaptureMethod
from idcloud.enums.document_type import DocumentType
from idcloud.enums.status import Status


scenario = api_client.connect_verify_document.initiate_document_verification(
    front_white_image=image_data['front'],
    capture_method=CaptureMethod.MOBILE,
    document_type=DocumentType.ID
)

result = api_client.connect_verify_document.verify_results(scenario.id)

if result.status == Status.FINISHED:
    print('Process finished.')
elif result.status in [Status.WAITING, Status.RUNNING]:
    print('Verify results later, when finished.')
elif result.status in [Status.FAILURE, Status.ERROR]:
    print('Handle error or failure.')
```

## Tests

To run tests, you need to run command: `pytest`

Tests require access data to the api. For security reasons, access data is stored in environment variables. To set
environment variables, you need to create an `.env` file from the example in the `.env.example` file.

---
Developed by [BACKBONE s.r.o.](https://www.backbone.sk/), 2021 (C)

## 0.1.0 : 2021-23-07

- Initial release

## 0.2.0 : 2021-04-08

- Added required packages to the setup file

## 0.2.1 : 2021-05-08

- Fixed including CHANGELOG.md


