Metadata-Version: 2.1
Name: events-sdk-python
Version: 0.0.1
Summary: Events SDK Python for Hightouch event collection.
Author-email: Hightouch <engineering@hightouch.com>
License: MIT License
        
        Copyright (c) 2023 Hightouch (hightouch.com)
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
        ---
        
        MIT License
        
        Copyright (c) 2021 Segment (segment.com)
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/ht-sdks/events-sdk-python
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
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: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests ~=2.7
Requires-Dist: backoff ~=2.1
Requires-Dist: python-dateutil ~=2.2
Provides-Extra: dev
Requires-Dist: PyJWT ~=2.8 ; extra == 'dev'
Requires-Dist: pyjwt[crypto] ; extra == 'dev'
Requires-Dist: mock ==2.0.0 ; extra == 'dev'
Requires-Dist: ruff ==0.1.4 ; extra == 'dev'

﻿# Events SDK Python

## Installation

Install `events-sdk-python` using pip:

```bash
python -m pip install events-sdk-python
```

## Usage

By default, you do not need to manually instantiate the client. Simply set your key and start calling methods.

```python
import hightouch.htevents as htevents

htevents.write_key = 'YOUR_WRITE_KEY'

htevents.identify('userId1', {
    'email': 'bat@example.com',
    'name': 'Person People',
})

htevents.track('userId1', 'Order Completed', {})
```

**Note** If you need to send data to multiple Hightouch sources, you can initialize one new Client per `write_key`.

```python
from hightouch.htevents.client import Client

htevents.write_key = 'YOUR_WRITE_KEY'
other_htevents = Client('<OTHER_WRITE_KEY>')

htevents.identify('userId1', {
    'email': 'bat@example.com',
    'name': 'Person People',
})

other_htevents.identify('userId1', {
    'email': 'bat@example.com',
    'name': 'Person People',
})

htevents.track('userId1', 'Order Completed', {})
other_htevents.track('userId1', 'Order Completed', {})
```

**Note** Only instantiate `Client` class **once** per write key, per application.

```python
from flask import Flask
from hightouch.htevents.client import Client

app = Flask(__name__)

// For example, in flask, instantiate the client outside of the request handlers
htevents = Client('<WRITE_KEY>')

@app.route('/')
def hello_world():
   htevents.track('userId1', 'hello', {})
   return 'Hello World'
```
