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
Commit 80a39404 authored by freezed's avatar freezed :mountain:
Browse files

:twisted_rightwards_arrows: Merge branch '12-afpy-talk'

Resolve "AFPy talk"

Closes #12

See merge request fcode/geostrapy!7
parents be0bca62 c94e6b6b
No related branches found
No related tags found
1 merge request!7Resolve "AFPy talk"
Pipeline #4375 passed
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
......@@ -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
......
......@@ -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
<!-- theme: uncover -->
# Histoires d'un sportif perfectionniste sous pression
_31 mars 2022 - Frédéric Zind - AFPy Lyon_
![logo AFPy Lyon](img/afpylyon-200.png)
---
Comment garder le contrôle sur les données que je partage avec des services en ligne?
![python logo](img/python.png) ![froggit logo](img/froggit-128.png) ![gitlab logo](img/gitlab.png) ![git logo](img/git.png) ![GPX logo](img/gpx.png) ![click logo](img/click.png)
---
# 👨 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
# 🛰️ / 🕑 / 📐
![constellation satellites GPS](img/constellation_gps.gif)
---
# 📁 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.
![QRcode](img/qrcode-pro.zind.fr.png)
http://pro.zind.fr
docs/img/afpylyon-200.png

15.3 KiB

docs/img/click.png

6.78 KiB

docs/img/constellation_gps.gif

485 KiB

docs/img/froggit-128.png

15.5 KiB

docs/img/git.png

1.78 KiB

docs/img/gitlab.png

4.84 KiB

docs/img/gpx.png

12.4 KiB

docs/img/python.png

13.3 KiB

docs/img/qrcode-pro.zind.fr.png

504 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment