feature : ajout des fonctions pour l'ingestion API#13
Closed
alexpetit wants to merge 2 commits intodataforgoodfr:mainfrom
Closed
feature : ajout des fonctions pour l'ingestion API#13alexpetit wants to merge 2 commits intodataforgoodfr:mainfrom
alexpetit wants to merge 2 commits intodataforgoodfr:mainfrom
Conversation
cgoudet
approved these changes
Mar 4, 2026
Collaborator
cgoudet
left a comment
There was a problem hiding this comment.
Sur le fond pas de problèmes.
Quelques commentaires sur le style.
D'ailleurs le pre-commit fail. Tu peux installer via uv run pre-commit install puis lancer uv run pre-commit run --all.
biolit/export_api.py
Outdated
| import polars as pl | ||
| import requests | ||
|
|
||
| ###Test export from API |
biolit/export_api.py
Outdated
| def fetch_biolit_api(per_page: int = 1000): | ||
| all_data = [] | ||
| page = 1 | ||
| print("Téléchargement des données depuis l'API Biolit...") |
Collaborator
There was a problem hiding this comment.
Passer ca en logging. Pareil plus bas dans le code.
biolit/export_api.py
Outdated
|
|
||
| ###Test export from API | ||
|
|
||
| def fetch_biolit_api(per_page: int = 1000): |
Collaborator
There was a problem hiding this comment.
Peux tu ajouter le typage de l'output
biolit/export_api.py
Outdated
| return df | ||
|
|
||
|
|
||
| def adapt_api_to_parquet_schema(df): |
biolit/export_api.py
Outdated
| "espece": "nom_scientifique", | ||
| "common": "nom_commun", | ||
| }) | ||
| .with_columns([ |
Collaborator
There was a problem hiding this comment.
pas besoin de [] pour plusieurs éléments de with_columns
biolit/export_api.py
Outdated
| df_api = fetch_biolit_api() | ||
| if df_api.is_empty(): | ||
| return df_api | ||
| print(adapt_api_to_parquet_schema(df_api).head()) |
…PI, ajout de test(limite aux 5 premieres pages pour le moment)
Contributor
Author
|
J’ai créé une nouvelle branche avec les fixes pre-commit : #18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ajout des fonctions pour requeter l'API et renommer au bon format. Fonctions non-intégrés dans observation.py pour le moment