# 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://raw.githubusercontent.com/simvue-io/.github/refs/heads/main/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.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-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>
## 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_metric_threshold_alert(
name='loss-too-high', # Name
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": null,
"name": "simvue",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.15,>=3.10",
"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/4a/32/87836823d2a5eef912e68aca7c79ec532496b2453ee01a18252b92b9a0ab/simvue-2.2.2.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://raw.githubusercontent.com/simvue-io/.github/refs/heads/main/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.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-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\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_metric_threshold_alert(\n name='loss-too-high', # Name\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\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": "2.2.2",
"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": null,
"digests": {
"blake2b_256": "5dcdb7633095b0cd20ce173ee4a5904076c35d5698de2f6ca58b4a0af25577a6",
"md5": "abcf15ab04f5e8ea478bfc6fd63d3530",
"sha256": "7591a61f19f1f42401ee0ec28d6ee3895c9f3ed357f55754ca0d2c9e402e72fb"
},
"downloads": -1,
"filename": "simvue-2.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "abcf15ab04f5e8ea478bfc6fd63d3530",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.15,>=3.10",
"size": 152608,
"upload_time": "2025-10-14T07:50:54",
"upload_time_iso_8601": "2025-10-14T07:50:54.926470Z",
"url": "https://files.pythonhosted.org/packages/5d/cd/b7633095b0cd20ce173ee4a5904076c35d5698de2f6ca58b4a0af25577a6/simvue-2.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4a3287836823d2a5eef912e68aca7c79ec532496b2453ee01a18252b92b9a0ab",
"md5": "3522565d84242a8f0d3ccc56ff268ffb",
"sha256": "e1135fecabc58181b6e1d6991c19d819a90cba61d7aa6b0d9c580531854910c3"
},
"downloads": -1,
"filename": "simvue-2.2.2.tar.gz",
"has_sig": false,
"md5_digest": "3522565d84242a8f0d3ccc56ff268ffb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.15,>=3.10",
"size": 121030,
"upload_time": "2025-10-14T07:50:56",
"upload_time_iso_8601": "2025-10-14T07:50:56.322294Z",
"url": "https://files.pythonhosted.org/packages/4a/32/87836823d2a5eef912e68aca7c79ec532496b2453ee01a18252b92b9a0ab/simvue-2.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-14 07:50:56",
"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"
}