From 04428bf62d8dbc930ade5f31d0b8a49269c1b5f2 Mon Sep 17 00:00:00 2001 From: Aleksandr Omyshev Date: Fri, 9 Dec 2022 12:32:44 +0200 Subject: [PATCH] Update README.md --- CHANGES.md | 4 ++++ README.md | 39 +++++++++++++++++++++++++++++++++++++-- pyproject.toml | 2 +- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9dfc25d..1f63be6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changelog +## 0.2.0 + + * `README.md` has been updated with examples of how to use. + ## 0.1.0 * First release on PyPI. diff --git a/README.md b/README.md index d9267e8..659a36e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,10 @@ ## Features - * + * Fully async + * Interface preserved as Official Python Client `customerio` has + * Send push notification + * Send messages ## Installation ```shell script @@ -21,7 +24,39 @@ $ pip install async-customerio ``` ## Getting started -TBD... +```python +import asyncio + +from async_customerio import AsyncCustomerIO, Regions + + +async def main(): + site_id = "Some-id-gotten-from-CustomerIO" + api_key = "Some-key-gotten-from-CustomerIO" + cio = AsyncCustomerIO(site_id, api_key, region=Regions.US) + await cio.identify(id=5, email="customer@example.com", first_name="John", last_name="Doh", subscription_plan="premium") + await cio.track(customer_id=5, name="product.purchased", product_sku="XYZ-12345", price=23.45) + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +#### Instantiating `AsyncCustomerIO` object + +Create an instance of the client with your [Customer.io credentials](https://fly.customer.io/settings/api_credentials). + +```python + +from async_customerio import AsyncCustomerIO, Regions + + +cio = AsyncCustomerIO(site_id, api_key, region=Regions.US) +``` + +`region` is optional and takes one of two values — `Regions.US` or `Regions.EU`. If you do not specify your region, we assume +that your account is based in the US (`Regions.US`). If your account is based in the EU and you do not provide the correct region +(`Regions.EU`), we'll route requests to our EU data centers accordingly, however this may cause data to be logged in the US. ## License diff --git a/pyproject.toml b/pyproject.toml index 4267f7e..58a1484 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "async-customerio" -version = "0.1.0" +version = "0.2.0" description = "Async CustomerIO Client - a Python client to interact with CustomerIO in an async fashion." license = "MIT" authors = [