Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajout de données provenant de SEAMIS en JSON #146

Draft
wants to merge 93 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
0a84a1a
Download data from remote FTP folder
AntoineAugusti Mar 10, 2023
73242a6
Import JSON data in the database
AntoineAugusti Mar 17, 2023
515cb91
Apply fixes from StyleCI
StyleCIBot Mar 17, 2023
4dd397a
Add secmar_json_evenement_codes
AntoineAugusti Mar 18, 2023
f8c9084
est_metropolitain pour outre-mer
AntoineAugusti Mar 22, 2023
f8af07c
Work on secmar_json_evenement
AntoineAugusti Mar 24, 2023
8757db0
Update table name
AntoineAugusti Mar 24, 2023
3fb5620
Update how to count rows
AntoineAugusti Mar 24, 2023
22bb73e
Rattrape evenements null dans secmar_csv
AntoineAugusti Apr 21, 2023
4223832
Remove Python job
AntoineAugusti Apr 21, 2023
e73146b
Trigger CSV DAG from JSON DAG
AntoineAugusti Apr 21, 2023
0c7bf60
Améliorations categorie_evenement et est_metropolitain
AntoineAugusti Apr 30, 2023
7ac0c13
categorie_evenement peut être null
AntoineAugusti Apr 30, 2023
0baec3a
Améliore est_metropolitain
AntoineAugusti Apr 30, 2023
d36b69c
Fix for trouble à l'ordre public
AntoineAugusti Jun 3, 2023
dabb92d
Improve logic for snosan_json_unique
AntoineAugusti Jun 3, 2023
35c21e1
Add DISTINCT
AntoineAugusti Jun 3, 2023
0680b20
Improve dedup logic for CSV
AntoineAugusti Jun 11, 2023
a3267cb
Mise à jour logique pour resultats_humain
AntoineAugusti Jun 20, 2023
b29428e
Apply fixes from StyleCI
StyleCIBot Jun 20, 2023
7f503ab
Fix SQL script
AntoineAugusti Jun 20, 2023
b07a711
Mise à jour colonnes clandestin
AntoineAugusti Jun 21, 2023
a38a09f
Add DAG ftp_delete_folder
AntoineAugusti Jul 7, 2023
748c19e
Add new codes tables
AntoineAugusti Jul 7, 2023
1246ea2
Import JSON data in main pipeline
AntoineAugusti Jul 7, 2023
261755f
Group create codes tables tasks
AntoineAugusti Jul 7, 2023
78c7da8
Add secmar_json_engagements_durees
AntoineAugusti Jul 8, 2023
71e569f
No f-string
AntoineAugusti Jul 8, 2023
2403491
Rework order
AntoineAugusti Jul 8, 2023
a883a4d
Add snosan_json_moyens
AntoineAugusti Jul 8, 2023
de89106
Replace insert_moyens
AntoineAugusti Jul 9, 2023
2cd430c
Adapte requête SNSM semi-rigides
AntoineAugusti Jul 14, 2023
c174f9e
Adapte documentation
AntoineAugusti Jul 14, 2023
a7aea78
moyen SNSMS is not null
AntoineAugusti Jul 16, 2023
7498676
Maybe download again from FTP
AntoineAugusti Aug 3, 2023
6ef7d15
Update execution_date for download_secmar_json_ftp
AntoineAugusti Aug 11, 2023
ffb5b56
Filter on principalImpl
AntoineAugusti Aug 31, 2023
2f4a9c5
Update FTP folder names
AntoineAugusti Nov 8, 2023
f204f0d
Improve insert_snosan_json_unique
AntoineAugusti Nov 12, 2023
4165c6d
FTP : ignore host when entering passive mode
AntoineAugusti Nov 12, 2023
6242b5a
Improve process_all_days
AntoineAugusti Nov 14, 2023
7406b7b
Ajout fichiers SQL JSON flotteurs
AntoineAugusti Dec 3, 2023
1bc3134
JSON flotteurs : FR ou étranger
AntoineAugusti Dec 3, 2023
ef49465
Bump vacances-scolaires-france
AntoineAugusti Dec 6, 2023
61a1be2
Add check_completness_secmar_json_type_flotteur
AntoineAugusti Dec 23, 2023
46e2e04
Use snosan_json_flotteurs for flotteurs
AntoineAugusti Dec 23, 2023
9b0d8b1
Fix task_id
AntoineAugusti Dec 23, 2023
17f213c
Add check_completness_secmar_json_resultat_flotteur
AntoineAugusti Dec 24, 2023
60d31d9
Work on operations codes
AntoineAugusti Dec 25, 2023
be16f1e
Fix format key
AntoineAugusti Dec 25, 2023
693f89b
Suppression des opérations impliquant un sous-marin
AntoineAugusti Dec 30, 2023
4f9b875
Adjust dependencies
AntoineAugusti Dec 30, 2023
67e477c
Travail sur les événements
AntoineAugusti Dec 30, 2023
842289c
Add ATTAQUE_TERRORISTE
AntoineAugusti Jan 1, 2024
e4812bf
Improve check queries
AntoineAugusti Jan 1, 2024
98bccfe
Fix query
AntoineAugusti Jan 1, 2024
e738ad1
Work on est_metropolitain
AntoineAugusti Jan 4, 2024
914cfce
Improve check unset_tide_data
AntoineAugusti Jan 8, 2024
b3e1f87
Add method to parse coordinates
AntoineAugusti Jan 20, 2024
383e840
Improve parsing for coordinates
AntoineAugusti Jan 20, 2024
9077cdd
Parse coordinates in DAG
AntoineAugusti Jan 20, 2024
e4e3a48
Add not null constraint
AntoineAugusti Jan 20, 2024
41d0502
Amélioration du parsing des coordonnées
AntoineAugusti Feb 15, 2024
28c9edc
DAG : ajout vent_categorie
AntoineAugusti Feb 15, 2024
409a8d1
Ajout colonne nombre_flotteurs_plaisance_a_moteur_impliques
AntoineAugusti Feb 15, 2024
04e10b3
Add secmar_json_operations_departement
AntoineAugusti Feb 24, 2024
8b76e32
Check completness for mer and vent
AntoineAugusti Feb 24, 2024
dac70a5
Work on est_metropolitain
AntoineAugusti Feb 24, 2024
f9777d9
Rename files
AntoineAugusti Feb 24, 2024
28c17ad
Work on snosan_json_operations
AntoineAugusti Feb 24, 2024
37a23e0
Add secmar_json_resultats_humain_categorie
AntoineAugusti Feb 24, 2024
e4c6db1
Work on secmar_json_resultats_humain_resultat
AntoineAugusti Feb 25, 2024
05706be
Stop using secmar_csv_operation
AntoineAugusti May 1, 2024
606583f
Corrige nom table
AntoineAugusti May 2, 2024
c662e64
snosan_json_operations: stop using noms_cross
AntoineAugusti May 5, 2024
04a519f
Update secmar_csv_checks
AntoineAugusti May 5, 2024
782c622
SNOSAN JSON: improve timestamps
AntoineAugusti May 5, 2024
a4818ff
operations: add systeme_source
AntoineAugusti May 5, 2024
60c4367
Rename tasks to snosan_json
AntoineAugusti May 5, 2024
7b25469
Build documentation on snosan_json
AntoineAugusti May 5, 2024
04e666a
CI: do no install python-dev
AntoineAugusti May 8, 2024
4736e3a
Documentation tables codes : avant/après SEAMIS
AntoineAugusti May 8, 2024
ac2a68a
Work on CHANGELOG
AntoineAugusti May 8, 2024
d1fb4d6
Mise à jour tables de codes
AntoineAugusti May 10, 2024
1de8c43
opendata_secmar: dump all tables to CSV
AntoineAugusti May 12, 2024
d641657
Update CHANGELOG
AntoineAugusti May 12, 2024
a8dc1dc
Documentation : ajout liens vers tableur des énumérés
AntoineAugusti May 24, 2024
16c2517
JSON FTP: download again?
AntoineAugusti Aug 9, 2024
2a7cf6f
Corrige gestion migrants dans operations_stats
AntoineAugusti Oct 16, 2024
d30679f
Ajout colonne implique_wingfoil
AntoineAugusti Oct 24, 2024
ab4ca64
Adapte calcul pour avec_clandestins
AntoineAugusti Oct 24, 2024
a9c05d6
CHANGELOG pour implique_wingfoil
AntoineAugusti Oct 25, 2024
3efb64b
Strip when saving JSON file
AntoineAugusti Nov 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 3 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
version: 2
jobs:
python:
docker:
- image: circleci/python:2.7.13
working_directory: ~/repo
steps:
- checkout

- run:
name: Install Ubuntu dependencies
command: sudo apt install -y software-properties-common python-dev libsqlite3-dev zlib1g-dev

- restore_cache:
key: requirements-{{ checksum "requirements.txt" }}
- run:
name: Install Python deps in a venv
command: |
virtualenv -p /usr/bin/python2.7 venv
source venv/bin/activate
pip install -r requirements.txt
echo "source $(pwd)/venv/bin/activate" >> $BASH_ENV
- save_cache:
key: requirements-{{ checksum "requirements.txt" }}
paths:
- "venv"

opendata_build:
docker:
- image: antoineaugusti/secmar-opendata-build:0.0.4
Expand Down Expand Up @@ -57,9 +32,6 @@ jobs:
key: yarn-packages-{{ checksum "/tmp/secmar-documentation/yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Pull CHANGELOG
command: wget https://raw.githubusercontent.com/snosan-tools/secmar-data/master/CHANGELOG.md -O doc/CHANGELOG.md
- run:
name: Build Markdown documentation for opendata
command: |
Expand Down Expand Up @@ -101,7 +73,6 @@ jobs:
- restore_cache:
keys:
- v1-dependencies-{{ checksum "requirements.txt" }}
- run: sudo apt install python-dev
- run:
name: Install dependencies
command: |
Expand Down Expand Up @@ -160,7 +131,6 @@ workflows:
version: 2
all_jobs:
jobs:
- python
- opendata_test
- opendata_build:
requires:
Expand All @@ -170,4 +140,6 @@ workflows:
- opendata_build
filters:
branches:
only: master
only:
- master
- snosan_json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ app/plugins
app/resources/signing

snosan_csv
snosan_json
10 changes: 5 additions & 5 deletions airflow/dags/download_secmar_csv_ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from airflow import DAG
from airflow.models import Variable
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator, BranchPythonOperator
from airflow.operators.python_operator import BranchPythonOperator, PythonOperator
from transformers import secmar_csv

default_args = helpers.default_args({"start_date": datetime(2022, 6, 22, 10, 0)})
Expand All @@ -22,16 +22,16 @@
max_active_runs=1,
concurrency=1,
catchup=True,
schedule_interval="0 10 * * *",
schedule_interval=None,
)
dag.doc_md = __doc__


def setup_ftp_env():
os.environ["FTP_PROXY"] = "false"
os.environ["FTP_HOST"] = Variable.get("SECMAR_CSV_FTP_HOST")
os.environ["FTP_USER"] = Variable.get("SECMAR_CSV_FTP_USER")
os.environ["FTP_PASSWORD"] = Variable.get("SECMAR_CSV_FTP_PASSWORD")
os.environ["FTP_HOST"] = Variable.get("SECMAR_FTP_HOST")
os.environ["FTP_USER"] = Variable.get("SECMAR_FTP_USER")
os.environ["FTP_PASSWORD"] = Variable.get("SECMAR_FTP_PASSWORD")


def ftp_download_fn(**kwargs):
Expand Down
Loading