Name | saphira JSON |
Version |
0.0.16
JSON |
| download |
home_page | None |
Summary | Access parameters from the Saphira.ai SysEng SSoT |
upload_time | 2024-07-24 15:35:40 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2023 Saphira 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 |
saphira
parameter
hardware
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Saphira Python Setup
To get the Python set up, just run the following command from any standard command line tool:
```
pip install saphira
```
We currently support Python >= 3.9, but can introduce other support if needed. Please reach out to founders@saphira.ai if this is needed.
# Getting & Setting the API Token
If you have created a Saphira account, please click the [settings link](https://prod.saphira.ai/dashboard/settings) and scroll down to API token on the General tab to see the API token. This token will not change and will be the same token throughout using our API.
To set the API token, please make sure the environment variable SAPHIRA_API_TOKEN is set based on the value in the account you find above.
# Setting Up and Using the API
To access individual values linked to requirements of a specific project, please use the command below:
```
saphira.get_param(<project>, <req>)
```
One idiosyncrasy is that the project ID currently contains .json, so copy that full value from the URL. Additionally, the requirement value is just the requirement name.
# Using the CLI
Simply pass the project_id and pipe in details, starting with the unique test name on its own line:
```
cat test.txt | python -m saphira <uuid>.json
```
# API Outputs
When you call API, we capture the script that the API is referenced in. As a longer term initiative, we could version these scripts and even surface this whole script collection within a git repo.
While get_param instantiates the test that you see in the UI, update_test_status marks it as passing or failing. As you can see from the lib header, we offer a few different possible inputs:
```
update_test_status(project: str, requirement: str, passing: bool = False, test_result: Optional[TestResult] = None, exception: Exception = None)
```
Note that we’ll treat the filename as the test name, which is why you don’t have to manually pass it here. Furthermore, the TestResult type is from UnitTest, so that you can do the following:
```
test = unittest.main(exit=False)
saphira.update_test_status(PROJECT, REQ, test_result=test.result)
```
Finally, you could alternatively pass an exception, like this:
```
except Exception as e:
saphira.update_test_status(PROJECT, REQ, exception=e)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "saphira",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "saphira, parameter, hardware",
"author": null,
"author_email": "Saphira AI <contact@saphira.ai>",
"download_url": "https://files.pythonhosted.org/packages/a3/9b/5ec57062632ae704d276d4e50d4f6b33da54da04027541fdb9aab37aa4ab/saphira-0.0.16.tar.gz",
"platform": null,
"description": "# Saphira Python Setup\n\nTo get the Python set up, just run the following command from any standard command line tool:\n\n```\npip install saphira\n```\n\nWe currently support Python >= 3.9, but can introduce other support if needed. Please reach out to founders@saphira.ai if this is needed.\n\n# Getting & Setting the API Token\n\nIf you have created a Saphira account, please click the [settings link](https://prod.saphira.ai/dashboard/settings) and scroll down to API token on the General tab to see the API token. This token will not change and will be the same token throughout using our API. \n\nTo set the API token, please make sure the environment variable SAPHIRA_API_TOKEN is set based on the value in the account you find above.\n\n# Setting Up and Using the API\n\nTo access individual values linked to requirements of a specific project, please use the command below: \n\n```\nsaphira.get_param(<project>, <req>)\n```\n\nOne idiosyncrasy is that the project ID currently contains .json, so copy that full value from the URL. Additionally, the requirement value is just the requirement name.\n\n# Using the CLI\n\nSimply pass the project_id and pipe in details, starting with the unique test name on its own line:\n\n```\ncat test.txt | python -m saphira <uuid>.json\n```\n\n# API Outputs\n\nWhen you call API, we capture the script that the API is referenced in. As a longer term initiative, we could version these scripts and even surface this whole script collection within a git repo. \n\nWhile get_param instantiates the test that you see in the UI, update_test_status marks it as passing or failing. As you can see from the lib header, we offer a few different possible inputs:\n\n```\nupdate_test_status(project: str, requirement: str, passing: bool = False, test_result: Optional[TestResult] = None, exception: Exception = None)\n```\n\nNote that we\u2019ll treat the filename as the test name, which is why you don\u2019t have to manually pass it here. Furthermore, the TestResult type is from UnitTest, so that you can do the following:\n\n```\ntest = unittest.main(exit=False)\nsaphira.update_test_status(PROJECT, REQ, test_result=test.result)\n```\n\nFinally, you could alternatively pass an exception, like this:\n\n```\nexcept Exception as e:\n saphira.update_test_status(PROJECT, REQ, exception=e)\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2023 Saphira 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.",
"summary": "Access parameters from the Saphira.ai SysEng SSoT",
"version": "0.0.16",
"project_urls": {
"Homepage": "https://www.saphira.ai"
},
"split_keywords": [
"saphira",
" parameter",
" hardware"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a39b5ec57062632ae704d276d4e50d4f6b33da54da04027541fdb9aab37aa4ab",
"md5": "fbda1a3bf5986279f110f92b72a7f3de",
"sha256": "6a1fe1fc7342dc0bd6a8c1ca18492915a1e70619e0626c5ac8de4273bb91e0cf"
},
"downloads": -1,
"filename": "saphira-0.0.16.tar.gz",
"has_sig": false,
"md5_digest": "fbda1a3bf5986279f110f92b72a7f3de",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 8237,
"upload_time": "2024-07-24T15:35:40",
"upload_time_iso_8601": "2024-07-24T15:35:40.438303Z",
"url": "https://files.pythonhosted.org/packages/a3/9b/5ec57062632ae704d276d4e50d4f6b33da54da04027541fdb9aab37aa4ab/saphira-0.0.16.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-24 15:35:40",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "saphira"
}