# Simvue Python client
<br/>
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/simvue-io/.github/refs/heads/main/simvue-white.png" />
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/simvue-io/.github/refs/heads/main/simvue-black.png" />
<img alt="Simvue" src="https://github.com/simvue-io/.github/blob/5eb8cfd2edd3269259eccd508029f269d993282f/simvue-black.png" width="500">
</picture>
</p>
<p align="center">
Collect metadata, metrics and artifacts from simulations, processing and AI/ML training tasks running on any platform, in real time.
</p>
<div align="center">
<a href="https://github.com/simvue-io/client/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/github/license/simvue-io/client"/></a>
<img src="https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue">
<a href="https://pypi.org/project/simvue/" target="_blank"><img src="https://img.shields.io/pypi/v/simvue.svg"/></a>
<a href="https://pepy.tech/project/simvue"><img src="https://static.pepy.tech/badge/simvue"/></a>
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"></a>
</div>
<h3 align="center">
<a href="https://simvue.io"><b>Website</b></a>
•
<a href="https://docs.simvue.io"><b>Documentation</b></a>
</h3>
## Configuration
The service URL and token can be defined as environment variables:
```sh
export SIMVUE_URL=...
export SIMVUE_TOKEN=...
```
or a file `simvue.toml` can be created containing:
```toml
[server]
url = "..."
token = "..."
```
The exact contents of both of the above options can be obtained directly by clicking the **Create new run** button on the web UI. Note that the environment variables have preference over the config file.
## Usage example
```python
from simvue import Run
...
if __name__ == "__main__":
...
# Using a context manager means that the status will be set to completed automatically,
# and also means that if the code exits with an exception this will be reported to Simvue
with Run() as run:
# Specify a run name, metadata (dict), tags (list), description, folder
run.init('example-run-name',
{'learning_rate': 0.001, 'training_steps': 2000, 'batch_size': 32}, # Metadaata
['tensorflow'], # Tags
'This is a test.', # Description
'/Project-A/part1') # Folder full path
# Set folder details if necessary
run.set_folder_details('/Project-A/part1', # Folder full path
metadata={}, # Metadata
tags=['tensorflow'], # Tags
description='This is part 1 of a test') # Description
# Upload the code
run.save_file('training.py', 'code')
# Upload an input file
run.save_file('params.in', 'input')
# Add an alert (the alert definition will be created if necessary)
run.create_alert(name='loss-too-high', # Name
source='metrics', # Source
rule='is above', # Rule
metric='loss', # Metric
frequency=1, # Frequency
window=1, # Window
threshold=10, # Threshold
notification='email') # Notification type
...
while not converged:
...
# Send metrics inside main application loop
run.log_metrics({'loss': 0.5, 'density': 34.4})
...
# Upload an output file
run.save_file('output.cdf', 'output')
# If we weren't using a context manager we'd need to end the run
# run.close()
```
## License
Released under the terms of the [Apache 2](https://github.com/simvue-io/client/blob/main/LICENSE) license.
Raw data
{
"_id": null,
"home_page": "https://simvue.io",
"name": "simvue",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "tracking, monitoring, metrics, alerting, metrics-gathering",
"author": "Simvue Development Team",
"author_email": "info@simvue.io",
"download_url": "https://files.pythonhosted.org/packages/72/68/69ac6ca2e6c20095b71c4ba7af869a1e16d27d5b4c982782324b456cb24a/simvue-1.1.4.tar.gz",
"platform": null,
"description": "# Simvue Python client\n\n<br/>\n\n<p align=\"center\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/simvue-io/.github/refs/heads/main/simvue-white.png\" />\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/simvue-io/.github/refs/heads/main/simvue-black.png\" />\n <img alt=\"Simvue\" src=\"https://github.com/simvue-io/.github/blob/5eb8cfd2edd3269259eccd508029f269d993282f/simvue-black.png\" width=\"500\">\n </picture>\n</p>\n\n<p align=\"center\">\nCollect metadata, metrics and artifacts from simulations, processing and AI/ML training tasks running on any platform, in real time.\n</p>\n\n<div align=\"center\">\n<a href=\"https://github.com/simvue-io/client/blob/main/LICENSE\" target=\"_blank\"><img src=\"https://img.shields.io/github/license/simvue-io/client\"/></a>\n<img src=\"https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue\">\n<a href=\"https://pypi.org/project/simvue/\" target=\"_blank\"><img src=\"https://img.shields.io/pypi/v/simvue.svg\"/></a>\n<a href=\"https://pepy.tech/project/simvue\"><img src=\"https://static.pepy.tech/badge/simvue\"/></a>\n<a href=\"https://github.com/astral-sh/ruff\"><img src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\"></a>\n</div>\n\n<h3 align=\"center\">\n <a href=\"https://simvue.io\"><b>Website</b></a>\n \u2022\n <a href=\"https://docs.simvue.io\"><b>Documentation</b></a>\n</h3>\n\n## Configuration\nThe service URL and token can be defined as environment variables:\n```sh\nexport SIMVUE_URL=...\nexport SIMVUE_TOKEN=...\n```\nor a file `simvue.toml` can be created containing:\n```toml\n[server]\nurl = \"...\"\ntoken = \"...\"\n```\nThe exact contents of both of the above options can be obtained directly by clicking the **Create new run** button on the web UI. Note that the environment variables have preference over the config file.\n\n## Usage example\n```python\nfrom simvue import Run\n\n...\n\nif __name__ == \"__main__\":\n\n ...\n\n # Using a context manager means that the status will be set to completed automatically,\n # and also means that if the code exits with an exception this will be reported to Simvue\n with Run() as run:\n\n # Specify a run name, metadata (dict), tags (list), description, folder\n run.init('example-run-name',\n {'learning_rate': 0.001, 'training_steps': 2000, 'batch_size': 32}, # Metadaata\n ['tensorflow'], # Tags\n 'This is a test.', # Description\n '/Project-A/part1') # Folder full path\n\n # Set folder details if necessary\n run.set_folder_details('/Project-A/part1', # Folder full path\n metadata={}, # Metadata\n tags=['tensorflow'], # Tags\n description='This is part 1 of a test') # Description\n\n # Upload the code\n run.save_file('training.py', 'code')\n\n # Upload an input file\n run.save_file('params.in', 'input')\n\n # Add an alert (the alert definition will be created if necessary)\n run.create_alert(name='loss-too-high', # Name\n source='metrics', # Source\n rule='is above', # Rule\n metric='loss', # Metric\n frequency=1, # Frequency\n window=1, # Window\n threshold=10, # Threshold\n notification='email') # Notification type\n\n ...\n\n while not converged:\n\n ...\n\n # Send metrics inside main application loop\n run.log_metrics({'loss': 0.5, 'density': 34.4})\n\n ...\n\n # Upload an output file\n run.save_file('output.cdf', 'output')\n\n # If we weren't using a context manager we'd need to end the run\n # run.close()\n```\n\n## License\n\nReleased under the terms of the [Apache 2](https://github.com/simvue-io/client/blob/main/LICENSE) license.\n\n",
"bugtrack_url": null,
"license": "Apache v2",
"summary": "Simulation tracking and monitoring",
"version": "1.1.4",
"project_urls": {
"Documentation": "https://docs.simvue.io",
"Homepage": "https://simvue.io",
"Repository": "https://github.com/simvue-io/python-api"
},
"split_keywords": [
"tracking",
" monitoring",
" metrics",
" alerting",
" metrics-gathering"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9bb07b2874ffe3ca2387965b08d5d8dd15f6286af92b7afd2a4edbe44174a5d1",
"md5": "d69e8f32fae212b84c1746732e08e21e",
"sha256": "e8917aec09a73e62c00e9fca820f9b66cf4ae9d5130a0b44bc382a74ab1c40a6"
},
"downloads": -1,
"filename": "simvue-1.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d69e8f32fae212b84c1746732e08e21e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 93075,
"upload_time": "2024-12-11T14:13:53",
"upload_time_iso_8601": "2024-12-11T14:13:53.622287Z",
"url": "https://files.pythonhosted.org/packages/9b/b0/7b2874ffe3ca2387965b08d5d8dd15f6286af92b7afd2a4edbe44174a5d1/simvue-1.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "726869ac6ca2e6c20095b71c4ba7af869a1e16d27d5b4c982782324b456cb24a",
"md5": "a733eb27fc92a9dacba9fdbac91b9aa5",
"sha256": "e5914063af7d41b1e3fea972d8201acef3b156a14dccfdfb21faa46a27d88a96"
},
"downloads": -1,
"filename": "simvue-1.1.4.tar.gz",
"has_sig": false,
"md5_digest": "a733eb27fc92a9dacba9fdbac91b9aa5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 84387,
"upload_time": "2024-12-11T14:13:57",
"upload_time_iso_8601": "2024-12-11T14:13:57.315270Z",
"url": "https://files.pythonhosted.org/packages/72/68/69ac6ca2e6c20095b71c4ba7af869a1e16d27d5b4c982782324b456cb24a/simvue-1.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-11 14:13:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "simvue-io",
"github_project": "python-api",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "simvue"
}