# Disruptive Technologies Python Integrations
![build](https://github.com/disruptive-technologies/python-integrations/actions/workflows/build.yml/badge.svg)
[![codecov](https://codecov.io/gh/disruptive-technologies/python-integrations/branch/main/graph/badge.svg?token=KX0W7H6ALS)](https://codecov.io/gh/disruptive-technologies/python-integrations)
## Documentation
- [Python API Reference](https://developer.disruptive-technologies.com/api/libraries/python/)
- [Developer Documentation](https://developer.disruptive-technologies.com/docs/)
## Installation
The package can be installed through pip:
```sh
pip install --upgrade dtintegrations
```
or from source:
```sh
pip install .
```
### Requirements
- Python 3.8, 3.9, 3.10, 3.11
## Usage
Currently, the main functionality of this package is validating requests forwarded by a [Data Connector](https://developer.disruptive-technologies.com/docs/data-connectors/introduction-to-data-connector).
The following example shows this for a [Google Cloud Function](https://cloud.google.com/functions).
```python
from dtintegrations import data_connector, provider
def endpoint(request):
# Validate and decode the incoming request.
payload = data_connector.HttpPush.from_provider(
request=request,
provider=provider.GCLOUD,
secret='<SIGNATURE_SECRET>',
)
# Print the payload data.
print(payload)
# If all is well, return 200 response.
return ('OK', 200)
```
## Examples
A few examples has been provided, but must be run either on a serverless platform or locally with a combination or [ngrok](https://developer.disruptive-technologies.com/docs/data-connectors/development-guides/local-development-with-ngrok) and the appropriate development framework.
## Exceptions
If a method is unsuccessful or has been provided with invalid parameters, an exception is raised. A list of available exceptions are available in the [API Reference](https://developer.disruptive-technologies.com/api/libraries/python/client/errors.html).
## Development
Set up the development virtualenv environment:
```
make
```
Run unit-tests against the currently active python version:
```
make test
```
Lint the package code using MyPy and flake8:
```
make lint
```
Build the package distribution:
```
make build
```
Raw data
{
"_id": null,
"home_page": "https://github.com/disruptive-technologies/disruptive-dataconnector",
"name": "dtintegrations",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "disruptive,technologies,dt,integration,api",
"author": "Disruptive Technologies Research AS",
"author_email": "developer-support@disruptive-technologies.com",
"download_url": "https://files.pythonhosted.org/packages/5b/d3/bdfaed12f650dcacaf826493ae2731c0e1308da0e3554293259dfa298596/dtintegrations-0.6.0.tar.gz",
"platform": null,
"description": "# Disruptive Technologies Python Integrations\n\n![build](https://github.com/disruptive-technologies/python-integrations/actions/workflows/build.yml/badge.svg)\n[![codecov](https://codecov.io/gh/disruptive-technologies/python-integrations/branch/main/graph/badge.svg?token=KX0W7H6ALS)](https://codecov.io/gh/disruptive-technologies/python-integrations)\n\n## Documentation\n\n- [Python API Reference](https://developer.disruptive-technologies.com/api/libraries/python/)\n- [Developer Documentation](https://developer.disruptive-technologies.com/docs/)\n\n## Installation\n\nThe package can be installed through pip:\n\n```sh\npip install --upgrade dtintegrations\n```\n\nor from source:\n\n```sh\npip install .\n```\n\n### Requirements\n\n- Python 3.8, 3.9, 3.10, 3.11\n\n## Usage\nCurrently, the main functionality of this package is validating requests forwarded by a [Data Connector](https://developer.disruptive-technologies.com/docs/data-connectors/introduction-to-data-connector). \n\nThe following example shows this for a [Google Cloud Function](https://cloud.google.com/functions).\n```python\nfrom dtintegrations import data_connector, provider\n\n\ndef endpoint(request):\n # Validate and decode the incoming request.\n payload = data_connector.HttpPush.from_provider(\n request=request,\n provider=provider.GCLOUD,\n secret='<SIGNATURE_SECRET>',\n )\n\n # Print the payload data.\n print(payload)\n\n # If all is well, return 200 response.\n return ('OK', 200)\n```\n\n## Examples\nA few examples has been provided, but must be run either on a serverless platform or locally with a combination or [ngrok](https://developer.disruptive-technologies.com/docs/data-connectors/development-guides/local-development-with-ngrok) and the appropriate development framework.\n\n## Exceptions\nIf a method is unsuccessful or has been provided with invalid parameters, an exception is raised. A list of available exceptions are available in the [API Reference](https://developer.disruptive-technologies.com/api/libraries/python/client/errors.html).\n\n## Development\nSet up the development virtualenv environment:\n```\nmake\n```\n\nRun unit-tests against the currently active python version:\n```\nmake test\n```\n\nLint the package code using MyPy and flake8:\n```\nmake lint\n```\n\nBuild the package distribution:\n```\nmake build\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "Disruptive Technologies Python Integrations.",
"version": "0.6.0",
"project_urls": {
"Homepage": "https://github.com/disruptive-technologies/disruptive-dataconnector"
},
"split_keywords": [
"disruptive",
"technologies",
"dt",
"integration",
"api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "94235764c026e907c4a2c6af7f8b268d3b8862dca67ff27cd849d3b396623627",
"md5": "351f9b00001134e127d512f2735c7e7f",
"sha256": "6a26cd1e84c4097a3d9b24d4450246ef2b610201a910bbf061b63f294ffca672"
},
"downloads": -1,
"filename": "dtintegrations-0.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "351f9b00001134e127d512f2735c7e7f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 8848,
"upload_time": "2023-08-04T13:33:03",
"upload_time_iso_8601": "2023-08-04T13:33:03.554256Z",
"url": "https://files.pythonhosted.org/packages/94/23/5764c026e907c4a2c6af7f8b268d3b8862dca67ff27cd849d3b396623627/dtintegrations-0.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5bd3bdfaed12f650dcacaf826493ae2731c0e1308da0e3554293259dfa298596",
"md5": "4bf906ac9517a3b33ec331c68a1a716e",
"sha256": "a0f10ca565acdd22ad5245f551926fc981840d17cb1e7780863b75b77f91f29c"
},
"downloads": -1,
"filename": "dtintegrations-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "4bf906ac9517a3b33ec331c68a1a716e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 8116,
"upload_time": "2023-08-04T13:33:05",
"upload_time_iso_8601": "2023-08-04T13:33:05.142243Z",
"url": "https://files.pythonhosted.org/packages/5b/d3/bdfaed12f650dcacaf826493ae2731c0e1308da0e3554293259dfa298596/dtintegrations-0.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-04 13:33:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "disruptive-technologies",
"github_project": "disruptive-dataconnector",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "dtintegrations"
}