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.0.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.0-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pygroundedweb-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 99524c17eb2816465fc8dcd3088da6a365cb63ca056cc323c07c8899141af931
MD5 fe0f06449f4de622aaac02ff681f2071
BLAKE2b-256 19e6c8f4edee9a59072629239fe25daf182da267eb613895b1742dfbb175b7a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygroundedweb-1.0.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: pygroundedweb-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f2d6a5de1b5b4cd4fc55b75e97a379d1051d96aaa5e13bf541530ecc75cb13d
MD5 e8c76f54c465e0a57ea97a710c9b206e
BLAKE2b-256 e4ec2e9183508a99b523d84fb23a3c1c0aaddbc294fa26c9ea7a7830f29601d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygroundedweb-1.0.0-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