# Python

## Installation

```bash
pip3 install logsnag
```

## Usage

#### Import Library

```python
from logsnag import LogSnag
```

#### Initialize Client

```python
logsnag = LogSnag(token='7f568d735724351757637b1dbf108e5', project="my-saas")
```

#### Track Event

```python
logsnag.track(
    channel="payments",
    event="New Subscription",
    user_id="user-123",
    icon="💰",
    notify=True,
    tags={
        "plan": "premium",
        "cycle": "monthly",
        "trial": False
    }
)
```

#### User Properties

```python
logsnag.identify(
    user_id="user_123",
    properties={
        "name": "John Doe",
        "email": "john@doe.com",
        "plan": "free",
    }
)
```

#### Publish Insight

```python
logsnag.insight.track(
    title='User Count',
    value=100,
    icon='👨',
)
```

#### Increment Insight

```python
logsnag.insight.increment(
    title='User Count',
    value=1,
    icon='👨',
)
```
