Name | pysdccc JSON |
Version |
1.0.0
JSON |
| download |
home_page | None |
Summary | Python wrapper for SDCcc test tool |
upload_time | 2025-08-18 08:08:29 |
maintainer | None |
docs_url | None |
author | None |
requires_python | <3.14,>=3.11 |
license | MIT License
Copyright (c) 2024 Dräger
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
keywords |
sdccc
sdc
test
wrapper
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pysdccc
This python packages provides a convenient way to execute the [SDCcc test suite](https://github.com/Draegerwerk/sdccc/).
This wrapper is only compatible with SDCcc versions later than [internal-baseline-001](https://github.com/Draegerwerk/SDCcc/releases/tag/internal-baseline-001).
## Installation
Download from pypi using `pip install pysdccc`. There is also an option to use this via the command line by installing `pysdccc[cli]`.
### Development
For this open source project the [Contributor License Agreement](Contributor_License_Agreement.md) governs all relevant activities and your contributions. By contributing to the project you agree to be bound by this Agreement and to licence your work accordingly.
1. clone the repository
2. install dependencies, e.g. with [`uv sync --dev`](https://docs.astral.sh/uv/reference/cli/#uv-sync)
## Usage
### Quick start
```python
import pysdccc
async def main():
if not await pysdccc.is_downloaded("my-specific-version"):
await pysdccc.download("https://url/to/sdccc.zip")
runner = pysdccc.SdcccRunner("/path/to/sdccc/result/directory")
# https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#exit-codes
return_code, direct_result, invariant_result = await runner.run(
config="/path/to/configuration/file.toml",
requirements="/path/to/requirements/file.toml",
)
if direct_result is None or invariant_result is None:
print("No result file available")
return
for test_case in direct_result + invariant_result:
print(f"{test_case.test_identifier}: {test_case.is_passed}")
```
If you look for a synchronous version. Please note this is deprecated. The async methods are the preferred way.
```python
import pathlib
import pysdccc
async def main():
if not pysdccc.is_downloaded_sync("my-specific-version"):
pysdccc.download_sync("https://url/to/sdccc.zip")
runner = pysdccc.SdcccRunnerSync("/path/to/sdccc/result/directory")
# https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#exit-codes
return_code, direct_result, invariant_result = runner.run(
config="/path/to/configuration/file.toml",
requirements="/path/to/requirements/file.toml",
).result(timeout=60) # use .result(timeout=...) to wait for the result in a synchronous way
# checkout example from above ...
```
### Create configuration file
Configure the test consumer. Check the [test consumer configuration](https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#test-consumer-configuration) for more information.
```python
import anyio
import toml # has to be installed by the user
import pysdccc
async def main():
config = {
'SDCcc': {
... # add all relevant config parameter
}
}
config_path = anyio.Path('/path/to/configuration/file.toml')
await config_path.write_text(toml.dumps(config))
runner = pysdccc.SdcccRunner('/path/to/sdccc/result/directory')
await runner.run(config=config_path, requirements='/path/to/requirements/file.toml')
# or if you have already downloaded SDCcc
config = await runner.get_config() # load default configuration
config['SDCcc']['Consumer']['DeviceEpr'] = "urn:uuid:12345678-1234-1234-1234-123456789012" # e.g. change device epr
# save and run as above
```
### Create requirements file
Enable or disable specific requirements. Check the [test requirements](https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#enabling-tests) for more information.
```python
import anyio
import toml # has to be installed by the user
import pysdccc
async def main():
requirements = {
# the standard name is the key, the requirement from the standard is the value
'BICEPS': {
... # add all requirements to be tested
}
}
requirements_path = anyio.Path('/path/to/requirement/file.toml')
await requirements_path.write_text(toml.dumps(requirements))
runner = pysdccc.SdcccRunner('/path/to/sdccc/result/directory')
# optionally, check whether you did not add a requirement that is not available
await runner.check_requirements(requirements_path)
await runner.run('/path/to/configuration/file.toml', requirements=requirements_path)
# or, if you have already downloaded SDCcc
requirements = await runner.get_requirements() # load default configuration
requirements['BICEPS']['R0033'] = False # e.g. disable biceps R0033
# save and run as above
```
### Create test parameter configuration
Some tests require individual parameters. Check the [test parameter configuration](https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#test-parameter-configuration) for more information.
```python
import anyio
import toml # has to be installed by the user
import pysdccc
async def main():
testparameter_config = {
'TestParameter': {
...
}
}
testparameter_config_path = anyio.Path('/path/to/test_parameter/file.toml')
await testparameter_config_path.write_text(toml.dumps(testparameter_config))
runner = pysdccc.SdcccRunner('/path/to/sdccc/result/directory')
await runner.run(
config='/path/to/configuration/file.toml',
requirements='/path/to/requirements/file.toml',
testparam=testparameter_config_path,
)
# or, if you have already downloaded SDCcc
testparameter_config = await runner.get_test_parameter() # load default configuration
testparameter_config['TestParameter']['Biceps547TimeInterval'] = 10
# save and run as above
```
### Logging
The SDCcc runner provides a logger called `pysdccc.run` that can be used to log messages during the execution of the tests. Stdout is mapped to logging level `info` and stderr to `error`.
Be aware that no further processing of the SDCcc process output is done. Depending on the format you use you may get duplicated timestamps, etc. Also, it might happen that a java error can stretch over multiple lines, which may result in multiple log messages in python for the same java error.
### Execute SDCcc from command-line interface (cli)
There exists a cli wrapper for the SDCcc executable. If `pysdccc[cli]` is installed, `sdccc` can be used to execute arbitrary SDCcc commands, e.g. `sdccc --version`. More information can be found [here](https://github.com/draegerwerk/sdccc?tab=readme-ov-file#running-sdccc).
## Notices
`pysdccc` is not intended for use in medical products, clinical trials, clinical studies, or in clinical routine.
### ISO 9001
`pysdccc` was not developed according to ISO 9001.
## License
[MIT](https://choosealicense.com/licenses/mit/)
Raw data
{
"_id": null,
"home_page": null,
"name": "pysdccc",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.14,>=3.11",
"maintainer_email": null,
"keywords": "SDCcc, sdc, test, wrapper",
"author": null,
"author_email": "Leon Budnick <leon.budnick@draeger.com>",
"download_url": "https://files.pythonhosted.org/packages/32/61/84ff2813727fb0d009b99aaa60eac608fff9bf830bc38fd4cd4503e6d43e/pysdccc-1.0.0.tar.gz",
"platform": null,
"description": "# pysdccc\n\nThis python packages provides a convenient way to execute the [SDCcc test suite](https://github.com/Draegerwerk/sdccc/).\n\nThis wrapper is only compatible with SDCcc versions later than [internal-baseline-001](https://github.com/Draegerwerk/SDCcc/releases/tag/internal-baseline-001).\n\n## Installation\n\nDownload from pypi using `pip install pysdccc`. There is also an option to use this via the command line by installing `pysdccc[cli]`.\n\n### Development\n\nFor this open source project the [Contributor License Agreement](Contributor_License_Agreement.md) governs all relevant activities and your contributions. By contributing to the project you agree to be bound by this Agreement and to licence your work accordingly.\n\n1. clone the repository\n2. install dependencies, e.g. with [`uv sync --dev`](https://docs.astral.sh/uv/reference/cli/#uv-sync)\n\n## Usage\n\n### Quick start\n\n```python\nimport pysdccc\n\n\nasync def main():\n if not await pysdccc.is_downloaded(\"my-specific-version\"):\n await pysdccc.download(\"https://url/to/sdccc.zip\")\n\n runner = pysdccc.SdcccRunner(\"/path/to/sdccc/result/directory\")\n\n # https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#exit-codes\n return_code, direct_result, invariant_result = await runner.run(\n config=\"/path/to/configuration/file.toml\",\n requirements=\"/path/to/requirements/file.toml\",\n )\n if direct_result is None or invariant_result is None:\n print(\"No result file available\")\n return\n\n for test_case in direct_result + invariant_result:\n print(f\"{test_case.test_identifier}: {test_case.is_passed}\")\n```\nIf you look for a synchronous version. Please note this is deprecated. The async methods are the preferred way.\n\n```python\nimport pathlib\n\nimport pysdccc\n\n\nasync def main():\n if not pysdccc.is_downloaded_sync(\"my-specific-version\"):\n pysdccc.download_sync(\"https://url/to/sdccc.zip\")\n\n runner = pysdccc.SdcccRunnerSync(\"/path/to/sdccc/result/directory\")\n\n # https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#exit-codes\n return_code, direct_result, invariant_result = runner.run(\n config=\"/path/to/configuration/file.toml\",\n requirements=\"/path/to/requirements/file.toml\",\n ).result(timeout=60) # use .result(timeout=...) to wait for the result in a synchronous way\n\n # checkout example from above ...\n```\n\n### Create configuration file\n\nConfigure the test consumer. Check the [test consumer configuration](https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#test-consumer-configuration) for more information.\n\n```python\nimport anyio\nimport toml # has to be installed by the user\n\nimport pysdccc\n\n\nasync def main():\n config = {\n 'SDCcc': {\n ... # add all relevant config parameter\n }\n }\n config_path = anyio.Path('/path/to/configuration/file.toml')\n await config_path.write_text(toml.dumps(config))\n\n runner = pysdccc.SdcccRunner('/path/to/sdccc/result/directory')\n\n await runner.run(config=config_path, requirements='/path/to/requirements/file.toml')\n\n # or if you have already downloaded SDCcc\n config = await runner.get_config() # load default configuration\n config['SDCcc']['Consumer']['DeviceEpr'] = \"urn:uuid:12345678-1234-1234-1234-123456789012\" # e.g. change device epr\n # save and run as above\n```\n\n### Create requirements file\n\nEnable or disable specific requirements. Check the [test requirements](https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#enabling-tests) for more information.\n\n```python\nimport anyio\nimport toml # has to be installed by the user\n\nimport pysdccc\n\n\nasync def main():\n requirements = {\n # the standard name is the key, the requirement from the standard is the value\n 'BICEPS': {\n ... # add all requirements to be tested\n }\n }\n requirements_path = anyio.Path('/path/to/requirement/file.toml')\n await requirements_path.write_text(toml.dumps(requirements))\n\n runner = pysdccc.SdcccRunner('/path/to/sdccc/result/directory')\n\n # optionally, check whether you did not add a requirement that is not available\n await runner.check_requirements(requirements_path)\n await runner.run('/path/to/configuration/file.toml', requirements=requirements_path)\n\n # or, if you have already downloaded SDCcc\n requirements = await runner.get_requirements() # load default configuration\n requirements['BICEPS']['R0033'] = False # e.g. disable biceps R0033\n # save and run as above\n```\n\n### Create test parameter configuration\n\nSome tests require individual parameters. Check the [test parameter configuration](https://github.com/Draegerwerk/SDCcc/?tab=readme-ov-file#test-parameter-configuration) for more information.\n\n```python\nimport anyio\nimport toml # has to be installed by the user\n\nimport pysdccc\n\n\nasync def main():\n testparameter_config = {\n 'TestParameter': {\n ...\n }\n }\n testparameter_config_path = anyio.Path('/path/to/test_parameter/file.toml')\n await testparameter_config_path.write_text(toml.dumps(testparameter_config))\n\n runner = pysdccc.SdcccRunner('/path/to/sdccc/result/directory')\n await runner.run(\n config='/path/to/configuration/file.toml',\n requirements='/path/to/requirements/file.toml',\n testparam=testparameter_config_path,\n )\n\n # or, if you have already downloaded SDCcc\n testparameter_config = await runner.get_test_parameter() # load default configuration\n testparameter_config['TestParameter']['Biceps547TimeInterval'] = 10\n # save and run as above\n```\n\n### Logging\n\nThe SDCcc runner provides a logger called `pysdccc.run` that can be used to log messages during the execution of the tests. Stdout is mapped to logging level `info` and stderr to `error`.\nBe aware that no further processing of the SDCcc process output is done. Depending on the format you use you may get duplicated timestamps, etc. Also, it might happen that a java error can stretch over multiple lines, which may result in multiple log messages in python for the same java error.\n\n### Execute SDCcc from command-line interface (cli)\n\nThere exists a cli wrapper for the SDCcc executable. If `pysdccc[cli]` is installed, `sdccc` can be used to execute arbitrary SDCcc commands, e.g. `sdccc --version`. More information can be found [here](https://github.com/draegerwerk/sdccc?tab=readme-ov-file#running-sdccc).\n\n## Notices\n\n`pysdccc` is not intended for use in medical products, clinical trials, clinical studies, or in clinical routine.\n\n### ISO 9001\n\n`pysdccc` was not developed according to ISO 9001.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2024 Dr\u00e4ger\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.",
"summary": "Python wrapper for SDCcc test tool",
"version": "1.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/Draegerwerk/pysdccc/issues",
"Changelog": "https://github.com/Draegerwerk/pysdccc/blob/main/CHANGELOG.md",
"Homepage": "https://github.com/Draegerwerk/pysdccc",
"Repository": "https://github.com/Draegerwerk/pysdccc.git"
},
"split_keywords": [
"sdccc",
" sdc",
" test",
" wrapper"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d0ef40ae4a1cb2b96324c899bbb3f51cb8ba964bf2ebc75c9ac920ea4e7c7b83",
"md5": "6e115905b83ff1b57b78910d448be1e2",
"sha256": "127ab29d73e3d2aea92289d8296539d6deee3533d0a973bf408bbb8cc49a8504"
},
"downloads": -1,
"filename": "pysdccc-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6e115905b83ff1b57b78910d448be1e2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.14,>=3.11",
"size": 15997,
"upload_time": "2025-08-18T08:08:27",
"upload_time_iso_8601": "2025-08-18T08:08:27.962499Z",
"url": "https://files.pythonhosted.org/packages/d0/ef/40ae4a1cb2b96324c899bbb3f51cb8ba964bf2ebc75c9ac920ea4e7c7b83/pysdccc-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "326184ff2813727fb0d009b99aaa60eac608fff9bf830bc38fd4cd4503e6d43e",
"md5": "895724173c89df11f5646142933a75c9",
"sha256": "ec23b3fb5b9274d824afb1bac73fbbcfa96648e83afe028aae806ab07c47fd5a"
},
"downloads": -1,
"filename": "pysdccc-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "895724173c89df11f5646142933a75c9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.14,>=3.11",
"size": 65767,
"upload_time": "2025-08-18T08:08:29",
"upload_time_iso_8601": "2025-08-18T08:08:29.156205Z",
"url": "https://files.pythonhosted.org/packages/32/61/84ff2813727fb0d009b99aaa60eac608fff9bf830bc38fd4cd4503e6d43e/pysdccc-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-18 08:08:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Draegerwerk",
"github_project": "pysdccc",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pysdccc"
}