This package simplifies the calls to Data Hub's API.
No magic. You need to follow the [Data Hub Swagger Documentation](https://api.opinum.com) for correct formatting of your requests
Be aware that this is a new package, certainly missing a lot of features. Feel free to contribute.
You first need to create an instance of the ApiConnector class with following parameters:
*ATTENTION:* this package can only be used from Data Hub version 7.0 (1 July 2025) onward, as it uses the authentication to the the new technology (Keycloak).
For previous versions, the opinum-api-connector package can be used (https://github.com/opinum/opinum-api-connector) instead.
> _environment_
> > a dictionary of environment variables
> >
> > if `None`, ApiConnector uses your environment variables (_os.environ_)
> >
> > Mandatory environment variables are:
> >
> > * _DATAHUB_USERNAME_: the Datahub user. <br>
> > TAKE CARE: if this user has access to multiple tenants and if you do not specify a tenant id,
> > ApiConnector will use the last tenant used.
> > * _DATAHUB_PASSWORD_: the password for the user
> > * _DATAHUB_CLIENT_ID_: the client id for accessing the API
> > * _DATAHUB_CLIENT_SECRET_ the corresponding secret
> >
> > Optional environment variables are:
> >
> > * _DATAHUB_API_URL_: another API URL than the Europe SaaS one (https://api.opinum.com)
> > * _DATAHUB_AUTH_URL_: another authentication URL than the Europe SaaS one (https://auth.opinum.com)
> > * _DATAHUB_PUSH_URL_: another push URL than the Europe SaaS one (https://push.opinum.com)
> > * _DATAHUB_SCOPE_: the scope of you session (default: "_datahub-api_")<br>
> > if you want to push data, the scope should be "_datahub-api push-data_"
> _account_id_
> > one of the tenant ids available for the Datahub user (default: `None`)
> _retries_when_connection_failure_
> > number of extra attempts when no 200 or 204 return code (default: 0, maximum: 5)
Once you have your ApiConnector instance, you may use the class methods
* get
* post
* patch
* put
* delete
* send_file_to_storage
All keyword arguments will be converted to path parameters in the API call with one important exception,
the _data_ keyword referring to the body of your call.
There are two other class methods for data pushing because we have another API for this
* push_data
* push_dataframe_data
There is a little bit of magic with the method multi_thread_request_on_path that splits a list of parameters
Allowing to make parallel calls.
Raw data
{
"_id": null,
"home_page": null,
"name": "datahub-api-connector",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Verity <support@opinum.com>",
"keywords": "datahub, Verity, Opinum, API, Keycloak",
"author": null,
"author_email": "Verity <support@opinum.com>",
"download_url": "https://files.pythonhosted.org/packages/1c/b6/c9fe2572268913aa74b8195199c9c0818e21de30551793bb0754633b45c5/datahub_api_connector-1.0.tar.gz",
"platform": null,
"description": "This package simplifies the calls to Data Hub's API.\r\n\r\nNo magic. You need to follow the [Data Hub Swagger Documentation](https://api.opinum.com) for correct formatting of your requests\r\n\r\nBe aware that this is a new package, certainly missing a lot of features. Feel free to contribute.\r\n\r\nYou first need to create an instance of the ApiConnector class with following parameters:\r\n\r\n*ATTENTION:* this package can only be used from Data Hub version 7.0 (1 July 2025) onward, as it uses the authentication to the the new technology (Keycloak).\r\nFor previous versions, the opinum-api-connector package can be used (https://github.com/opinum/opinum-api-connector) instead.\r\n\r\n> _environment_\r\n> > a dictionary of environment variables\r\n> >\r\n> > if `None`, ApiConnector uses your environment variables (_os.environ_)\r\n> >\r\n> > Mandatory environment variables are:\r\n> >\r\n> > * _DATAHUB_USERNAME_: the Datahub user. <br>\r\n> > TAKE CARE: if this user has access to multiple tenants and if you do not specify a tenant id,\r\n> > ApiConnector will use the last tenant used.\r\n> > * _DATAHUB_PASSWORD_: the password for the user\r\n> > * _DATAHUB_CLIENT_ID_: the client id for accessing the API\r\n> > * _DATAHUB_CLIENT_SECRET_ the corresponding secret\r\n> > \r\n> > Optional environment variables are:\r\n> >\r\n> > * _DATAHUB_API_URL_: another API URL than the Europe SaaS one (https://api.opinum.com)\r\n> > * _DATAHUB_AUTH_URL_: another authentication URL than the Europe SaaS one (https://auth.opinum.com)\r\n> > * _DATAHUB_PUSH_URL_: another push URL than the Europe SaaS one (https://push.opinum.com)\r\n> > * _DATAHUB_SCOPE_: the scope of you session (default: \"_datahub-api_\")<br>\r\n> > if you want to push data, the scope should be \"_datahub-api push-data_\"\r\n\r\n> _account_id_\r\n> > one of the tenant ids available for the Datahub user (default: `None`)\r\n\r\n> _retries_when_connection_failure_\r\n> > number of extra attempts when no 200 or 204 return code (default: 0, maximum: 5)\r\n\r\nOnce you have your ApiConnector instance, you may use the class methods\r\n\r\n* get\r\n* post\r\n* patch\r\n* put\r\n* delete\r\n* send_file_to_storage\r\n\r\nAll keyword arguments will be converted to path parameters in the API call with one important exception,\r\nthe _data_ keyword referring to the body of your call.\r\n\r\nThere are two other class methods for data pushing because we have another API for this\r\n\r\n* push_data\r\n* push_dataframe_data\r\n\r\nThere is a little bit of magic with the method multi_thread_request_on_path that splits a list of parameters\r\nAllowing to make parallel calls.\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Package to help connect to Verity's Data Hub API",
"version": "1.0",
"project_urls": {
"Bug Tracker": "https://github.com/opinum/datahub-api-connector/issues",
"Homepage": "https://github.com/opinum/datahub-api-connector"
},
"split_keywords": [
"datahub",
" verity",
" opinum",
" api",
" keycloak"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ccdb11ca4cd6ea70678c584270cdbf58a309b0410f70f5f25977954e68612a5c",
"md5": "594351ec36c56d43b2b4addea0d68c29",
"sha256": "6b0af2f901d2e35fd7c84e9e75f920b9119ae2dfbdbe0180530e2a33ca8a5399"
},
"downloads": -1,
"filename": "datahub_api_connector-1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "594351ec36c56d43b2b4addea0d68c29",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 9682,
"upload_time": "2025-07-25T12:33:45",
"upload_time_iso_8601": "2025-07-25T12:33:45.072380Z",
"url": "https://files.pythonhosted.org/packages/cc/db/11ca4cd6ea70678c584270cdbf58a309b0410f70f5f25977954e68612a5c/datahub_api_connector-1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1cb6c9fe2572268913aa74b8195199c9c0818e21de30551793bb0754633b45c5",
"md5": "2c7619ad0bfaa3acb83ea50ce7128a18",
"sha256": "77a112f0bc19460d444457ffadfdef49546837846b392bece1f57074688f833b"
},
"downloads": -1,
"filename": "datahub_api_connector-1.0.tar.gz",
"has_sig": false,
"md5_digest": "2c7619ad0bfaa3acb83ea50ce7128a18",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 10156,
"upload_time": "2025-07-25T12:33:46",
"upload_time_iso_8601": "2025-07-25T12:33:46.374502Z",
"url": "https://files.pythonhosted.org/packages/1c/b6/c9fe2572268913aa74b8195199c9c0818e21de30551793bb0754633b45c5/datahub_api_connector-1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-25 12:33:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "opinum",
"github_project": "datahub-api-connector",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "datahub-api-connector"
}