Metadata-Version: 2.1
Name: klasifikasi-py
Version: 0.0.2
Summary: Official Klasifikasi (https://klasifikasi.com) API Client Library
Home-page: https://github.com/bahasa-ai/klasifikasi-py
Author: Z. E. Sagata
Author-email: saga@bahasa.ai
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: arrow (==0.17.0)
Requires-Dist: bleach (==3.2.1)
Requires-Dist: certifi (==2020.11.8)
Requires-Dist: chardet (==3.0.4)
Requires-Dist: colorama (==0.4.4)
Requires-Dist: docutils (==0.16)
Requires-Dist: idna (==2.10)
Requires-Dist: importlib-metadata (==3.1.0)
Requires-Dist: keyring (==21.5.0)
Requires-Dist: packaging (==20.7)
Requires-Dist: pkginfo (==1.6.1)
Requires-Dist: Pygments (==2.7.2)
Requires-Dist: pyparsing (==2.4.7)
Requires-Dist: python-dateutil (==2.8.1)
Requires-Dist: pywin32-ctypes (==0.2.0)
Requires-Dist: readme-renderer (==28.0)
Requires-Dist: requests (==2.25.0)
Requires-Dist: requests-toolbelt (==0.9.1)
Requires-Dist: rfc3986 (==1.4.0)
Requires-Dist: six (==1.15.0)
Requires-Dist: tqdm (==4.54.0)
Requires-Dist: twine (==3.2.0)
Requires-Dist: urllib3 (==1.26.2)
Requires-Dist: webencodings (==0.5.1)
Requires-Dist: wincertstore (==0.2)
Requires-Dist: zipp (==3.4.0)

# Klasifikasi for Python

Official [Klasifikasi](https://klasifikasi.com/) API Client Library

## Installation

`pip install klasifikasi-py`

## Quick start

You will need valid `clientId` & `clientSecret` of your model. You can get those
from credential section at your model page, which is both unique per model

```python
from klasifikasi import Klasifikasi

klasifikasi_instance = Klasifikasi(creds=[
  {
    'client_id': 'client_id',
    'client_secret': 'client_secret'
  }
])
```

You can pass multiple `clientId` & `clientSecret` too

```python
from klasifikasi import Klasifikasi

klasifikasi_instance = Klasifikasi(creds=[
  {
    'client_id': 'client_id_1',
    'client_secret': 'client_secret_1'
  },
  {
    'client_id': 'client_id_2',
    'client_secret': 'client_secret_2'
  }
])
```

## Classify

You need your model `publicId` to start classifying. You can get those from your
model page, or you get get it from here :

```python
models = klasifikasi_instance.get_models()
for publicId in models:
  print(publicId)
```

Classifying example :

```python
result = klasifikasi_instance.classify('publicId', 'query')
```

## Logs

You can get your classifying logs based on your model `publicId`

```python
logs = klasifikasi_instance.classify('publicId', {
  'started_at': '1 December 2020',
  'ended_at': '2 December 2020',
  'skip': 0
  'take': 10
})
```

`ended_at` & `started_at` parameter is mandatory, the rest is optional

## Error

All the function above will throw an Exception if something bad happen. Always
run each function inside `try` & `except` block


