Skip to content

Commit 6402532

Browse files
committed
Add datagouv dataset publishing documentation
1 parent a0d35a6 commit 6402532

File tree

3 files changed

+47
-9
lines changed

3 files changed

+47
-9
lines changed

content/api/cli.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,37 @@ In these commands:
4848

4949
## Publishing dataset
5050

51-
{{< refItem name="ota dataset [--file <filename>]" description="Export the versions dataset into a ZIP file and publish it to GitHub releases. The dataset title and the URL of the versions repository are defined in the configuration." example="npx ota dataset --file dataset.zip" />}}
51+
{{< refItem name="ota dataset [--file <filename>]" description="Export the versions dataset into a ZIP file. The dataset title is defined in the configuration." example="npx ota dataset --file dataset.zip" />}}
5252

53-
To export the dataset into a ZIP file and publish it on GitHub releases:
53+
To export the dataset into a ZIP file and publish it to configured platforms (GitHub releases, GitLab releases, and/or data.gouv.fr):
5454

55-
{{< refItem name="ota dataset --publish [--file <filename>]" description="Export and publish dataset to GitHub releases" example="GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --publish" />}}
55+
{{< refItem name="ota dataset --publish [--file <filename>]" description="Export and publish dataset to all configured platforms" example="npx ota dataset --publish" />}}
5656

57-
The `GITHUB_TOKEN` can also be defined in a [`.env` file]({{< relref "collections/reference/environment-variables" >}}).
57+
The dataset can be published to multiple platforms simultaneously:
58+
59+
- **GitHub releases**: Requires `OTA_ENGINE_GITHUB_TOKEN` environment variable
60+
- **GitLab releases**: Requires `OTA_ENGINE_GITLAB_TOKEN` environment variable (used only if GitHub token is not configured)
61+
- **data.gouv.fr**: Requires `OTA_ENGINE_DATAGOUV_API_KEY` environment variable and `dataset.datagouv.datasetId` in configuration
62+
63+
These environment variables can be defined in a [`.env` file]({{< relref "collections/reference/environment-variables" >}}).
64+
65+
> **Note**: If both GitHub and GitLab tokens are configured, GitHub takes precedence. data.gouv.fr can be used alongside either GitHub or GitLab.
5866
5967
To export, publish the dataset and remove the local copy that was created after it has been uploaded:
6068

61-
{{< refItem name="ota dataset --publish --remove-local-copy [--file <filename>]" description="Export, publish dataset and remove local copy after upload" example="GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --publish --remove-local-copy" />}}
69+
{{< refItem name="ota dataset --publish --remove-local-copy [--file <filename>]" description="Export, publish dataset and remove local copy after upload" example="npx ota dataset --publish --remove-local-copy" />}}
70+
71+
{{< refItem name="ota dataset --schedule [--file <filename>]" description="Schedule export, publishing and local copy removal" example="npx ota dataset --schedule --publish --remove-local-copy" />}}
72+
73+
### Setting up data.gouv.fr publishing
74+
75+
Before publishing to data.gouv.fr for the first time, you need to:
6276

63-
{{< refItem name="ota dataset --schedule [--file <filename>]" description="Schedule export, publishing and local copy removal" example="GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --schedule --publish --remove-local-copy" />}}
77+
1. Create a dataset on [data.gouv.fr](https://www.data.gouv.fr/) or [demo.data.gouv.fr](https://demo.data.gouv.fr/) (for testing)
78+
2. Copy the dataset ID from the URL (e.g., `6914a64b17a0a91bb0a61222`)
79+
3. Add it to your configuration at `dataset.datagouv.datasetId`
80+
4. Set `dataset.datagouv.useDemo` to `true` if using the demo environment
81+
5. Set the `OTA_ENGINE_DATAGOUV_API_KEY` environment variable with your API key
6482

6583
## Exposing the collection API
6684

content/collections/reference/configuration.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ The reporter section manages how issues are reported when terms content is inacc
180180

181181
### Dataset
182182

183-
The dataset section configures how datasets are published.
183+
The dataset section configures how datasets are published. Datasets can be published to GitHub releases, GitLab releases, and/or data.gouv.fr. If both GitHub and GitLab tokens are configured, GitHub takes precedence.
184184

185185
{{< refItem
186186
name="dataset.title"
@@ -203,6 +203,24 @@ The dataset section configures how datasets are published.
203203
default="30 8 * * MON"
204204
/>}}
205205

206+
#### data.gouv.fr publishing
207+
208+
The data.gouv.fr section configures publishing to the French government's open data platform.
209+
210+
{{< refItem
211+
name="dataset.datagouv.datasetId"
212+
type="string"
213+
description="ID of the dataset on data.gouv.fr. Required for publishing to data.gouv.fr. Must be created manually on the data.gouv.fr website."
214+
example="6914a64b17a0a91bb0a61222"
215+
/>}}
216+
217+
{{< refItem
218+
name="dataset.datagouv.useDemo"
219+
type="boolean"
220+
description="Set to true to use the demo.data.gouv.fr environment for testing."
221+
default="false"
222+
/>}}
223+
206224
### Collection API
207225

208226
The collection API section sets the parameters for the API server.

content/collections/reference/environment-variables.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ This reference documentation details all available environment variables that ca
1313

1414
{{< refItem name="OTA_ENGINE_SENDINBLUE_API_KEY" type="string" description="API key for SendInBlue." />}}
1515

16-
{{< refItem name="OTA_ENGINE_GITHUB_TOKEN" type="string" description="GitHub token for API access." />}}
16+
{{< refItem name="OTA_ENGINE_GITHUB_TOKEN" type="string" description="GitHub token for API access and dataset publishing. If both GitHub and GitLab tokens are configured, GitHub takes precedence for dataset publishing." />}}
1717

18-
{{< refItem name="OTA_ENGINE_GITLAB_TOKEN" type="string" description="GitLab token for API access." />}}
18+
{{< refItem name="OTA_ENGINE_GITLAB_TOKEN" type="string" description="GitLab token for API access and dataset publishing. Used only if GitHub token is not configured." />}}
1919

2020
{{< refItem name="OTA_ENGINE_GITLAB_RELEASES_TOKEN" type="string" description="GitLab token for dataset releases." />}}
2121

22+
{{< refItem name="OTA_ENGINE_DATAGOUV_API_KEY" type="string" description="API key for data.gouv.fr dataset publishing. Requires dataset.datagouv.datasetId to be configured." />}}
23+
2224
---
2325

2426
### Federation API

0 commit comments

Comments
 (0)