Skip to main content

SDK Python pour l'API GroundedWeb

Project description

pygroundedweb

Client Python pour l'API Grounded Web.

Ce module fournit une interface orientée objet pour interagir avec l'API Grounded Web, permettant la gestion des datasets, la configuration des outils de photogrammétrie (MicMac, CCTag) et le lancement d'analyses.

Compatibilité

[!IMPORTANT] Cette version de pygroundedweb est strictement liée aux versions de l'API Grounded Web pour garantir la cohérence des schémas de données (Pydantic) et des endpoints API.

PyGroundedWeb API Grounded Web (Backend) Statut
v1.0.x v2.x.x Supporté

Pour vérifier la version de votre instance API, vous pouvez consulter le point d'entrée /api/ de votre api.

Installation

Via pip

pip install pygroundedweb

Depuis les sources

Pour le développement local :

git clone https://github.com/Norman-Francois/pygroundedweb.git
cd pygroundedweb
pip install -e .

Prérequis

  • Python 3.9+
  • requests
  • pydantic >= 2.0

Utilisation

La bibliothèque expose un client principal GroundedWebClient et des modèles de données typés.

Exemple d'utilisation

from pygroundedweb import *

# 1. Initialisation et authentification
client = GroundedWebClient(base_url="http://localhost:8000")
client.login(email="admin@example.com", password="password")

# 2. Récupération d'un dataset existant
dataset = client.dataset.retrieve(1)

# 3. Définition d'une configuration

config = Configuration(
    name="ConfigTest",
    scale_bars= [
        ScaleBar(start=0, end=1, length=.22),
        ScaleBar(start=2, end=3, length=.22),
        ScaleBar(start=4, end=5, length=.22),
        ScaleBar(start=6, end=7, length=.22)],
    detector= CCTag(),
    cloud_processor= CloudCompare(),
    sfm= MicMac(
        distorsion_model=DistortionModel.FRASER_BASIC,
        zoom_final=ZoomFinal.QUICK_MAC,
        tapioca_mode=TapiocaMode.ALL,
        tapioca_resolution=2000,
        tapioca_second_resolution=1000
    )
)

# 4. Lancement de l'analyse (exemple)
analysis = client.analysis.create(
    analysis_name="Analyse 01",
    configuration=config,
    dataset=dataset,
    notify_by_email=True
)

print(f"Analyse créée : ID {analysis.pk} - Statut : {analysis.status}")

# 5. Rafraîchir le statut de l'analyse depuis l'API
analysis.refresh()

# 6. Afficher l'analyse une fois rafraîchie
print(f"Analyse ID {analysis.pk} - Statut actuel : {analysis.status}")

Documentation

La documentation complète est générée avec Sphinx et se trouve dans le dossier docs/.

Pour installer les dépendances nécessaires à la génération de la documentation :

pip install -r requirements.txt

Pour générer la documentation HTML localement :

cd docs
make html
# Le HTML sera généré dans docs/_build/html

Pour un rechargement automatique pendant le développement (optionnel) :

pip install sphinx-autobuild
cd docs
sphinx-autobuild . _build/html

Structure du projet

  • client : Gestion des requêtes HTTP et des endpoints API.
  • models : Définitions Pydantic des objets métier (Analysis, Dataset, Configuration).

Build

Pour générer le fichier wheel (.whl) pour la distribution :

pip install build
python3 -m build

Développeur

Ce projet est développé et maintenu par :

[!TIP] Si vous souhaitez contribuer au projet ou signaler un bug, n'hésitez pas à ouvrir une Issue ou une Pull Request sur le dépôt officiel.

Licence

Ce projet est sous licence GNU GPL v3.

  • Utilisation commerciale : Autorisée.
  • Modification : Autorisée, mais le code source modifié doit être redistribué sous la même licence (GPL v3).
  • Citation : Vous devez créditer l'auteur original et indiquer si des modifications ont été apportées.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygroundedweb-1.0.1.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygroundedweb-1.0.1-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

Details for the file pygroundedweb-1.0.1.tar.gz.

File metadata

  • Download URL: pygroundedweb-1.0.1.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pygroundedweb-1.0.1.tar.gz
Algorithm Hash digest
SHA256 473f196a684d00abd74170b2d0a3894f9900f83d9f3bc02c394bd244fcaff9d1
MD5 6e484da1694abe9cec51f4617d3c5375
BLAKE2b-256 7129ed46e40dfb06fe8655602b2a1c515570788401ebca18f49390cdba80db42

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygroundedweb-1.0.1.tar.gz:

Publisher: publish-pypi.yml on Norman-Francois/pygroundedweb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygroundedweb-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pygroundedweb-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 39.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pygroundedweb-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3719e943e2a64b250a460a560a05d80ee610805b5be897b4c5d2e8c376ffd8d3
MD5 c80bf990dc06cf5b8c43b16dffe18b30
BLAKE2b-256 50c770515fcc6d9cca3705851aec676614447b55d6c10daed46d3418c2738f30

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygroundedweb-1.0.1-py3-none-any.whl:

Publisher: publish-pypi.yml on Norman-Francois/pygroundedweb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page