# RudderStack Python SDK
RudderStackâs Python SDK lets you track events from your Python application. Once enabled, the event requests hit the RudderStack servers. RudderStack then transforms and routes these events to your specified destination platforms.
More details on the Python SDK can be found in our [**documentation**](https://docs.rudderstack.com/stream-sources/rudderstack-sdk-integration-guides/rudderstack-python-sdk)
## Getting Started with Python SDK
Install `rudder-sdk-python` using `pip`:
```bash
pip install rudder-sdk-python
```
## Initializing the RudderStack Client
```python
import rudderstack.analytics as analytics
analytics.write_key = <SOURCE_WRITE_KEY>
analytics.on_error = <FAILURE CALLBACK>
analytics.debug = <True or False>
analytics.dataPlaneUrl = <RUDDERSTACK_DATA_PLANE_URL>
analytics.gzip = <True or False>
```
## Sending Events
Once the RudderStack client is initialized, you can use it to send your customer events. A sample `track` call is shown below:
```python
rudder_analytics.track('developer_user_id', 'Simple Track Event', {
'key1': 'val1'
})
analytics.track('user_id', 'Simple Track Event', anonymous_id='anonymousId',
properties={
'key1': 'val1'
}, context={
'key1': 'val1'
})
```
For more information on the supported calls, refer to the [**documentation**](https://docs.rudderstack.com/stream-sources/rudderstack-sdk-integration-guides/rudderstack-python-sdk#sending-events-from-rudderstack).
## About RudderStack
[**RudderStack**](https://rudderstack.com/) is a customer data platform for developers. Our tooling makes it easy to deploy pipelines that collect customer data from every app, website and SaaS platform, then activate it in your warehouse and business tools.
More information on RudderStack can be found [**here**](https://github.com/rudderlabs/rudder-server).
## Contact Us
For more information on any of the sections covered in this readme, you can [**contact us**](mailto:%20docs@rudderstack.com) or start a conversation on our [**Slack**](https://resources.rudderstack.com/join-rudderstack-slack) channel.
Raw data
{
"_id": null,
"home_page": "https://github.com/rudderlabs/rudder-sdk-python",
"name": "rudder-sdk-python",
"maintainer": "RudderStack",
"docs_url": null,
"requires_python": ">=3.8.0",
"maintainer_email": "sdk@rudderstack.com",
"keywords": "rudder, rudderstack, analytics",
"author": "RudderStack",
"author_email": "sdk@rudderstack.com",
"download_url": "https://files.pythonhosted.org/packages/ec/30/21675cadc1731dbb03d4e98b74852a63e0b4c063092cf2342c49b8b02b30/rudder_sdk_python-2.1.4.tar.gz",
"platform": null,
"description": "# RudderStack Python SDK\n\nRudderStack\u2019s Python SDK lets you track events from your Python application. Once enabled, the event requests hit the RudderStack servers. RudderStack then transforms and routes these events to your specified destination platforms.\n\nMore details on the Python SDK can be found in our [**documentation**](https://docs.rudderstack.com/stream-sources/rudderstack-sdk-integration-guides/rudderstack-python-sdk)\n\n## Getting Started with Python SDK\n\nInstall `rudder-sdk-python` using `pip`:\n\n```bash\npip install rudder-sdk-python\n```\n\n## Initializing the RudderStack Client\n\n```python\nimport rudderstack.analytics as analytics\n\nanalytics.write_key = <SOURCE_WRITE_KEY>\nanalytics.on_error = <FAILURE CALLBACK>\nanalytics.debug = <True or False>\nanalytics.dataPlaneUrl = <RUDDERSTACK_DATA_PLANE_URL>\n\nanalytics.gzip = <True or False>\n```\n\n## Sending Events\n\nOnce the RudderStack client is initialized, you can use it to send your customer events. A sample `track` call is shown below:\n\n```python\nrudder_analytics.track('developer_user_id', 'Simple Track Event', {\n 'key1': 'val1'\n})\nanalytics.track('user_id', 'Simple Track Event', anonymous_id='anonymousId',\n properties={\n 'key1': 'val1'\n}, context={\n 'key1': 'val1'\n})\n```\n\nFor more information on the supported calls, refer to the [**documentation**](https://docs.rudderstack.com/stream-sources/rudderstack-sdk-integration-guides/rudderstack-python-sdk#sending-events-from-rudderstack).\n\n## About RudderStack\n\n[**RudderStack**](https://rudderstack.com/) is a customer data platform for developers. Our tooling makes it easy to deploy pipelines that collect customer data from every app, website and SaaS platform, then activate it in your warehouse and business tools.\n\nMore information on RudderStack can be found [**here**](https://github.com/rudderlabs/rudder-server).\n\n## Contact Us\n\nFor more information on any of the sections covered in this readme, you can [**contact us**](mailto:%20docs@rudderstack.com) or start a conversation on our [**Slack**](https://resources.rudderstack.com/join-rudderstack-slack) channel.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "RudderStack is an open-source Segment alternative written in Go, built for the enterprise.",
"version": "2.1.4",
"project_urls": {
"Homepage": "https://github.com/rudderlabs/rudder-sdk-python"
},
"split_keywords": [
"rudder",
" rudderstack",
" analytics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bf4ba6e3ae5b57dc2fef23b86a742955eff94a3bbe1682e5ee783e3b631eacb6",
"md5": "bc5cdca98f211ef5bd4c4cf16e2b0e38",
"sha256": "a9891944ec4947ae0aea5962560cadf726f55831855993ebfb9c7acbdabb8ebb"
},
"downloads": -1,
"filename": "rudder_sdk_python-2.1.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "bc5cdca98f211ef5bd4c4cf16e2b0e38",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.8.0",
"size": 19577,
"upload_time": "2024-09-25T16:36:51",
"upload_time_iso_8601": "2024-09-25T16:36:51.800852Z",
"url": "https://files.pythonhosted.org/packages/bf/4b/a6e3ae5b57dc2fef23b86a742955eff94a3bbe1682e5ee783e3b631eacb6/rudder_sdk_python-2.1.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ec3021675cadc1731dbb03d4e98b74852a63e0b4c063092cf2342c49b8b02b30",
"md5": "f78ca43d2a675f57a68b42a154df8de0",
"sha256": "c6040044d79df05973cdec3f4455c7619b2b54b03158c68adca990e6502e1815"
},
"downloads": -1,
"filename": "rudder_sdk_python-2.1.4.tar.gz",
"has_sig": false,
"md5_digest": "f78ca43d2a675f57a68b42a154df8de0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.0",
"size": 15683,
"upload_time": "2024-09-25T16:36:53",
"upload_time_iso_8601": "2024-09-25T16:36:53.243353Z",
"url": "https://files.pythonhosted.org/packages/ec/30/21675cadc1731dbb03d4e98b74852a63e0b4c063092cf2342c49b8b02b30/rudder_sdk_python-2.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-25 16:36:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rudderlabs",
"github_project": "rudder-sdk-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "backoff",
"specs": [
[
"==",
"2.2.1"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2024.8.30"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.3.2"
]
]
},
{
"name": "deprecation",
"specs": [
[
"==",
"2.1.0"
]
]
},
{
"name": "flake8",
"specs": [
[
"==",
"7.1.1"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.10"
]
]
},
{
"name": "iniconfig",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "mccabe",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "mock",
"specs": [
[
"==",
"5.1.0"
]
]
},
{
"name": "monotonic",
"specs": [
[
"==",
"1.6"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"24.1"
]
]
},
{
"name": "pluggy",
"specs": [
[
"==",
"1.5.0"
]
]
},
{
"name": "pycodestyle",
"specs": [
[
"==",
"2.12.1"
]
]
},
{
"name": "pyflakes",
"specs": [
[
"==",
"3.2.0"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"8.3.3"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.2.3"
]
]
}
],
"lcname": "rudder-sdk-python"
}