Skip to content

Commit 75eac6b

Browse files
authored
fix: split toolbox documentation (HEXA-1653) (#1824)
1 parent 907bbd8 commit 75eac6b

17 files changed

Lines changed: 237 additions & 215 deletions

backend/hexa/mcp/docs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def _resolve_docs_dir() -> Path:
2626
"writing-pipelines",
2727
"cli",
2828
"sdk",
29-
"toolbox",
29+
"toolbox-dhis2",
30+
"toolbox-iaso",
31+
"toolbox-hexa",
3032
"notebooks-advanced",
3133
"static-webapps",
3234
}

backend/hexa/mcp/tests/test_help.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def test_unknown_topic_returns_error_with_available_topics(self):
3030
"notebooks-advanced",
3131
"sdk",
3232
"static-webapps",
33-
"toolbox",
33+
"toolbox-dhis2",
34+
"toolbox-hexa",
35+
"toolbox-iaso",
3436
"writing-pipelines",
3537
},
3638
)
@@ -55,6 +57,6 @@ def test_docstring_lists_curated_topics(self):
5557
"- Pass a topic name to fetch that doc page in full. Reason is optional here.\n"
5658
"\n"
5759
"\n"
58-
" Available topics: cli, notebooks-advanced, sdk, static-webapps, toolbox, writing-pipelines."
60+
" Available topics: cli, notebooks-advanced, sdk, static-webapps, toolbox-dhis2, toolbox-hexa, toolbox-iaso, writing-pipelines."
5961
)
6062
self.assertEqual(get_help_or_doc.__doc__, expected)

docs/en/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,14 @@ If you're new to OpenHEXA, follow this learning path:
9595
If you're planning to develop pipelines or work with the API:
9696

9797
- **[Writing OpenHEXA Pipelines](writing-pipelines.md)** - Create custom data workflows
98+
- **[Static Webapps](static-webapps.md)** - Host static web applications inside OpenHEXA
9899
- **[Using the OpenHEXA CLI](cli.md)** - Command-line interface
99100
- **[Using the OpenHEXA SDK](sdk.md)** - Python development kit
100-
- **[Using the OpenHEXA Toolbox](toolbox.md)** - Development utilities
101+
- **[Using the OpenHEXA Toolbox - DHIS2](toolbox-dhis2.md)** - Acquire and process data from DHIS2 instances
102+
- **[Using the OpenHEXA Toolbox - IASO](toolbox-iaso.md)** - Fetch data from IASO
103+
- **[Using the OpenHEXA Toolbox - OpenHEXA Client](toolbox-hexa.md)** - Legacy GraphQL client (deprecated)
101104
- **[Using Notebooks in OpenHEXA](notebooks-advanced.md)** - Advanced notebook usage
105+
- **[API Authentication](api-authentication.md)** - Authenticate against the OpenHEXA API
102106

103107

104108
### 👥 For administrators

docs/en/notebooks-advanced.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ The OpenHEXA notebooks component works as a standard Jupyter environment, with a
2828
The present guide will walk you through the specificities of the OpenHEXA notebooks environment. You may also find the following two guides interesting:
2929

3030
- [Using the OpenHEXA SDK](sdk.md): the OpenHEXA SDK is a Python library that provides building blocks and helper methods to write code on OpenHEXA
31-
- [Using the OpenHEXA Toolbox](toolbox.md): the OpenHEXA toolbox is a collection of utilities that can assist you in health data science integration and analysis workflows
31+
- [Using the OpenHEXA Toolbox - DHIS2](toolbox-dhis2.md): Acquire and process data from DHIS2 instances
32+
- [Using the OpenHEXA Toolbox - IASO](toolbox-iaso.md): Fetch data from IASO
33+
- [Using the OpenHEXA Toolbox - OpenHEXA Client](toolbox-hexa.md): Legacy GraphQL client (deprecated)
3234

3335
## Using the workspace filesystem
3436

docs/en/notebooks.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ The OpenHEXA notebooks component works as a standard Jupyter environment, with a
4141
This guide walks you through the specifics of the OpenHEXA notebooks environment. You may also find these guides helpful:
4242

4343
- [Using the OpenHEXA SDK](sdk.md): The OpenHEXA SDK is a Python library that provides building blocks and helper methods for writing code on OpenHEXA
44-
- [Using the OpenHEXA Toolbox](toolbox.md): The OpenHEXA Toolbox is a collection of utilities that can help you with health data science integration and analysis workflows
44+
- [Using the OpenHEXA Toolbox - DHIS2](toolbox-dhis2.md): Acquire and process data from DHIS2 instances
45+
- [Using the OpenHEXA Toolbox - IASO](toolbox-iaso.md): Fetch data from IASO
46+
- [Using the OpenHEXA Toolbox - OpenHEXA Client](toolbox-hexa.md): Legacy GraphQL client (deprecated)
4547

4648
## Key JupyterLab features
4749

Lines changed: 1 addition & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<div class="hero-section">
2-
<h1><i class="fas fa-hexagon" style="margin-right: 0.5rem;"></i>Using the OpenHEXA Toolbox</h1>
2+
<h1><i class="fas fa-hexagon" style="margin-right: 0.5rem;"></i>OpenHEXA Toolbox DHIS2</h1>
33
</div>
4-
</div>
5-
6-
# OpenHEXA Toolbox DHIS2
74

85
An utility library to acquire and process data from a DHIS2 instance.
96

@@ -444,100 +441,3 @@ True
444441
>>> period_from_string("2022Q3") == q1
445442
True
446443
```
447-
448-
449-
450-
# OpenHEXA Toolbox IASO
451-
452-
Module to fetch data from IASO.
453-
454-
## Installation
455-
456-
``` sh
457-
pip install openhexa.toolbox
458-
```
459-
460-
## Usage
461-
462-
### Connect to an instance
463-
464-
Credentials are required to initialize a connection to IASO instance. Credentials should contain the username and
465-
password to connect to an instance of IASO. You have as well to provide the host name to for the api to connect to:
466-
* Staging environment https://iaso-staging.bluesquare.org/api
467-
* Production environment https://iaso.bluesquare.org/api
468-
469-
Import IASO module as:
470-
```
471-
from openhexa.toolbox.iaso import IASO
472-
473-
iaso = IASO("https://iaso-staging.bluesquare.org","username", "password")
474-
```
475-
476-
### Read data
477-
478-
After importing IASO module, you can use provided method to fetch Projects, Organisation Units and Forms that you have
479-
permissions for.
480-
```
481-
# Fetch projects
482-
iaso.get_projects()
483-
# Fetch organisation units
484-
iaso.get_org_units()
485-
# Fetch submitted forms filtered by form_ids passed in url parameters and with choice to fetch them as dataframe
486-
iaso.get_form_instances(page=1, limit=1, as_dataframe=True,
487-
dataframe_columns=["Date de création","Date de modification","Org unit"], ids=276)
488-
# Fetch forms filtered by organisaiton units and projects that you have permissions to
489-
iaso.get_forms(org_units=[781], projects=[149])
490-
```
491-
492-
You can as well provide additional parameters to the method to filter on desired values as key value arguments.
493-
You can have an overview on the arguments you can filter on API documentation of IASO.
494-
495-
# OpenHEXA Toolbox - OpenHEXA Client (no longer maintained)
496-
497-
_⚠️ We now recommend using the [SDK OpenHexa Client](sdk.md#using-the-openhexa-client) instead. It contains plenty of (typed) methods and can be semi-automatically extended by the OpenHexa team. The toolbox client will not be maintained/extended in the future_
498-
499-
The OpenHEXA class is part of the OpenHexa toolbox, designed for interacting with the OpenHexa platform's API.
500-
The OpenHEXAClient module enables users to interact with the OpenHEXA backend using GraphQL syntax.
501-
502-
## Installation
503-
504-
``` sh
505-
pip install openhexa.toolbox
506-
```
507-
508-
## Usage
509-
510-
### Connect to the API
511-
512-
To initialize the OpenHEXA class, you need to provide the server_url of the OpenHexa instance and either a username/password combination or an API token for authentication.
513-
Two-factor authentication should be disabled for this method.
514-
515-
```python
516-
from openhexa.toolbox.hexa import OpenHEXA
517-
# We can authenticate using username / password
518-
hexa = OpenHEXA("https://app.demo.openhexa.org", username="username", password="password")
519-
520-
# You can also use the token provided by OpenHEXA on the pipelines page.
521-
hexa = OpenHEXA("https://app.demo.openhexa.org", token="token")
522-
```
523-
524-
### Play with the API
525-
526-
After importing Hexa module, you can use provided method to fetch Projects, Organisation Units and Forms that you have
527-
permissions for.
528-
529-
```python
530-
from openhexa.toolbox.hexa import OpenHEXA
531-
# Get workspaces
532-
workspaces = hexa.get_workspaces()
533-
534-
# Get pipelines in a specific workspace
535-
workspace_slug = workspaces['workspaces']['items'][0]['slug']
536-
pipelines = hexa.get_pipelines(workspace_slug)
537-
538-
# Run a pipeline
539-
pipeline_id = pipelines['pipelines']['items'][0]['id']
540-
run_response = hexa.run_pipeline(id=pipeline_id,config={}, send_notification=True)
541-
542-
print(run_response)
543-
```

docs/en/toolbox-hexa.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<div class="hero-section">
2+
<h1><i class="fas fa-hexagon" style="margin-right: 0.5rem;"></i>OpenHEXA Toolbox - OpenHEXA Client (no longer maintained)</h1>
3+
</div>
4+
5+
_⚠️ We now recommend using the [SDK OpenHexa Client](sdk.md#using-the-openhexa-client) instead. It contains plenty of (typed) methods and can be semi-automatically extended by the OpenHexa team. The toolbox client will not be maintained/extended in the future_
6+
7+
The OpenHEXA class is part of the OpenHexa toolbox, designed for interacting with the OpenHexa platform's API.
8+
The OpenHEXAClient module enables users to interact with the OpenHEXA backend using GraphQL syntax.
9+
10+
## Installation
11+
12+
``` sh
13+
pip install openhexa.toolbox
14+
```
15+
16+
## Usage
17+
18+
### Connect to the API
19+
20+
To initialize the OpenHEXA class, you need to provide the server_url of the OpenHexa instance and either a username/password combination or an API token for authentication.
21+
Two-factor authentication should be disabled for this method.
22+
23+
```python
24+
from openhexa.toolbox.hexa import OpenHEXA
25+
# We can authenticate using username / password
26+
hexa = OpenHEXA("https://app.demo.openhexa.org", username="username", password="password")
27+
28+
# You can also use the token provided by OpenHEXA on the pipelines page.
29+
hexa = OpenHEXA("https://app.demo.openhexa.org", token="token")
30+
```
31+
32+
### Play with the API
33+
34+
After importing Hexa module, you can use provided method to fetch Projects, Organisation Units and Forms that you have
35+
permissions for.
36+
37+
```python
38+
from openhexa.toolbox.hexa import OpenHEXA
39+
# Get workspaces
40+
workspaces = hexa.get_workspaces()
41+
42+
# Get pipelines in a specific workspace
43+
workspace_slug = workspaces['workspaces']['items'][0]['slug']
44+
pipelines = hexa.get_pipelines(workspace_slug)
45+
46+
# Run a pipeline
47+
pipeline_id = pipelines['pipelines']['items'][0]['id']
48+
run_response = hexa.run_pipeline(id=pipeline_id,config={}, send_notification=True)
49+
50+
print(run_response)
51+
```

docs/en/toolbox-iaso.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<div class="hero-section">
2+
<h1><i class="fas fa-hexagon" style="margin-right: 0.5rem;"></i>OpenHEXA Toolbox IASO</h1>
3+
</div>
4+
5+
Module to fetch data from IASO.
6+
7+
## Installation
8+
9+
``` sh
10+
pip install openhexa.toolbox
11+
```
12+
13+
## Usage
14+
15+
### Connect to an instance
16+
17+
Credentials are required to initialize a connection to IASO instance. Credentials should contain the username and
18+
password to connect to an instance of IASO. You have as well to provide the host name to for the api to connect to:
19+
* Staging environment https://iaso-staging.bluesquare.org/api
20+
* Production environment https://iaso.bluesquare.org/api
21+
22+
Import IASO module as:
23+
```
24+
from openhexa.toolbox.iaso import IASO
25+
26+
iaso = IASO("https://iaso-staging.bluesquare.org","username", "password")
27+
```
28+
29+
### Read data
30+
31+
After importing IASO module, you can use provided method to fetch Projects, Organisation Units and Forms that you have
32+
permissions for.
33+
```
34+
# Fetch projects
35+
iaso.get_projects()
36+
# Fetch organisation units
37+
iaso.get_org_units()
38+
# Fetch submitted forms filtered by form_ids passed in url parameters and with choice to fetch them as dataframe
39+
iaso.get_form_instances(page=1, limit=1, as_dataframe=True,
40+
dataframe_columns=["Date de création","Date de modification","Org unit"], ids=276)
41+
# Fetch forms filtered by organisaiton units and projects that you have permissions to
42+
iaso.get_forms(org_units=[781], projects=[149])
43+
```
44+
45+
You can as well provide additional parameters to the method to filter on desired values as key value arguments.
46+
You can have an overview on the arguments you can filter on API documentation of IASO.

docs/en/writing-pipelines.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ The present guide will walk you through the creation and the deployment of an Op
1616

1717
- [Using the OpenHEXA SDK](sdk.md): the OpenHEXA SDK is a Python library that provides building blocks and helper methods to write code on OpenHEXA
1818
- [Using the OpenHEXA CLI](cli.md): the OpenHEXA CLI is a command-line utility that allows you to interact with your OpenHEXA instance from your terminal
19-
- [Using the OpenHEXA Toolbox](toolbox.md): the OpenHEXA toolbox is a collection of utilities that can assist you in health data science integration and analysis workflows
19+
- [Using the OpenHEXA Toolbox - DHIS2](toolbox-dhis2.md): Acquire and process data from DHIS2 instances
20+
- [Using the OpenHEXA Toolbox - IASO](toolbox-iaso.md): Fetch data from IASO
21+
- [Using the OpenHEXA Toolbox - OpenHEXA Client](toolbox-hexa.md): Legacy GraphQL client (deprecated)
2022

2123
## Quickstart
2224

docs/fr/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,14 @@ Si vous êtes nouveau sur OpenHEXA, suivez ce parcours d'apprentissage :
9595
Si vous prévoyez de développer des pipelines ou de travailler avec l'API :
9696

9797
- **[Écrire des pipelines OpenHEXA](writing-pipelines.md)** - Créez des flux de travail de données personnalisés
98+
- **[Webapps statiques](static-webapps.md)** - Héberger des applications web statiques dans OpenHEXA
9899
- **[Utiliser l'OpenHEXA CLI](cli.md)** - Interface en ligne de commande
99100
- **[Utiliser l'OpenHEXA SDK](sdk.md)** - Kit de développement Python
100-
- **[Utiliser l'OpenHEXA Toolbox](toolbox.md)** - Utilitaires de développement
101+
- **[Utiliser l'OpenHEXA Toolbox - DHIS2](toolbox-dhis2.md)** - Acquérir et traiter des données depuis des instances DHIS2
102+
- **[Utiliser l'OpenHEXA Toolbox - IASO](toolbox-iaso.md)** - Récupérer des données depuis IASO
103+
- **[Utiliser l'OpenHEXA Toolbox - Client OpenHEXA](toolbox-hexa.md)** - Client GraphQL hérité (déprécié)
101104
- **[Utiliser les notebooks dans OpenHEXA](notebooks-advanced.md)** - Utilisation avancée des notebooks
105+
- **[Authentification API](api-authentication.md)** - S'authentifier auprès de l'API OpenHEXA
102106

103107

104108
### 👥 Pour les administrateurs

0 commit comments

Comments
 (0)