Metadata-Version: 2.4
Name: tvbo
Version: 0.2.5
Summary: The Virtual Brain Ontology
Project-URL: homepage, https://virtual-twin.github.io/tvbo/
Project-URL: documentation, https://virtual-twin.github.io/tvbo/
Project-URL: repository, https://github.com/virtual-twin/tvbo
Project-URL: bug-tracker, https://github.com/virtual-twin/tvbo/issues
Author-email: Leon Martin <leon.martin@bih-charite.de>
License: EUPL-1.2
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: autopep8>=2.3.2
Requires-Dist: bibtexparser>=1.4.2
Requires-Dist: black>=25.9.0
Requires-Dist: cairocffi>=1.7.1
Requires-Dist: cairosvg>=2.7.1
Requires-Dist: dipy>=1.10.0
Requires-Dist: equinox>=0.11.12
Requires-Dist: fuzzywuzzy>=0.18.0
Requires-Dist: goatools>=1.4.12
Requires-Dist: h5py>=3.12.1
Requires-Dist: jax>=0.6.0
Requires-Dist: lark>=1.2.2
Requires-Dist: librosa>=0.10.2.post1
Requires-Dist: linkml>=1.8.5
Requires-Dist: mako>=1.3.10
Requires-Dist: matplotlib>=3.10.0
Requires-Dist: networkx>=3.4.2
Requires-Dist: numpy>=2.0.0
Requires-Dist: owlready2>=0.47
Requires-Dist: pandas>=2.2.3
Requires-Dist: pdf2image>=1.17.0
Requires-Dist: pybel>=0.14.10
Requires-Dist: pybids>=0.18.1
Requires-Dist: pybtex>=0.24.0
Requires-Dist: pydantic>=2.6.0
Requires-Dist: pydot>=3.0.3
Requires-Dist: pylems>=0.6.7
Requires-Dist: pyneuroml>=1.3.15
Requires-Dist: pypandoc>=1.15
Requires-Dist: pypdf2>=3.0.1
Requires-Dist: python-levenshtein>=0.26.1
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: rdflib>=7.1.1
Requires-Dist: scipy>=1.15.0
Requires-Dist: setuptools>=80.3.1
Requires-Dist: simple-colors>=0.1
Requires-Dist: sympy>=1.13.0
Requires-Dist: unicodeit>=0.7.5
Requires-Dist: wget>=3.2
Provides-Extra: all
Requires-Dist: docker>=7.1.0; extra == 'all'
Requires-Dist: fastapi>=0.115.0; extra == 'all'
Requires-Dist: ipykernel; extra == 'all'
Requires-Dist: jupyter-cache; extra == 'all'
Requires-Dist: nbclient; extra == 'all'
Requires-Dist: nbformat; extra == 'all'
Requires-Dist: quartodoc; extra == 'all'
Requires-Dist: tvb-framework; extra == 'all'
Requires-Dist: tvb-library; extra == 'all'
Requires-Dist: uvicorn>=0.30.0; extra == 'all'
Provides-Extra: api
Requires-Dist: docker>=7.1.0; extra == 'api'
Requires-Dist: fastapi>=0.115.0; extra == 'api'
Requires-Dist: uvicorn>=0.30.0; extra == 'api'
Provides-Extra: julia
Requires-Dist: julia>=0.5.7; extra == 'julia'
Provides-Extra: knowledge
Provides-Extra: tvb
Requires-Dist: tvb-data; extra == 'tvb'
Requires-Dist: tvb-framework; extra == 'tvb'
Requires-Dist: tvb-library; extra == 'tvb'
Description-Content-Type: text/markdown


<img src="https://raw.githubusercontent.com/virtual-twin/tvbo/main/imgs/tvbo_logo.png" alt="TVBO logo" title="TVBO" align="right" height="100" />

# The Virtual Brain Ontology
[![Python package](https://github.com/virtual-twin/tvbo/workflows/Python%20package/badge.svg)](https://github.com/virtual-twin/tvbo/actions?query=workflow%3A%22Python+package%22)
[![PyPI version](https://img.shields.io/pypi/v/tvbo.svg)](https://pypi.org/project/tvbo/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/tvbo)](https://pypi.org/project/tvbo/)
[![License](https://img.shields.io/badge/License-EUPL--1.2-blue.svg)](LICENSE)

`tvbo` is a Python library to access the knowledge representation system (i.e., ontology) and data model for the neuroinformatics platform The Virtual Brain (TVB).

## 🚀 Installation

```bash
pip install tvbo
```

## 📖 Quick Start

### Example: Lorenz Attractor Simulation

<details>
<summary><b>📝 Model Specification (YAML)</b></summary>

```yaml
name: LorenzAttractor
parameters:
    sigma:
        value: 10
        label: Prandtl number
    rho:
        label: Rayleigh number
        value: 28
    beta:
        value: 2.6666666666666665
state_variables:
    X:
        equation:
            lhs: \dot{X}
            rhs: sigma * (Y - X)
    Y:
        equation:
            lhs: \dot{Y}
            rhs: X * (rho - Z) - Y
    Z:
        equation:
            lhs: \dot{Z}
            rhs: X * Y - beta * Z
```

</details>

<details>
<summary><b>🔧 Generate Code</b></summary>

```python
from tvbo import Dynamics, SimulationExperiment

lorenz = Dynamics(
    parameters={
        "sigma": {"value": 10.0},
        "rho": {"value": 28.0},
        "beta": {"value": 8 / 3},
    },
    state_variables={
        "X": {"equation": {"rhs": "sigma * (Y - X)"}},
        "Y": {"equation": {"rhs": "X * (rho - Z) - Y"}},
        "Z": {"equation": {"rhs": "X * Y - beta * Z"}},
    },
)

code = SimulationExperiment(local_dynamics=lorenz).render_code('jax')
print(code)
```

</details>

<details>
<summary><b>▶️ Run Simulation</b></summary>

```python
from tvbo import Dynamics, SimulationExperiment

lorenz = Dynamics(
    parameters={
        "sigma": {"value": 10.0},
        "rho": {"value": 28.0},
        "beta": {"value": 8 / 3},
    },
    state_variables={
        "X": {"equation": {"rhs": "sigma * (Y - X)"}},
        "Y": {"equation": {"rhs": "X * (rho - Z) - Y"}},
        "Z": {"equation": {"rhs": "X * Y - beta * Z"}},
    },
)

# Run simulation and plot results
SimulationExperiment(local_dynamics=lorenz).run(duration=1000).plot()
```

</details>

## 📚 Documentation

- **[Full Documentation](https://virtual-twin.github.io/tvbo/)**
- **[Model Browser](https://virtual-twin.github.io/tvbo/browser)** - Browse models, parameters, and equations
- **[Metadata Schema](https://virtual-twin.github.io/tvbo/datamodel)** - Explore the TVB-O data model

## 🔬 Features

- 🧠 Access TVB ontology and knowledge base
- 📊 Define and simulate dynamical systems
- 🔄 Code generation for multiple backends (JAX, NumPy)
- 📈 Built-in visualization tools
- 🗃️ Structured metadata schema

## 📦 Installation Options

### Standard Installation
```bash
pip install tvbo
```

### With API Server Support
```bash
pip install tvbo[api]
```

### With TVB Integration
```bash
pip install tvbo[tvb]
```

### Full Installation (All Features)
```bash
pip install tvbo[all]
```

> **Note:** The `knowledge` extra requires manual installation:
> ```bash
> pip install git+https://github.com/neurommsig/neurommsig-knowledge.git
> ```

## 📄 License

Copyright © 2025 Charité Universitätsmedizin Berlin. This software is licensed under the terms of the European Union Public Licence (EUPL) version 1.2 or later.
