Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects

Histoires d'un sportif perfectionniste sous pression

31 mars 2022 - Frédéric Zind - AFPy Lyon

logo AFPy Lyon


Comment garder le contrôle sur les données que je partage avec des services en ligne?

python logo froggit logo gitlab logo git logo GPX logo click logo


:man: Qui suis-je ?

  • :wrench: 2000: technicien en mécanique
  • :snake: 2018: apprenti charmeur de serpent
  • :toolbox: 2019: dev django
  • 🚑️ 2020: Soigneur de pool ZFS (sys admin)

:warning: Avertissement :warning:

Projet expérimental en cours de développement

  • …mais je le présente quand même :stuck_out_tongue_winking_eye:

:bulb: L'idée 

  • Données personnelles :passport_control:
  • Carnet d'entraînement :chart_with_upwards_trend:
  • Covid :mask:

:globe_with_meridians: GNSS

  • Global Navigation Satellite System
  • Géolocalisation et Navigation par un Système de Satellites

:globe_with_meridians: GNSS

GPS / GLONASS / Beidou / Compass / Galileo / IRNS / SQZSS

  • :flag_us: GPS
  • :flag_ru: GLONASS
  • :flag_cn: Beidou
  • :flag_cn: Compass
  • :flag_eu: Galileo
  • :flag_in: IRNS
  • :flag_jp: SQZSS

:earth_africa: GPS

:satellite_orbital: / :clock2: / :triangular_ruler:

constellation satellites GPS


:file_folder: GPX

<?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>

:file_folder: GPX


:passport_control: 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)

:sparkles: 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


:snake: Les dépendances

  • gpxpy : traitement donnée GPX
    • lxml / minidom
    • unittest
  • strava-cli : Une CLI pour l'API Strava
    • requests
    • click
    • pas de tests :scream:

:deciduous_tree: 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

:handshake: Collaborer

  • :wrench: Makefile
  • :hook: Les hook git

:wrench: 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

:hook: Les hook git

user@laptop ~/git/geostrapy % cat .git/hooks/pre-commit
make --no-print-directory lint

:hook: Les hook git

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(+)

:interrobang: Questions , remarques, réclamations, etc.

QRcode

http://pro.zind.fr