car-connector-framework


Namecar-connector-framework JSON
Version 4.0.1 PyPI version JSON
download
home_pagehttps://github.com/IBM/cp4s-car-connector-framework
SummaryCAR service connector framework
upload_time2023-10-19 11:50:04
maintainer
docs_urlNone
authorIBM
requires_python>=3.6
licenseApache License 2.0
keywords
VCS
bugtrack_url
requirements requests python-json-logger jschon jwcrypto urllib3
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Car Connector Framework

## Develop a connector

Use connectors/reference_connector from [cp4s-car-connectors](https://github.com/IBM/cp4s-car-connectors) project as an example of how this framework is to be used.

A CAR connector project will need to extend the framework classes: [BaseFullImport](https://github.com/IBM/cp4s-car-connector-framework/blob/develop/car_framework/full_import.py), [BaseIncrementalImport](https://github.com/IBM/cp4s-car-connector-framework/blob/develop/car_framework/inc_import.py), [BaseApp](https://github.com/IBM/cp4s-car-connector-framework/blob/develop/car_framework/app.py), [BaseAssetServer](https://github.com/IBM/cp4s-car-connector-framework/blob/develop/car_framework/server_access.py) and [BaseDataHandler](https://github.com/IBM/cp4s-car-connector-framework/blob/develop/car_framework/data_handler.py), and implement abstract methods of those classes.

Things to note:

* All communications with CAR digestion microservice are managed by the framework. Connector code normally does not need to access CAR digestion microservice directly

* The framework is trying to make some intelligent choice for whether to run full vs incremental import. Normally, for performance reasons we would always prefer to run incremental import if one is possible. Some examples of when it is not possible are:
  * The model states for generating delta are not available
  * The model on the CAR side is empty
  * The previous incremental import session failed and a new incremental import session can potentially create a gap in the model data

* Because of the above the the connector code should properly use (throw/raise) one of three following exceptions when detecting failures:
  * [RecoverableFailure](https://github.com/IBM/cp4s-car-connector-framework/blob/99554ac2cfa0732af090c46be9e356beb015934e/car_framework/util.py#L77) is to be used when the failure cannot potentially create a data gap and we can attempt an incremental import session when running next time. One example of a recoverable failure is a connectivity problem.
  * [UnrecoverableFailure](https://github.com/IBM/cp4s-car-connector-framework/blob/99554ac2cfa0732af090c46be9e356beb015934e/car_framework/util.py#L81) is to be used when the failure can potentially create a data gap and we must run full import session to recover.
  * [DatasourceFailure](https://github.com/IBM/cp4s-car-connector-framework/blob/99554ac2cfa0732af090c46be9e356beb015934e/car_framework/util.py#L92) is to be used when there is datasource API issues.

RecoverableFailure and UnrecoverableFailure are mostly handled in the framework. DatasourceFailure is to be used in the connector code with [a corresponding error code](https://github.com/IBM/cp4s-car-connector-framework/blob/99554ac2cfa0732af090c46be9e356beb015934e/car_framework/util.py#L35). Example: `return ErrorCode.TRANSMISSION_AUTH_CREDENTIALS.value`. 
If none of the Failure classes is used, the framework will raise a [GENERAL_APPLICATION_FAILURE](https://github.com/IBM/cp4s-car-connector-framework/blob/99554ac2cfa0732af090c46be9e356beb015934e/car_framework/app.py#L106) (Unknown error) and print the error stack. 

For more information use guides
* https://github.com/IBM/cp4s-car-connectors/blob/develop/README.md
* https://github.com/IBM/cp4s-car-connectors/blob/develop/guide-build-connectors.md
* https://github.com/IBM/cp4s-car-connectors/tree/develop/connectors/reference_connector
* https://github.com/IBM/cp4s-car-connectors/blob/develop/best-practices.md


## Test deploy
https://github.com/IBM/cp4s-car-connectors/blob/develop/deployment/README.md


## Publish

Use the guide from [PUBLISH.md](./PUBLISH.md)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/IBM/cp4s-car-connector-framework",
    "name": "car-connector-framework",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "IBM",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/ad/97/ec93207b244351c87c40d6b22cb90fbb4902d9ad4471012541414117341d/car-connector-framework-4.0.1.tar.gz",
    "platform": "Any",
    "description": "# Car Connector Framework\n\n## Develop a connector\n\nUse connectors/reference_connector from [cp4s-car-connectors](https://github.com/IBM/cp4s-car-connectors) project as an example of how this framework is to be used.\n\nA CAR connector project will need to extend the framework classes: [BaseFullImport](https://github.com/IBM/cp4s-car-connector-framework/blob/develop/car_framework/full_import.py), [BaseIncrementalImport](https://github.com/IBM/cp4s-car-connector-framework/blob/develop/car_framework/inc_import.py), [BaseApp](https://github.com/IBM/cp4s-car-connector-framework/blob/develop/car_framework/app.py), [BaseAssetServer](https://github.com/IBM/cp4s-car-connector-framework/blob/develop/car_framework/server_access.py) and [BaseDataHandler](https://github.com/IBM/cp4s-car-connector-framework/blob/develop/car_framework/data_handler.py), and implement abstract methods of those classes.\n\nThings to note:\n\n* All communications with CAR digestion microservice are managed by the framework. Connector code normally does not need to access CAR digestion microservice directly\n\n* The framework is trying to make some intelligent choice for whether to run full vs incremental import. Normally, for performance reasons we would always prefer to run incremental import if one is possible. Some examples of when it is not possible are:\n  * The model states for generating delta are not available\n  * The model on the CAR side is empty\n  * The previous incremental import session failed and a new incremental import session can potentially create a gap in the model data\n\n* Because of the above the the connector code should properly use (throw/raise) one of three following exceptions when detecting failures:\n  * [RecoverableFailure](https://github.com/IBM/cp4s-car-connector-framework/blob/99554ac2cfa0732af090c46be9e356beb015934e/car_framework/util.py#L77) is to be used when the failure cannot potentially create a data gap and we can attempt an incremental import session when running next time. One example of a recoverable failure is a connectivity problem.\n  * [UnrecoverableFailure](https://github.com/IBM/cp4s-car-connector-framework/blob/99554ac2cfa0732af090c46be9e356beb015934e/car_framework/util.py#L81) is to be used when the failure can potentially create a data gap and we must run full import session to recover.\n  * [DatasourceFailure](https://github.com/IBM/cp4s-car-connector-framework/blob/99554ac2cfa0732af090c46be9e356beb015934e/car_framework/util.py#L92) is to be used when there is datasource API issues.\n\nRecoverableFailure and UnrecoverableFailure are mostly handled in the framework. DatasourceFailure is to be used in the connector code with [a corresponding error code](https://github.com/IBM/cp4s-car-connector-framework/blob/99554ac2cfa0732af090c46be9e356beb015934e/car_framework/util.py#L35). Example: `return ErrorCode.TRANSMISSION_AUTH_CREDENTIALS.value`. \nIf none of the Failure classes is used, the framework will raise a [GENERAL_APPLICATION_FAILURE](https://github.com/IBM/cp4s-car-connector-framework/blob/99554ac2cfa0732af090c46be9e356beb015934e/car_framework/app.py#L106) (Unknown error) and print the error stack. \n\nFor more information use guides\n* https://github.com/IBM/cp4s-car-connectors/blob/develop/README.md\n* https://github.com/IBM/cp4s-car-connectors/blob/develop/guide-build-connectors.md\n* https://github.com/IBM/cp4s-car-connectors/tree/develop/connectors/reference_connector\n* https://github.com/IBM/cp4s-car-connectors/blob/develop/best-practices.md\n\n\n## Test deploy\nhttps://github.com/IBM/cp4s-car-connectors/blob/develop/deployment/README.md\n\n\n## Publish\n\nUse the guide from [PUBLISH.md](./PUBLISH.md)\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "CAR service connector framework",
    "version": "4.0.1",
    "project_urls": {
        "Homepage": "https://github.com/IBM/cp4s-car-connector-framework"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "97d87fbc3a471922139b8df761503bc5d8a7af412b953d3002309c0be4545ac3",
                "md5": "25d80820923d7855d8c1237823bf7f24",
                "sha256": "64234df68fe13d374cd72f11a7d7f82c24ba6eb0d14051a882fb09c342dbfefb"
            },
            "downloads": -1,
            "filename": "car_connector_framework-4.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "25d80820923d7855d8c1237823bf7f24",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 22340,
            "upload_time": "2023-10-19T11:50:02",
            "upload_time_iso_8601": "2023-10-19T11:50:02.419726Z",
            "url": "https://files.pythonhosted.org/packages/97/d8/7fbc3a471922139b8df761503bc5d8a7af412b953d3002309c0be4545ac3/car_connector_framework-4.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad97ec93207b244351c87c40d6b22cb90fbb4902d9ad4471012541414117341d",
                "md5": "493fc6eeae6e7fd7b9398906cad24acb",
                "sha256": "e47ed0dbaad561ec810d422acbd4f6e1d725b566b4ae670c4d4b574f66fa15b3"
            },
            "downloads": -1,
            "filename": "car-connector-framework-4.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "493fc6eeae6e7fd7b9398906cad24acb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 18085,
            "upload_time": "2023-10-19T11:50:04",
            "upload_time_iso_8601": "2023-10-19T11:50:04.343104Z",
            "url": "https://files.pythonhosted.org/packages/ad/97/ec93207b244351c87c40d6b22cb90fbb4902d9ad4471012541414117341d/car-connector-framework-4.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-19 11:50:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "IBM",
    "github_project": "cp4s-car-connector-framework",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.24.0"
                ]
            ]
        },
        {
            "name": "python-json-logger",
            "specs": [
                [
                    "==",
                    "2.0.7"
                ]
            ]
        },
        {
            "name": "jschon",
            "specs": [
                [
                    "==",
                    "0.8.5"
                ]
            ]
        },
        {
            "name": "jwcrypto",
            "specs": [
                [
                    ">=",
                    "1.4.2"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "1.26.18"
                ]
            ]
        }
    ],
    "lcname": "car-connector-framework"
}
        
IBM
Elapsed time: 0.13601s