Skip to content

Commit

Permalink
[REFACTOR] Use PEP8 file naming convention (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
hacherix authored Jan 13, 2025
2 parents 6fee920 + 0d2c725 commit dccbc0d
Show file tree
Hide file tree
Showing 46 changed files with 52 additions and 49 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ __pycache__/
.vscode/
.ruff_cache/
.mypy_cache

.env
local-tmp/
.DS_Store

pyproject.toml
poetry.lock
.env
.venv
.envrc

local-tmp/

data/
output/
1 change: 1 addition & 0 deletions workflows/data_pipelines/agence_bio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

| Information | Valeur |
| -------- | -------- |
| Fichier source | `dag.py` |
| Description | Ce traitement permet de constituer un stock sur les entreprises certifiées bio en France. |
| Fréquence | Quotidienne |
| Données sources | [API Professionnels Bio](https://api.gouv.fr/les-api/api-professionnels-bio) |
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.workflows.data_pipelines.agence_bio.agence_bio_processor import (
from dag_datalake_sirene.workflows.data_pipelines.agence_bio.processor import (
AgenceBioProcessor,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from dag_datalake_sirene.helpers import DataProcessor, Notification
from dag_datalake_sirene.helpers.minio_helpers import File
from dag_datalake_sirene.helpers.utils import flatten_object
from dag_datalake_sirene.workflows.data_pipelines.agence_bio.agence_bio_api import (
from dag_datalake_sirene.workflows.data_pipelines.agence_bio.api import (
BioApiClient,
)
from dag_datalake_sirene.workflows.data_pipelines.agence_bio.agence_bio_config import (
from dag_datalake_sirene.workflows.data_pipelines.agence_bio.config import (
AGENCE_BIO_CONFIG,
)

Expand Down
2 changes: 1 addition & 1 deletion workflows/data_pipelines/bilans_financiers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Information | Valeur |
| -------- | -------- |
| Fichier source | `bilans_financiers_dag.py` |
| Fichier source | `dag.py` |
| Description | Ce traitement permet de synthétiser les données publiées par l'équipe Signaux Faibles et Fiche Commune Entreprise. |
| Fréquence | Quotidienne |
| Données sources | [Jeu de données INPI ratios financiers](https://www.data.gouv.fr/fr/datasets/63cb2e29b22886911440440d/) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.workflows.data_pipelines.bilans_financiers.bilans_financiers_processor import (
from dag_datalake_sirene.workflows.data_pipelines.bilans_financiers.processor import (
BilansFinanciersProcessor,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from dag_datalake_sirene.helpers import DataProcessor, Notification
from dag_datalake_sirene.helpers.utils import get_fiscal_year
from dag_datalake_sirene.workflows.data_pipelines.bilans_financiers.bilans_financiers_config import (
from dag_datalake_sirene.workflows.data_pipelines.bilans_financiers.config import (
BILANS_FINANCIERS_CONFIG,
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.workflows.data_pipelines.colter.colter_config import (
from dag_datalake_sirene.workflows.data_pipelines.colter.config import (
COLTER_CONFIG,
ELUS_CONFIG,
)
from dag_datalake_sirene.workflows.data_pipelines.colter.colter_processor import (
from dag_datalake_sirene.workflows.data_pipelines.colter.processor import (
ColterProcessor,
ElusProcessor,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from dag_datalake_sirene.helpers import DataProcessor
from dag_datalake_sirene.helpers.utils import get_current_year
from dag_datalake_sirene.workflows.data_pipelines.colter.colter_config import (
from dag_datalake_sirene.workflows.data_pipelines.colter.config import (
COLTER_CONFIG,
ELUS_CONFIG,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import timedelta
from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.workflows.data_pipelines.egapro.egapro_processor import (
from dag_datalake_sirene.workflows.data_pipelines.egapro.processor import (
EgaproProcessor,
)
from dag_datalake_sirene.workflows.data_pipelines.egapro.config import EGAPRO_CONFIG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import timedelta
from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.workflows.data_pipelines.ess_france.ess_processor import (
from dag_datalake_sirene.workflows.data_pipelines.ess_france.processor import (
EssFranceProcessor,
)
from dag_datalake_sirene.workflows.data_pipelines.ess_france.config import ESS_CONFIG
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pandas as pd
from dag_datalake_sirene.workflows.data_pipelines.agence_bio.agence_bio_config import (
from dag_datalake_sirene.workflows.data_pipelines.agence_bio.config import (
AGENCE_BIO_CONFIG,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pandas as pd
from dag_datalake_sirene.workflows.data_pipelines.bilans_financiers.bilans_financiers_config import (
from dag_datalake_sirene.workflows.data_pipelines.bilans_financiers.config import (
BILANS_FINANCIERS_CONFIG,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pandas as pd

from dag_datalake_sirene.workflows.data_pipelines.colter.colter_config import (
from dag_datalake_sirene.workflows.data_pipelines.colter.config import (
COLTER_CONFIG,
ELUS_CONFIG,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pandas as pd

from dag_datalake_sirene.workflows.data_pipelines.spectacle.spectacle_config import (
from dag_datalake_sirene.workflows.data_pipelines.spectacle.config import (
SPECTACLE_CONFIG,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pandas as pd

from dag_datalake_sirene.workflows.data_pipelines.formation.formation_config import (
from dag_datalake_sirene.workflows.data_pipelines.formation.config import (
FORMATION_CONFIG,
)

Expand Down
2 changes: 1 addition & 1 deletion workflows/data_pipelines/etl/data_fetch_clean/uai.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pandas as pd
from dag_datalake_sirene.workflows.data_pipelines.uai.uai_config import UAI_CONFIG
from dag_datalake_sirene.workflows.data_pipelines.uai.config import UAI_CONFIG


def preprocess_uai_data(data_dir):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
)
from dag_datalake_sirene.workflows.data_pipelines.egapro.config import EGAPRO_CONFIG
from dag_datalake_sirene.workflows.data_pipelines.finess.config import FINESS_CONFIG
from dag_datalake_sirene.workflows.data_pipelines.agence_bio.agence_bio_config import (
from dag_datalake_sirene.workflows.data_pipelines.agence_bio.config import (
AGENCE_BIO_CONFIG,
)
from dag_datalake_sirene.workflows.data_pipelines.bilans_financiers.bilans_financiers_config import (
from dag_datalake_sirene.workflows.data_pipelines.bilans_financiers.config import (
BILANS_FINANCIERS_CONFIG,
)
from dag_datalake_sirene.workflows.data_pipelines.ess_france.config import (
Expand All @@ -22,16 +22,16 @@
from dag_datalake_sirene.workflows.data_pipelines.rge.config import (
RGE_CONFIG,
)
from dag_datalake_sirene.workflows.data_pipelines.spectacle.spectacle_config import (
from dag_datalake_sirene.workflows.data_pipelines.spectacle.config import (
SPECTACLE_CONFIG,
)
from dag_datalake_sirene.workflows.data_pipelines.formation.formation_config import (
from dag_datalake_sirene.workflows.data_pipelines.formation.config import (
FORMATION_CONFIG,
)
from dag_datalake_sirene.workflows.data_pipelines.uai.uai_config import (
from dag_datalake_sirene.workflows.data_pipelines.uai.config import (
UAI_CONFIG,
)
from dag_datalake_sirene.workflows.data_pipelines.colter.colter_config import (
from dag_datalake_sirene.workflows.data_pipelines.colter.config import (
COLTER_CONFIG,
ELUS_CONFIG,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.workflows.data_pipelines.finess.config import FINESS_CONFIG
from dag_datalake_sirene.workflows.data_pipelines.finess.finess_processor import (
from dag_datalake_sirene.workflows.data_pipelines.finess.processor import (
FinessProcessor,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from airflow.utils.dates import days_ago

from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.workflows.data_pipelines.formation.formation_config import (
from dag_datalake_sirene.workflows.data_pipelines.formation.config import (
FORMATION_CONFIG,
)
from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.workflows.data_pipelines.formation.formation_processor import (
from dag_datalake_sirene.workflows.data_pipelines.formation.processor import (
FormationProcessor,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pandas as pd

from dag_datalake_sirene.helpers import DataProcessor, Notification
from dag_datalake_sirene.workflows.data_pipelines.formation.formation_config import (
from dag_datalake_sirene.workflows.data_pipelines.formation.config import (
FORMATION_CONFIG,
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.workflows.data_pipelines.rge.config import RGE_CONFIG
from dag_datalake_sirene.workflows.data_pipelines.rge.rge_processor import (
RGEProcessor,
from dag_datalake_sirene.workflows.data_pipelines.rge.processor import (
RgeProcessor,
)

rge_processor = RGEProcessor()
rge_processor = RgeProcessor()
default_args = {
"depends_on_past": False,
"email_on_failure": True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from dag_datalake_sirene.workflows.data_pipelines.rge.config import RGE_CONFIG


class RGEProcessor(DataProcessor):
class RgeProcessor(DataProcessor):
def __init__(self):
super().__init__(RGE_CONFIG)

Expand Down
2 changes: 1 addition & 1 deletion workflows/data_pipelines/rne/flux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Information | Valeur |
| -------- | -------- |
| Fichier source | `DAG.py` |
| Fichier source | `dag.py` |
| Description | DAG Airflow permettant de récupérer le flux quotidien des données RNE depuis l'API. Le DAG récupère les données des SIREN modifiés depuis la dernière date de modification enregistrée dans les fichiers JSON stockés sur MinIO et jusqu'à la journée précédant l'exécution du DAG. Une fois récupérées, ces données sont sauvegardées sur une instance Minio. Ces fichiers sont par la suite utilisés pour générer le fichier flux dirigeants pour [l'annuaire des entreprises](https://annuaire-entreprises.data.gouv.fr). | Quotidien |
| Données sources | API RNE INPI |
| Données de sorties | Fichiers json dans Minio |
Expand Down
2 changes: 1 addition & 1 deletion workflows/data_pipelines/rne/stock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Information | Valeur |
| -------- | -------- |
| Fichier source | `DAG.py` |
| Fichier source | `dag.py` |
| Description | DAG Airflow permettant de récupérer les données stock du RNE (INPI). Le DAG récupère le fichier zip depuis le site de l'INPI, parcours les fichiers json, et les sauvegarde sur une instance Minio. Ces fichiers sont par la suite utilisés pour générer le fichier stock dirigeants pour [l'annuaire des entreprises](https://annuaire-entreprises.data.gouv.fr). | Annuel |
| Données sources | STOCK RNE INPI |
| Données de sorties | Fichiers json dans Minio |
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from airflow.decorators import dag, task
from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.workflows.data_pipelines.sirene.flux.sirene_flux_processor import (
from dag_datalake_sirene.workflows.data_pipelines.sirene.flux.processor import (
SireneFluxProcessor,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime
from dag_datalake_sirene.workflows.data_pipelines.sirene.flux.sirene_client import (
from dag_datalake_sirene.workflows.data_pipelines.sirene.flux.api import (
SireneApiClient,
)
from dag_datalake_sirene.helpers.data_processor import DataProcessor, Notification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.workflows.data_pipelines.sirene.stock.sirene_stock_processor import (
from dag_datalake_sirene.workflows.data_pipelines.sirene.stock.processor import (
SireneStockProcessor,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from airflow.utils.dates import days_ago

from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.workflows.data_pipelines.spectacle.spectacle_config import (
from dag_datalake_sirene.workflows.data_pipelines.spectacle.config import (
SPECTACLE_CONFIG,
)
from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.workflows.data_pipelines.spectacle.spectacle_processor import (
from dag_datalake_sirene.workflows.data_pipelines.spectacle.processor import (
SpectacleProcessor,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class SpectacleProcessor(DataProcessor):
def __init__(self):
from dag_datalake_sirene.workflows.data_pipelines.spectacle.spectacle_config import (
from dag_datalake_sirene.workflows.data_pipelines.spectacle.config import (
SPECTACLE_CONFIG,
)

Expand Down
2 changes: 1 addition & 1 deletion workflows/data_pipelines/uai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Information | Valeur |
| -------- | -------- |
| Fichier source | `uai_dag.py` |
| Fichier source | `dag.py` |
| Description | Ce traitement permet de récupérer différentes sources de données autour des établissements scolaires, les traite pour générer un fichier de synthèse complet. |
| Fréquence | Quotidien |
| Données sources | [Annuaire de l'éducation du MENJ](https://www.data.gouv.fr/fr/datasets/5889d03fa3a72974cbf0d5b1/)<br />[Principaux établissements d'enseignement supérieur du MESR](https://www.data.gouv.fr/fr/datasets/586dae5ea3a7290df6f4be88/)<br />[Idéo-Structures d'enseignement supérieur de l'ONISEP](https://www.data.gouv.fr/fr/datasets/5fa5e386afdaa6152360f323/) |
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

from dag_datalake_sirene.config import EMAIL_LIST
from dag_datalake_sirene.helpers import Notification
from dag_datalake_sirene.workflows.data_pipelines.uai.uai_config import (
from dag_datalake_sirene.workflows.data_pipelines.uai.config import (
UAI_CONFIG,
)
from dag_datalake_sirene.workflows.data_pipelines.uai.uai_processor import (
UAIProcessor,
from dag_datalake_sirene.workflows.data_pipelines.uai.processor import (
UaiProcessor,
)

default_args = {
Expand All @@ -33,7 +33,7 @@
on_success_callback=Notification.send_notification_tchap,
)
def data_processing_uai():
uai_processor = UAIProcessor()
uai_processor = UaiProcessor()

@task.bash
def clean_previous_outputs():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import pandas as pd

from dag_datalake_sirene.helpers import DataProcessor, Notification
from dag_datalake_sirene.workflows.data_pipelines.uai.uai_config import (
from dag_datalake_sirene.workflows.data_pipelines.uai.config import (
UAI_CONFIG,
)


class UAIProcessor(DataProcessor):
class UaiProcessor(DataProcessor):
def __init__(self):
super().__init__(UAI_CONFIG)

Expand Down

0 comments on commit dccbc0d

Please sign in to comment.