diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6369b832eed1dc40ea6f25a43a0ad482ea3b7b64..0283ef292f0b04c4e94ab11266a720bcd135f261 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,7 @@ stages: - lint + - build + - deploy variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" @@ -15,6 +17,7 @@ lint: except: - /^wip-.*$/ - /^old-.*$/ + - pitchme script: - python -V - apt-get update -qq && apt-get -qq -y install make python3-venv @@ -23,3 +26,34 @@ lint: - pip install -r requirements.txt - pip install -r requirements-dev.txt - make --no-print-directory lint + +slide_gen: + stage: build + only: + - pitchme + - /^.*-talk$/ + image: + name: marpteam/marp-cli + entrypoint: [""] + script : + - mkdir build/ + - export MARP_USER="$(id -u):$(id -g)" + - /home/marp/.cli/docker-entrypoint -I docs/ -o build/ + artifacts: + paths: + - "build/" + +pages: + stage: deploy + only: + - pitchme + - /^.*-talk$/ + script: + - mv build public + - mv docs/img public/img + - mv public/PITCHME.html public/index.html + artifacts: + paths: + - public + dependencies: + - slide_gen diff --git a/Makefile b/Makefile index 6fdcc8607a4a2c78f32042028580a074aecc9cd3..bd8ed5dc05d684f36f1924b08597082110b47377 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ open_all: # Open all projects files ${EDITOR} .gitignore .gitlab-ci.yml Makefile README.md requirements.txt requirements-dev.txt setup.cfg ${EDITOR} .git/hooks/p*-commit ${EDITOR} cli/*.py + ${EDITOR} docs/*.md pre_commit: # Run the pre-commit hook .git/hooks/pre-commit diff --git a/README.md b/README.md index dc196be9ffb757b36e1d2364b491ea830029a690..6eecc66dcd54f79e9ef0eaca2ea2a8bd9807b97b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ A python CLI to share data related to physical activities over an API (geo-local These are imagined with _[Strava](https://developers.strava.com/docs/reference/) in mind_, but any other service will be nice too : * [x] [Create activity](https://lab.frogg.it/fcode/geostrapy/-/issues/1) -* [ ] From a GPX track: [get characteristics](https://lab.frogg.it/fcode/geostrapy/-/issues/2) +* [x] From a GPX track: [get characteristics](https://lab.frogg.it/fcode/geostrapy/-/issues/2) * [ ] and [create an activity](https://lab.frogg.it/fcode/geostrapy/-/issues/3) * Sanitize a GPX track: * [ ] [crop start, end & stop points](https://lab.frogg.it/fcode/geostrapy/-/issues/4) @@ -67,3 +67,7 @@ Details in [`requirements.txt`](requirements.txt) & [`requirements-dev.txt`](req - Roadmap âž¡ï¸ [_project kanban_](https://lab.frogg.it/fcode/geostrapy/-/boards) - Question, suggestion, issue âž¡ï¸ [_project issues_](https://lab.frogg.it/fcode/geostrapy/-/issues/new) - Code submission âž¡ï¸ [_project merge request_](https://lab.frogg.it/fcode/geostrapy/-/merge_requests/new) + +###Â â„¹ï¸ Talk about this project + +- [AFPy 2022/03](https://www.meetup.com/Python-AFPY-Lyon/events/282750718/): #12 & !7 diff --git a/docs/PITCHME.md b/docs/PITCHME.md new file mode 100644 index 0000000000000000000000000000000000000000..a3c4f43de05ce108cb9d908e955285bba374819b --- /dev/null +++ b/docs/PITCHME.md @@ -0,0 +1,212 @@ +<!-- theme: uncover --> + +# Histoires d'un sportif perfectionniste sous pression + +_31 mars 2022 - Frédéric Zind - AFPy Lyon_ + + + +--- + +Comment garder le contrôle sur les données que je partage avec des services en ligne? + +      + +--- + +# 👨 Qui suis-je ? + +* 🔧 2000: technicien en mécanique +* ðŸ 2018: apprenti charmeur de serpent +* 🧰 2019: dev django +* ðŸš‘ï¸ 2020: Soigneur de _pool_ ZFS (sys admin) + +--- + +# âš ï¸ Avertissement âš ï¸ + +Projet expérimental en cours de développement + +* …mais je le présente quand même 😜 + +--- + +# 💡 L'idée  + +* Données personnelles 🛂 +* Carnet d'entraînement 📈 +* Covid 😷 + +--- + +# 🌠GNSS + +* _Global Navigation Satellite System_ +* Géolocalisation et Navigation par un Système de Satellites + +--- + +# 🌠GNSS + +GPS / GLONASS / Beidou / Compass / Galileo / IRNS / SQZSS +* 🇺🇸 GPS +* 🇷🇺 GLONASS +* 🇨🇳 Beidou +* 🇨🇳 Compass +* 🇪🇺 Galileo +* 🇮🇳 IRNS +* 🇯🇵 SQZSS + +--- + +# 🌠GPS + +# ðŸ›°ï¸ / 🕑 / 📠+ + + +--- + +# 📠GPX + +```xml +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="byHand" version="1.1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"> + + <wpt lat="39.921055008" lon="3.054223107"> + <ele>12.863281</ele> + <time>2005-05-16T11:49:06Z</time> + <name>Cala Sant Vicenç - Mallorca</name> + <sym>City</sym> + </wpt> +</gpx> +``` + +--- + +# 📠GPX + +* GPS eXchange Format +* basé sur XML +* format ouvert +* _waypoints_, _routes_ et _tracks_ +* www.topografix.com/gpx.asp + +--- + +# 🛂 Données personnelles + +* Directes + - géolocalisés: Où, quand, combien de temps, vitesse, etc. + - santé: fréquence cardiaque, cadence de pédalage + - sociale: avec qui? +* Indirectes + - heure de connexion (ponctuelle / en direct) + - habitude d'entrainemen/déplacement + - lieu(x) d'habitation(s) + +--- + +✨ Fonctionnalités + +* Créer un activité +* Calculer les caractéristiques d'un fichier GPX + * s'en servir pour créer une activité +* _Nettoyer_ une trace GPX, avant de l'envoyer + * supprimer début / fin /arrêt(s) + * changer l'heure de départ +* Traiter des lots de fichier + +--- + +# Talk is cheap. Show me the code. + +https://lab.frogg.it/fcode/geostrapy + +--- + + +# ðŸ Les dépendances + +* [`gpxpy`](https://github.com/tkrajina/gpxpy/#readme) : traitement donnée GPX + * `lxml` / `minidom` + * `unittest` +* [`strava-cli`](https://github.com/bwilczynski/strava-cli#readme) : Une CLI pour l'API Strava + * `requests` + * `click` + * pas de tests 😱 + +--- + +# 🌳 Organisation du code + + +``` +user@laptop ~/git/geostrapy % tree +. +├── cli +│  ├── api.py +│  ├── commands.py +│  ├── gpx.py +│  └── main.py +├── docs +│  └── PITCHME.md +├── Makefile +├── README.md +├── requirements-dev.txt +├── requirements.txt +└── setup.cfg +``` + +--- + +# 🤠Collaborer + +* 🔧 `Makefile` +* 🪠Les _hook_ `git` + +--- + +# 🔧 `Makefile` + +``` +user@laptop ~/git/geostrapy % make help +help Print help on Makefile +open_all Open all projects files +pre_commit Run the pre-commit hook +clean Remove files not tracked in source control +lint Lint code +``` + +--- + +# 🪠Les _hook_ `git` + +```bash +user@laptop ~/git/geostrapy % cat .git/hooks/pre-commit +make --no-print-directory lint +``` + +--- + +# 🪠Les _hook_ `git` + +```bash +user@laptop ~/git/geostrapy % git ci +~/.venvs/geostrapy/bin/black --check --quiet cli/*.py +~/.venvs/geostrapy/bin/flake8 --config=setup.cfg +~/.venvs/geostrapy/bin/pydocstyle +~/.venvs/geostrapy/bin/pylint --rcfile=setup.cfg cli/*.py +[pitchme a8eecca] 🚧 WIP: Fix page skip missing + 1 file changed, 3 insertions(+) +``` + +--- + +# â‰ï¸ Questions , remarques, réclamations, etc. + + + +http://pro.zind.fr diff --git a/docs/img/afpylyon-200.png b/docs/img/afpylyon-200.png new file mode 100644 index 0000000000000000000000000000000000000000..67dce750a49de064ec2e8ed2ff22dc18979a26a3 Binary files /dev/null and b/docs/img/afpylyon-200.png differ diff --git a/docs/img/click.png b/docs/img/click.png new file mode 100644 index 0000000000000000000000000000000000000000..f3a2cddb8605cfb58577d502df1cb9574363c9b8 Binary files /dev/null and b/docs/img/click.png differ diff --git a/docs/img/constellation_gps.gif b/docs/img/constellation_gps.gif new file mode 100644 index 0000000000000000000000000000000000000000..f2e4f01716f21862dfd81481671a8d5dfb75875d Binary files /dev/null and b/docs/img/constellation_gps.gif differ diff --git a/docs/img/froggit-128.png b/docs/img/froggit-128.png new file mode 100644 index 0000000000000000000000000000000000000000..434742cc487f71ed022792590809e54c4002e127 Binary files /dev/null and b/docs/img/froggit-128.png differ diff --git a/docs/img/git.png b/docs/img/git.png new file mode 100644 index 0000000000000000000000000000000000000000..75ed794defc8227b54384615c7eedaf6d7b311fe Binary files /dev/null and b/docs/img/git.png differ diff --git a/docs/img/gitlab.png b/docs/img/gitlab.png new file mode 100644 index 0000000000000000000000000000000000000000..022c8b581e4865c42948748296d5d8252511ba1f Binary files /dev/null and b/docs/img/gitlab.png differ diff --git a/docs/img/gpx.png b/docs/img/gpx.png new file mode 100644 index 0000000000000000000000000000000000000000..0879cc47ba942da805907d3c9ea00f649680d6cd Binary files /dev/null and b/docs/img/gpx.png differ diff --git a/docs/img/python.png b/docs/img/python.png new file mode 100644 index 0000000000000000000000000000000000000000..478aa38acdcb9494976aadd3b118a823f2c6e37b Binary files /dev/null and b/docs/img/python.png differ diff --git a/docs/img/qrcode-pro.zind.fr.png b/docs/img/qrcode-pro.zind.fr.png new file mode 100644 index 0000000000000000000000000000000000000000..9b543b7ae6732b2c85845e805ca1d7a4ffebd4b4 Binary files /dev/null and b/docs/img/qrcode-pro.zind.fr.png differ