### Install Project Dependencies Source: https://guides.data.gouv.fr/passe-marche/readme.md Run the installation script to set up project dependencies. ```bash ./bin/install ``` -------------------------------- ### Run Fake Editor App Source: https://guides.data.gouv.fr/passe-marche/readme.md Install dependencies and start the Fake Editor application for OAuth2 demonstration. Access the dashboard at http://localhost:4567. ```bash # Démarrer l'application de démonstration OAuth2 cd fake_editor_app bundle install bundle exec rackup -p 4567 # Accéder au dashboard : http://localhost:4567 ``` -------------------------------- ### Install Dependencies Source: https://guides.data.gouv.fr/passe-marche/fake_editor_app.md Navigate to the application directory and install Ruby dependencies using Bundler. ```bash cd fake_editor_app bundle install ``` -------------------------------- ### Quick Start for Demo App Source: https://guides.data.gouv.fr/passe-marche/readme.md Steps to start the Passe Marché server and the fake editor demo application. ```bash # 1. Démarrer Passe Marché bin/dev # 2. Dans un autre terminal, démarrer l'app de démo cd fake_editor_app bundle install bundle exec rackup -p 4567 # 3. Accéder au dashboard # http://localhost:4567 ``` -------------------------------- ### Start Development Server Source: https://guides.data.gouv.fr/passe-marche/readme.md Start the Rails development server using the provided script or directly with Rails. ```bash # Démarrer le serveur de développement bin/dev # Ou directement Rails bin/rails server ``` -------------------------------- ### Start the Application Source: https://guides.data.gouv.fr/passe-marche/fake_editor_app.md Run this command in your terminal to start the Sinatra application on port 4567. ```bash bundle exec rackup -p 4567 ``` -------------------------------- ### Querying Documentation with GET Request Source: https://guides.data.gouv.fr/guides/guide-qualite/preparer-un-jeu-de-donnees-de-qualite/structurer-un-jeu-de-donnees.md Use this GET request to query the documentation dynamically with a specific question. The response includes a direct answer and relevant excerpts. ```http GET https://guides.data.gouv.fr/guides/guide-qualite/preparer-un-jeu-de-donnees-de-qualite/structurer-un-jeu-de-donnees.md?ask= ``` -------------------------------- ### Installer l'environnement de test et lancer les tests Source: https://guides.data.gouv.fr/fabrique-des-standards/readme/realisation-du-standard/utiliser-le-modele-de-depot-github.md Procédure pour installer les dépendances Python et exécuter les tests de validation de schéma et de conformité des exemples localement. ```bash python3 -m venv venv source venv/bin/activate ``` ```bash pip install -r requirements.txt ``` ```bash frictionless validate --type schema schema.json ``` ```bash frictionless validate --schema schema.json exemple-valide.csv ``` -------------------------------- ### Querying Documentation Dynamically Source: https://guides.data.gouv.fr/annuaire-des-entreprises/pour-bien-commencer/quickstart/les-donnees-de-lespace-agent-public.md Perform an HTTP GET request on the current page URL with the `ask` query parameter to get answers to specific questions about the documentation. The question should be self-contained and in natural language. ```http GET https://guides.data.gouv.fr/annuaire-des-entreprises/pour-bien-commencer/quickstart/les-donnees-de-lespace-agent-public.md?ask= ``` -------------------------------- ### Example Callback URL Source: https://guides.data.gouv.fr/passe-marche/docs/sfd_editeurs.md An example of a complete callback URL with placeholder identifiers. ```url https://editeur.com/callback?market_identifier=VR-2024-A1B2C3D4E5F6&application_identifier=FT20240615A1B2C3D4 ``` -------------------------------- ### Copy Environment File Source: https://guides.data.gouv.fr/passe-marche/fake_editor_app.md Copy the example environment file to create a new .env file for your configuration. ```bash cp .env.example .env ``` -------------------------------- ### Configuration Python avec datagouv-client Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/prise-en-main/gerer-un-jeu-de-donnees-par-lapi.md Initialise le client pour utiliser la librairie `datagouv-client` afin d'interagir avec l'API data.gouv.fr. Nécessite l'installation de `datagouv-client`. ```python # Tous les exemples Python sont executés avec cette convention from datagouv import Client, Dataset, Resource # installé avec `pip install datagouv-client` # vous devez avoir les droits sur les objets que vous souhaitez modifier modifier ORG = "5bbb6d6cff66bd4dc17bfd5a" DATASET = "5bc04b2cff66bd680e499f4a" RESOURCE = "54d47250-1daf-483b-965a-3013f8c76617" client = Client( environment="www", # pour cibler la plateforme de production, également possible de cibler demo ou dev api_key="my-api-key", # utilisez bien la clé API de la plateforme spécifiée ci-dessus ) ``` -------------------------------- ### Query Documentation with GET Request Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/prise-en-main/gerer-un-jeu-de-donnees-par-lapi.md Use this method to ask questions about the documentation. Append the 'ask' parameter with your question to the documentation URL. ```bash GET https://guides.data.gouv.fr/api-de-data.gouv.fr/prise-en-main/gerer-un-jeu-de-donnees-par-lapi.md?ask= ``` -------------------------------- ### Get Contact Point Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/reference/contacts.md Use this endpoint to retrieve details of a specific contact point. Requires a GET request to the /contacts/{contact_point}/ path. ```http GET https://www.data.gouv.fr/api/1/swagger.json ``` -------------------------------- ### Ask a Question via HTTP GET Source: https://guides.data.gouv.fr/guides Use this method to get a direct answer to a specific question from the documentation. The question should be self-contained and in natural language. ```http GET https://guides.data.gouv.fr/readme.md?ask= ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://guides.data.gouv.fr/fabrique-des-standards/readme/realisation-du-standard/gerer-un-depot-github.md Use this method to ask questions about the documentation dynamically. The response includes direct answers and relevant excerpts. ```bash GET https://guides.data.gouv.fr/fabrique-des-standards/readme/realisation-du-standard/gerer-un-depot-github.md?ask= ``` -------------------------------- ### Connect to PostgreSQL and Create Table with Psycopg2 Source: https://guides.data.gouv.fr/guides/reutiliser-des-donnees/prise-en-main-des-donnees-meteorologiques.md Demonstrates connecting to a PostgreSQL database using a connection string and executing a CREATE TABLE IF NOT EXISTS statement. Ensure psycopg2 is installed. ```python import psycopg2 connexion = 'postgres://user:password@localhost:5432/meteo' create_table = """CREATE TABLE IF NOT EXISTS csv_meteo_hor(NUM_POSTE text, NOM_USUEL text, LAT double precision, LON double precision, ALTI integer, AAAAMMJJHH bigint, RR1 text, QRR1 integer, DRR1 text, QDRR1 integer, FF text, QFF integer, DD text, QDD integer, FXY text, QFXY integer, DXY text, QDXY integer, HXY text, QHXY integer, FXI text, QFXI integer, DXI text, QDXI integer, HXI text, QHXI integer, FF2 text, QFF2 integer, DD2 text, QDD2 integer, FXI2 text, QFXI2 integer, DXI2 text, QDXI2 integer, HXI2 text, QHXI2 integer, FXI3S text, QFXI3S integer, DXI3S text, QDXI3S integer, HFXI3S text, QHFXI3S integer, T text, QT integer, TD text, QTD integer, TN text, QTN integer, HTN text, QHTN integer, TX text, QTX integer, HTX text, QHTX integer, DG text, QDG integer, T10 text, QT10 integer, T20 text, QT20 integer, T50 text, QT50 integer, T100 text, QT100 integer, TNSOL text, QTNSOL integer, TN50 text, QTN50 integer, TCHAUSSEE text, QTCHAUSSEE integer, DHUMEC text, QDHUMEC integer, U text, QU integer, UN text, QUN integer, HUN text, QHUN integer, UX text, QUX integer, HUX text, QHUX integer, DHUMI40 text, QDHUMI40 integer, DHUMI80 text, QDHUMI80 integer, TSV text, QTSV integer, PMER text, QPMER integer, PSTAT text, QPSTAT integer, PMERMIN text, QPERMIN integer, GEOP text, QGEOP integer, N text, QN integer, NBAS text, QNBAS integer, CL text, QCL integer, CM text, QCM integer, CH text, QCH integer, N1 text, QN1 integer, C1 text, QC1 integer, B1 text, QB1 integer, N2 text, QN2 integer, C2 text, QC2 integer, B2 text, QCB2 integer, N3 text, QN3 integer, C3 text, QC3 integer, B3 text, QB3 integer, N4 text, QN4 integer, C4 text, QC4 integer, B4 text, QB4 integer, VV text, QVV integer, DVV200 text, QDVV200 integer, WW text, QWW integer, W1 text, QW1 integer, W2 text, QW2 integer, SOL text, QSOL integer, SOLNG text, QSOLNG integer, TMER text, QTMER integer, VVMER text, QVVMER integer, ETATMER text, QETATMER integer, DIRHOULE text, QDIRHOULE integer, HVAGUE text, QHVAGUE integer, PVAGUE text, QPVAGUE integer, HNEIGEF text, QHNEIGEF integer, NEIGETOT text, QNEIGETOT integer, TSNEIGE text, QTSNEIGE integer, TUBENEIGE text, QTUBENEIGE integer, HNEIGEFI3 text, QHNEIGEFI3 integer, HNEIGEFI1 text, QHNEIGEFI1 integer, ESNEIGE text, QESNEIGE integer, CHARGENEIGE text, QCHARGENEIGE integer, GLO text, QGLO integer, GLO2 text, QGLO2 integer, DIR text, QDIR integer, DIR2 text, QDIR2 integer, DIF text, QDIF integer, DIF2 text, QDIF2 integer, UV text, QUV integer, UV2 text, QUV2 integer, UV_INDICE text, QUV_INDICE integer, INFRAR text, QINFRAR integer, INFRAR2 text, QINFRAR2 integer, INS text, QINS integer, INS2 text, QINS2 integer, TLAGON text, QTLAGON integer, TVEGETAUX text, QTVEGETAUX integer, ECOULEMENT text, QECOULEMENT integer)""" with psycopg2.connect(connexion) as conn: cur = conn.cursor() cur.execute(create_table) cur.execute("""SELECT * FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname != 'information_schema';"""") ``` -------------------------------- ### GET /site/reuses.csv OpenAPI Specification Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/reference/site.md This snippet shows the OpenAPI 3.1.1 specification for the GET /site/reuses.csv endpoint, which allows downloading site reuses in CSV format. ```json {"openapi":"3.1.1","info":{"title":"uData API","version":"1.0"},"tags":[{"description":"Site global namespace","name":"site"}],"servers":[{"url":"http://www.data.gouv.fr/api/1"}],"paths":{"/site/reuses.csv":{"get":{"operationId":"get_site_reuses_csv","responses":{"200":{"description":"Success"}},"tags":["site"]}}}} ``` -------------------------------- ### Create a Remote Resource using datagouv-client Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/prise-en-main/gerer-un-jeu-de-donnees-par-lapi.md This example shows how to create a remote resource using the datagouv-client library in Python. Provide the URL and other necessary payload details. ```python resource = client.resource().create_remote( payload={ "url": "https://url.to/ressource.csv", "title": "Nouvelle ressource distante", "type": "main", # optionnel, "main" par défaut }, dataset_id=DATASET, ) ``` -------------------------------- ### GET /site/resources.csv OpenAPI Specification Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/reference/site.md This snippet shows the OpenAPI 3.1.1 specification for the GET /site/resources.csv endpoint, which allows downloading site resources in CSV format. ```json {"openapi":"3.1.1","info":{"title":"uData API","version":"1.0"},"tags":[{"description":"Site global namespace","name":"site"}],"servers":[{"url":"http://www.data.gouv.fr/api/1"}],"paths":{"/site/resources.csv":{"get":{"operationId":"get_site_resources_csv","responses":{"200":{"description":"Success"}},"tags":["site"]}}}} ``` -------------------------------- ### Create a Local File Resource using datagouv-client Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/prise-en-main/gerer-un-jeu-de-donnees-par-lapi.md This example demonstrates creating a local file resource using the datagouv-client library in Python. You can specify optional payload details like title and type. ```python resource = client.resource().create_static( file_to_upload="/chemin/vers/le/fichier", payload={ "title": "Nouvelle ressource", "type": "main", # optionnel, "main" par défaut }, dataset_id=DATASET, ) # ou alternativement au sein du dataset dataset = client.dataset(DATASET) resource = dataset.create_static( file_to_upload="/chemin/vers/le/fichier", payload={ "title": "Nouvelle ressource", "type": "main", # optionnel, "main" par défaut }, ) ``` -------------------------------- ### GET /site/organizations.csv OpenAPI Specification Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/reference/site.md This snippet shows the OpenAPI 3.1.1 specification for the GET /site/organizations.csv endpoint, which allows downloading site organizations in CSV format. ```json {"openapi":"3.1.1","info":{"title":"uData API","version":"1.0"},"tags":[{"description":"Site global namespace","name":"site"}],"servers":[{"url":"http://www.data.gouv.fr/api/1"}],"paths":{"/site/organizations.csv":{"get":{"operationId":"get_site_organizations_csv","responses":{"200":{"description":"Success"}},"tags":["site"]}}}} ``` -------------------------------- ### Lister les couches d'un endpoint WFS avec GDAL Source: https://guides.data.gouv.fr/guides/reutiliser-des-donnees/utiliser-les-api-geographiques/utiliser-lapi-decoupage-administratif.md Utilisez `ogrinfo` pour lister les couches disponibles dans un service WFS. Cela permet de comprendre la structure du service avant d'interroger des données spécifiques. ```bash ogrinfo -so WFS:https://wxs.ign.fr/administratif/geoportail/wfs ``` ```bash ogrinfo --DEBUG ON -so WFS:https://wxs.ign.fr/administratif/geoportail/wfs ``` -------------------------------- ### GET /site/harvests.csv OpenAPI Specification Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/reference/site.md This snippet shows the OpenAPI 3.1.1 specification for the GET /site/harvests.csv endpoint, which allows downloading site harvests in CSV format. ```json {"openapi":"3.1.1","info":{"title":"uData API","version":"1.0"},"tags":[{"description":"Site global namespace","name":"site"}],"servers":[{"url":"http://www.data.gouv.fr/api/1"}],"paths":{"/site/harvests.csv":{"get":{"operationId":"get_site_harvests_csv","responses":{"200":{"description":"Success"}},"tags":["site"]}}}} ``` -------------------------------- ### Query Documentation with GET Request Source: https://guides.data.gouv.fr/api Use this method to ask specific questions about the documentation. The response includes direct answers and relevant excerpts. ```http GET https://guides.data.gouv.fr/api.md?ask= ``` -------------------------------- ### Variables d'environnement pour HTTPie Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/prise-en-main/gerer-un-jeu-de-donnees-par-lapi.md Configure les variables d'environnement pour les exemples HTTPie. Assurez-vous que HTTPie est installé. ```bash # Tous les examples HTTPie sont executés avec cette convention # HTTPie doit être installé export API = 'https://www.data.gouv.fr/api/1' export API_KEY = 'my-api-key' export ORG = '5bbb6d6cff66bd4dc17bfd5a' export DATASET = '5bc04b2cff66bd680e499f4a' export RESOURCE = '54d47250-1daf-483b-965a-3013f8c76617' ``` -------------------------------- ### GET /site/datasets.csv OpenAPI Specification Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/reference/site.md This snippet shows the OpenAPI 3.1.1 specification for the GET /site/datasets.csv endpoint, which allows downloading site datasets in CSV format. ```json {"openapi":"3.1.1","info":{"title":"uData API","version":"1.0"},"tags":[{"description":"Site global namespace","name":"site"}],"servers":[{"url":"http://www.data.gouv.fr/api/1"}],"paths":{"/site/datasets.csv":{"get":{"operationId":"get_site_datasets_csv","responses":{"200":{"description":"Success"}},"tags":["site"]}}}} ``` -------------------------------- ### Query Documentation Dynamically Source: https://guides.data.gouv.fr/passe-marche/parcours-candidat.md Use this method to ask questions about the documentation. The response includes a direct answer, relevant excerpts, and sources. ```http GET https://guides.data.gouv.fr/passe-marche/parcours-candidat.md?ask= ``` -------------------------------- ### Query Documentation via API Source: https://guides.data.gouv.fr/ecologie.data.gouv.fr/ecologie.data.gouv.fr/collections-thematiques/gerer-une-collection-via-lapi-data.gouv.fr.md To get additional information not directly on the page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://guides.data.gouv.fr/ecologie.data.gouv.fr/ecologie.data.gouv.fr/collections-thematiques/gerer-une-collection-via-lapi-data.gouv.fr.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://guides.data.gouv.fr/donnees-specifiques/donnees-de-la-commande-publique/publier-les-donnees-essentielles-des-marches-publics.md Use this method to ask questions about the documentation when information is not explicitly present. The response includes a direct answer, excerpts, and sources. ```bash GET https://guides.data.gouv.fr/donnees-specifiques/donnees-de-la-commande-publique/publier-les-donnees-essentielles-des-marches-publics.md?ask= ``` -------------------------------- ### Callback URL Example Source: https://guides.data.gouv.fr/passe-marche/docs/sfd_editeurs.md This is an example of the redirect URL with a market identifier parameter after a candidate completes a process. It's used to return the user to the editor's platform with context. ```url https://editeur.com/callback?market_identifier=VR-2024-A1B2C3D4E5F6 ``` -------------------------------- ### Set up Minio Client Alias Source: https://guides.data.gouv.fr/guides/reutiliser-des-donnees/autour-du-cadastre/manipuler-les-donnees-du-cadastre.md Configure an alias for the S3-compatible storage endpoint. This command sets up the connection to the specified URL without requiring authentication. ```bash mc alias set cadastre_gouv_no_authent https://object.data.gouv.fr '' '' ``` -------------------------------- ### Query Documentation Page Source: https://guides.data.gouv.fr/passe-marche/socle-de-base/3.-rechercher-filtrer-et-retrouver-rapidement-un-champ To get additional information not directly present on a page, perform an HTTP GET request with the 'ask' query parameter. This allows for dynamic querying of the documentation. ```http GET https://guides.data.gouv.fr/passe-marche/socle-de-base/3.-rechercher-filtrer-et-retrouver-rapidement-un-champ.md?ask= ``` -------------------------------- ### Create Dataset using datagouv-client Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/prise-en-main/gerer-un-jeu-de-donnees-par-lapi.md Utilize the datagouv-client library in Python to create a dataset. Pass a dictionary with title, description, and organization to the client.dataset().create method. ```python dataset = client.dataset().create( { "title": "Mon titre", "description": "Ma description", "organization": ORG, }, ) ``` -------------------------------- ### Query Documentation Page Source: https://guides.data.gouv.fr/organisations/gerer-les-membres-de-son-organisation.md To get additional information not directly available on the page, you can perform an HTTP GET request with the 'ask' query parameter. This allows for dynamic querying of the documentation. ```bash GET https://guides.data.gouv.fr/organisations/gerer-les-membres-de-son-organisation.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://guides.data.gouv.fr/intelligence-artificielle/le-serveur-mcp-de-data.gouv.fr.md To get information not directly on the page, make an HTTP GET request to the page URL with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://guides.data.gouv.fr/intelligence-artificielle/le-serveur-mcp-de-data.gouv.fr.md?ask= ``` -------------------------------- ### Query Documentation Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/reference/contacts.md To ask questions about this documentation, perform an HTTP GET request on the page URL with the 'ask' query parameter. The response will contain a direct answer and relevant excerpts. ```http GET https://guides.data.gouv.fr/api-de-data.gouv.fr/reference/contacts.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://guides.data.gouv.fr/autres/creer-une-verticale-thematique-de-data.gouv.fr.md Perform an HTTP GET request to the current page URL with the 'ask' query parameter to dynamically query the documentation. The question should be specific and self-contained. ```bash GET https://guides.data.gouv.fr/autres/creer-une-verticale-thematique-de-data.gouv.fr.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://guides.data.gouv.fr/api-de-data.gouv.fr/reference/notifications.md To get specific information not explicitly stated on this page, send an HTTP GET request to the page URL with an 'ask' query parameter containing your question. ```http GET https://guides.data.gouv.fr/api-de-data.gouv.fr/reference/notifications.md?ask= ``` -------------------------------- ### Query Documentation with a Question Source: https://guides.data.gouv.fr/annuaire-des-entreprises Perform an HTTP GET request to the documentation index with the 'ask' parameter to get a direct answer to a specific question. The question should be self-contained and in natural language. ```HTTP GET https://guides.data.gouv.fr/foire-aux-questions.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://guides.data.gouv.fr/annuaire-des-entreprises/pour-bien-commencer/decouvrir-lespace-agent/comprendre-leligibilite-a-lespace-agent.md To get specific information not directly on the page, make an HTTP GET request to the page URL with an 'ask' query parameter. The question should be in natural language. ```HTTP GET https://guides.data.gouv.fr/annuaire-des-entreprises/pour-bien-commencer/decouvrir-lespace-agent/comprendre-leligibilite-a-lespace-agent.md?ask= ``` -------------------------------- ### Configuration et Lancement de fake_editor_app Source: https://guides.data.gouv.fr/passe-marche/docs/01_demarrage_rapide.md Configurez et lancez l'application de démonstration fake_editor_app pour tester l'intégration. Assurez-vous d'éditer le fichier .env avec vos paramètres spécifiques avant de lancer l'application. ```bash # 1. Configuration et lancement cd fake_editor_app bundle install cp .env.example .env # Éditez .env avec vos paramètres bundle exec rackup -p 4567 ``` -------------------------------- ### Query Documentation Dynamically Source: https://guides.data.gouv.fr/annuaire-des-entreprises/pour-approfondir/types-de-donnees-et-habilitations/administrer-votre-groupe-de-travail.md To get additional information not directly present on a page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://guides.data.gouv.fr/annuaire-des-entreprises/pour-approfondir/types-de-donnees-et-habilitations/administrer-votre-groupe-de-travail.md?ask= ```