Bibliothèque et CLI Python pour récupérer des informations météo et des données de prévision.
Project description
meteocast
meteocast est une bibliothèque et une CLI Python pour récupérer des informations météo et des données de prévision.
- 🖥️ CLI : consultez la météo depuis votre terminal.
- 🐍 Bibliothèque : intégrez la récupération de données dans votre code Python.
ℹ️ État du projet : le squelette (CLI Typer, client httpx, packaging, distribution) est en place. Le branchement à une API météo réelle (Open-Meteo, etc.) n'est pas encore implémenté — les commandes sortent proprement en attendant.
Utiliser la CLI
Depuis PyPI
Le plus simple, sans rien installer de permanent, avec uv :
uvx meteocast forecast Lausanne
uvx télécharge meteocast dans un environnement éphémère et l'exécute.
Pour l'installer durablement comme outil isolé :
uv tool install meteocast # via uv
# ou
pipx install meteocast # via pipx
La commande meteocast est alors disponible partout :
$ meteocast --help
Usage: meteocast [OPTIONS] COMMAND [ARGS]...
Récupère des informations météo et des prévisions.
Commands:
current Affiche la météo courante pour une localité.
forecast Affiche la prévision sur plusieurs jours pour une localité.
$ meteocast forecast Lausanne --days 5
Prévision sur 5 jours pour Lausanne
...
Depuis un registre privé JFrog Artifactory
Si meteocast est publié sur votre Artifactory interne, pointez l'installeur vers l'index privé et fournissez vos identifiants :
# uv
uv tool install \
--index "https://<host>/artifactory/api/pypi/<repo>/simple/" \
meteocast
# pipx
pipx install \
--index-url "https://<user>:<token>@<host>/artifactory/api/pypi/<repo>/simple/" \
meteocast
Utiliser la bibliothèque
Depuis PyPI
Ajoutez meteocast à votre projet :
uv add meteocast
# ou
pip install meteocast
Puis, dans votre code :
from meteocast import get_current, get_forecast
# Météo courante
weather = get_current("Lausanne")
print(weather.location, weather.temperature_c, weather.description)
# Prévision sur 5 jours
forecast = get_forecast("Lausanne", days=5)
for day in forecast.daily:
print(day.temperature_c, day.description)
Depuis un registre privé JFrog Artifactory
Décommentez et renseignez le bloc [[tool.uv.index]] dans pyproject.toml :
[[tool.uv.index]]
name = "artifactory"
url = "https://<host>/artifactory/api/pypi/<repo>/simple/"
Exportez les identifiants, puis synchronisez :
export UV_INDEX_ARTIFACTORY_USERNAME="<user>"
export UV_INDEX_ARTIFACTORY_PASSWORD="<token>"
uv add meteocast
Avec pip, sans uv :
pip install \
--extra-index-url "https://<user>:<token>@<host>/artifactory/api/pypi/<repo>/simple/" \
meteocast
L'import Python est ensuite identique à l'exemple ci-dessus.
Développement
Prérequis : uv (Python ≥ 3.11 est installé automatiquement au besoin).
uv sync # crée .venv/ et installe deps + outils de dev
uv run meteocast --help # lance la CLI en local
uv run ruff check . # lint
uv run ruff format . # formatage
uv run pytest # tests
Publier une version
Sur PyPI (automatisé)
La publication est automatique via GitHub Actions
(.github/workflows/release.yml) en Trusted Publishing (OIDC, sans token) :
- Enregistrer le publisher du dépôt sur https://pypi.org/manage/account/publishing/
(nom du projet
meteocast, workflowrelease.yml). - Mettre à jour
__version__danssrc/meteocast/__init__.py. - Taguer et pousser :
git tag v0.1.0 git push origin v0.1.0
Le workflow lint, teste, build (uv build) et publie (uv publish).
Publication manuelle si besoin :
uv build # génère dist/*.whl et dist/*.tar.gz
uv publish # nécessite un token PyPI (UV_PUBLISH_TOKEN)
Sur un registre privé JFrog Artifactory
uv build
uv publish \
--publish-url "https://<host>/artifactory/api/pypi/<repo>/" \
--token "$UV_PUBLISH_TOKEN"
(ou --username <user> --password <token>). Une étape équivalente commentée est
prête dans release.yml pour automatiser cette publication.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meteocast-0.1.0.tar.gz.
File metadata
- Download URL: meteocast-0.1.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aba51f241d0c043144c09df3edef1bd8da5d268665cc3dd4b86a3ce8c5b545e2
|
|
| MD5 |
0c8bc6a084e8d26b750d2d0a216acf65
|
|
| BLAKE2b-256 |
600de56fa746a32b94fda8ce5ce6382e0b78536b96c21ca303d168f4ac4f4507
|
File details
Details for the file meteocast-0.1.0-py3-none-any.whl.
File metadata
- Download URL: meteocast-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5f3db9fe6bad5d948e068d7dbdb2f36eb3e676f15aaee11910e213858aafeb5
|
|
| MD5 |
f958a8d52b10afd79ddba6fb1d2c7273
|
|
| BLAKE2b-256 |
a76491eda78e5ca3d179efe097b7f470d1571a8d54fdba45b53400af98e91e6c
|