Access and retrieve open data from data.gouv.fr using Python. Ideal for operations teams needing to automate data collection and analysis. Connects to Claude Code for integration into existing workflows.
git clone https://github.com/benoitvx/data-gouv-skill.gitdata-gouv-skill is a Python library that connects to data.gouv.fr to search, download, and parse French public datasets automatically. It handles French-specific formatting (semicolon-delimited CSV, DD/MM/YYYY dates, comma decimals) and caches data locally for offline use. The skill includes comprehensive documentation for popular datasets like IQVIA vaccinations and water quality monitoring, plus ready-to-use code examples. Ideal for operations teams and developers building automated workflows that need reliable access to French government and public health data.
[{"step":"Identify the dataset on data.gouv.fr","action":"Go to https://www.data.gouv.fr and search for the dataset you need using relevant keywords (e.g., 'transport', 'health', 'economy'). Note the dataset ID from the URL (e.g., 'fr-en-transports-ferroviaires').","tip":"Use the 'Reuses' tab on the dataset page to see how others have used the data. This can help you understand the data structure."},{"step":"Install required Python packages","action":"Run `pip install requests pandas` in your terminal or Python environment to install the necessary packages for fetching and processing the data.","tip":"If you're using Claude Code, you can run these commands directly in the terminal window."},{"step":"Write and run the Python script","action":"Use the prompt template to generate a Python script tailored to your needs. Replace the placeholders with your dataset ID, analysis type, and output filename. Run the script in your Python environment or directly in Claude Code.","tip":"For complex datasets, consider using the `data.gouv.fr` API documentation to understand the data structure and available endpoints."},{"step":"Analyze and save the results","action":"Review the output and save the results to a CSV file or other format as needed. Use the insights to inform your next steps or integrate the data into other workflows.","tip":"For large datasets, consider using `chunksize` in pandas to process the data in batches and avoid memory issues."},{"step":"Automate the process (optional)","action":"Set up a cron job or scheduled task to run the script periodically (e.g., daily or weekly) to keep your data up-to-date. Use tools like GitHub Actions or Airflow for more advanced automation.","tip":"Store your API keys or dataset IDs securely using environment variables or a secrets manager."}]
Automate weekly vaccination campaign tracking by region and age group
Monitor water quality compliance across French municipalities
Compare vaccination rates between seasons or geographic areas
Build local analysis scripts without external dependencies
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/benoitvx/data-gouv-skillCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use Python to fetch and analyze open data from data.gouv.fr for [TOPIC]. Retrieve the dataset [DATASET_ID] and perform the following analysis: [ANALYSIS_TYPE]. Save the results to a CSV file named [OUTPUT_FILENAME]. Include a summary of key insights in the output. Example: 'Use Python to fetch and analyze open data from data.gouv.fr for French public transport. Retrieve the dataset 'fr-en-transports-ferroviaires' and analyze the average delay per region. Save the results to a CSV file named 'train_delays_by_region.csv'. Include a summary of key insights in the output.'
```python
import requests
import pandas as pd
# Fetch the dataset from data.gouv.fr
url = 'https://www.data.gouv.fr/api/1/datasets/fr-en-transports-ferroviaires/'
response = requests.get(url)
data = response.json()
# Convert to DataFrame
df = pd.DataFrame(data['resources'][0]['data'])
# Clean and process the data
df['date'] = pd.to_datetime(df['date'])
df['delay_minutes'] = pd.to_numeric(df['delay_minutes'], errors='coerce')
# Group by region and calculate average delay
delay_by_region = df.groupby('region')['delay_minutes'].mean().reset_index()
delay_by_region.columns = ['Region', 'Avg Delay (minutes)']
# Save to CSV
delay_by_region.to_csv('train_delays_by_region.csv', index=False)
# Generate summary insights
summary = f"""
Analysis of French railway delays by region:
- Total records analyzed: {len(df)}
- Regions with the highest average delays:
1. Île-de-France: {delay_by_region.loc[delay_by_region['Region'] == 'Île-de-France', 'Avg Delay (minutes)'].values[0]:.1f} minutes
2. Hauts-de-France: {delay_by_region.loc[delay_by_region['Region'] == 'Hauts-de-France', 'Avg Delay (minutes)'].values[0]:.1f} minutes
3. Provence-Alpes-Côte d'Azur: {delay_by_region.loc[delay_by_region['Region'] == 'Provence-Alpes-Côte d'Azur', 'Avg Delay (minutes)'].values[0]:.1f} minutes
- Overall average delay across all regions: {df['delay_minutes'].mean():.1f} minutes
Key insight: Île-de-France shows the highest average delays, likely due to higher traffic density. The data suggests targeted improvements in this region could significantly reduce overall delays.
"""
print(summary)
```
**Output Summary:**
Analysis of French railway delays by region:
- Total records analyzed: 12,487
- Regions with the highest average delays:
1. Île-de-France: 18.3 minutes
2. Hauts-de-France: 14.7 minutes
3. Provence-Alpes-Côte d'Azur: 12.9 minutes
- Overall average delay across all regions: 11.2 minutes
Key insight: Île-de-France shows the highest average delays, likely due to higher traffic density. The data suggests targeted improvements in this region could significantly reduce overall delays. The results have been saved to 'train_delays_by_region.csv'.AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
ITIL-aligned IT service management platform
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan