# async-customerio is a lightweight asynchronous client to interact with CustomerIO
[](https://pypi.python.org/pypi/async-customerio/)
[](https://pypi.python.org/pypi/async-customerio/)
[](https://pypi.python.org/pypi/async-customerio/)
[](https://pypi.python.org/pypi/async-customerio/)
[](https://github.com/healthjoy/async-customerio/actions/workflows/ci.yml)
[](https://www.codacy.com/gh/healthjoy/async-customerio/dashboard?utm_source=github.com&utm_medium=referral&utm_content=healthjoy/async-customerio&utm_campaign=Badge_Coverage)
- Free software: MIT license
- Requires: Python 3.7+
## Features
- Fully async
- Interface preserved as Official Python Client `customerio` has
- Send push notification
- Send messages
## Installation
```shell script
pip install async-customerio
```
## Getting started
```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.
## Securely verify requests [doc](https://customer.io/docs/journeys/webhooks/#securely-verify-requests)
```python
from async_customerio import validate_signature
def main():
webhook_signing_key = (
"755781b5e03a973f3405a85474d5a032a60fd56fabaad66039b12eadd83955fa"
)
x_cio_timestamp = 1692633432 # header value
x_cio_signature = "d7c655389bb364d3e8bdbb6ec18a7f1b6cf91f39bba647554ada78aa61de37b9" # header value
body = b'{"key": "value"}'
if validate_signature(
signing_key=webhook_signing_key,
timestamp=x_cio_timestamp,
request_body=body,
signature=x_cio_signature,
):
print("Request is sent from CustomerIO")
else:
print("Malicious request received")
if __name__ == "__main__":
main()
```
## License
`async-customerio` is offered under the MIT license.
## Source code
The latest developer version is available in a GitHub repository:
[https://github.com/healthjoy/async-customerio](https://github.com/healthjoy/async-customerio)
Raw data
{
"_id": null,
"home_page": "https://github.com/healthjoy/async-customerio",
"name": "async-customerio",
"maintainer": "Healthjoy Developers",
"docs_url": null,
"requires_python": "<3.13,>=3.7.15",
"maintainer_email": "developers@healthjoy.com",
"keywords": "async, asyncio, customerio, messaing, python3, data-driven-emails, push notifications, in-app messages, SMS",
"author": "Aleksandr Omyshev",
"author_email": "oomyshev@healthjoy.com",
"download_url": "https://files.pythonhosted.org/packages/f9/d4/04504dbb7215730a3deed483d72054235ab82721dae83ff9a45212b304b2/async_customerio-1.5.0.tar.gz",
"platform": null,
"description": "# async-customerio is a lightweight asynchronous client to interact with CustomerIO\n\n[](https://pypi.python.org/pypi/async-customerio/)\n[](https://pypi.python.org/pypi/async-customerio/)\n[](https://pypi.python.org/pypi/async-customerio/)\n[](https://pypi.python.org/pypi/async-customerio/)\n[](https://github.com/healthjoy/async-customerio/actions/workflows/ci.yml)\n[](https://www.codacy.com/gh/healthjoy/async-customerio/dashboard?utm_source=github.com&utm_medium=referral&utm_content=healthjoy/async-customerio&utm_campaign=Badge_Coverage)\n\n- Free software: MIT license\n- Requires: Python 3.7+\n\n## Features\n\n- Fully async\n- Interface preserved as Official Python Client `customerio` has\n- Send push notification\n- Send messages\n\n## Installation\n\n```shell script\npip install async-customerio\n```\n\n## Getting started\n\n```python\nimport asyncio\n\nfrom async_customerio import AsyncCustomerIO, Regions\n\n\nasync def main():\n site_id = \"Some-id-gotten-from-CustomerIO\"\n api_key = \"Some-key-gotten-from-CustomerIO\"\n cio = AsyncCustomerIO(site_id, api_key, region=Regions.US)\n await cio.identify(\n id=5,\n email=\"customer@example.com\",\n first_name=\"John\",\n last_name=\"Doh\",\n subscription_plan=\"premium\",\n )\n await cio.track(\n customer_id=5, name=\"product.purchased\", product_sku=\"XYZ-12345\", price=23.45\n )\n\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n### Instantiating `AsyncCustomerIO` object\n\nCreate an instance of the client with your [Customer.io credentials](https://fly.customer.io/settings/api_credentials).\n\n```python\nfrom async_customerio import AsyncCustomerIO, Regions\n\n\ncio = AsyncCustomerIO(site_id, api_key, region=Regions.US)\n```\n\n`region` is optional and takes one of two values \u2014 `Regions.US` or `Regions.EU`. If you do not specify your region, we assume\nthat 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\n(`Regions.EU`), we'll route requests to our EU data centers accordingly, however, this may cause data to be logged in the US.\n\n## Securely verify requests [doc](https://customer.io/docs/journeys/webhooks/#securely-verify-requests)\n\n```python\nfrom async_customerio import validate_signature\n\n\ndef main():\n webhook_signing_key = (\n \"755781b5e03a973f3405a85474d5a032a60fd56fabaad66039b12eadd83955fa\"\n )\n x_cio_timestamp = 1692633432 # header value\n x_cio_signature = \"d7c655389bb364d3e8bdbb6ec18a7f1b6cf91f39bba647554ada78aa61de37b9\" # header value\n body = b'{\"key\": \"value\"}'\n if validate_signature(\n signing_key=webhook_signing_key,\n timestamp=x_cio_timestamp,\n request_body=body,\n signature=x_cio_signature,\n ):\n print(\"Request is sent from CustomerIO\")\n else:\n print(\"Malicious request received\")\n\n\nif __name__ == \"__main__\":\n main()\n```\n\n## License\n\n`async-customerio` is offered under the MIT license.\n\n## Source code\n\nThe latest developer version is available in a GitHub repository:\n[https://github.com/healthjoy/async-customerio](https://github.com/healthjoy/async-customerio)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Async CustomerIO Client - a Python client to interact with CustomerIO in an async fashion.",
"version": "1.5.0",
"project_urls": {
"Homepage": "https://github.com/healthjoy/async-customerio",
"Repository": "https://github.com/healthjoy/async-customerio"
},
"split_keywords": [
"async",
" asyncio",
" customerio",
" messaing",
" python3",
" data-driven-emails",
" push notifications",
" in-app messages",
" sms"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b8d623407f129c71299ecf21583aa49056605bedb323fefadf05b4a033c8b20f",
"md5": "d6a8200885fbfc45619374ed7ab482e9",
"sha256": "4ebc636748054893cb906598a61700c11d5d1d11f678f30e43e206bcff8c8941"
},
"downloads": -1,
"filename": "async_customerio-1.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d6a8200885fbfc45619374ed7ab482e9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.7.15",
"size": 14124,
"upload_time": "2025-07-10T20:42:00",
"upload_time_iso_8601": "2025-07-10T20:42:00.232294Z",
"url": "https://files.pythonhosted.org/packages/b8/d6/23407f129c71299ecf21583aa49056605bedb323fefadf05b4a033c8b20f/async_customerio-1.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f9d404504dbb7215730a3deed483d72054235ab82721dae83ff9a45212b304b2",
"md5": "c4883ace5a3128252e61e8962e243d02",
"sha256": "b0e20ec3d9cdf645089ed16fffaa3d38b2097bc570d9cfeccb591d0ec94bbf02"
},
"downloads": -1,
"filename": "async_customerio-1.5.0.tar.gz",
"has_sig": false,
"md5_digest": "c4883ace5a3128252e61e8962e243d02",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.7.15",
"size": 12575,
"upload_time": "2025-07-10T20:42:01",
"upload_time_iso_8601": "2025-07-10T20:42:01.269589Z",
"url": "https://files.pythonhosted.org/packages/f9/d4/04504dbb7215730a3deed483d72054235ab82721dae83ff9a45212b304b2/async_customerio-1.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-10 20:42:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "healthjoy",
"github_project": "async-customerio",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "async-customerio"
}