Metadata-Version: 2.1
Name: kommo-python
Version: 0.1.0
Summary: API wrapper for Kommo CRM written in Python
License: MIT
Author: Miguel Alejandro Cepeda
Author-email: alejomjc2011@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: requests (>=2.26.0,<3.0.0)
Description-Content-Type: text/markdown


# kommo-python
![](https://img.shields.io/badge/version-0.1.4-success) ![](https://img.shields.io/badge/Python-3.8%20|%203.9%20|%203.10%20|%203.11-4B8BBE?logo=python&logoColor=white)  

*kommo-python* is an API wrapper for Kommo CRM, written in Python.  
This library uses Oauth2 for authentication.
## Installing
```
pip install kommo-python
```
### Usage
```python
from kommo.client import Client
client = Client(client_id, client_secret, code, domain, redirect_uri)
```
To obtain and set an access token, follow this instructions:
1. **Get access token**
```python
body = {
            "client_id": self.CLIENT_ID,
            "client_secret": self.CLIENT_SECRET,
            "grant_type": "authorization_code",
            "code": self.CODE,
            "redirect_uri": self.REDIRECT_URI
        }
access_token = client.get_access_token(body)
# This call generates the oauth validation and get the access token and refresh token
```
2. **Refresh access token**
```python
refresh_token = client.refresh_access_token(refresh_token)
# "refresh_token" is the token refresh in response after login with oauth with the above url.
```

