Skip to main content

Client Python pour interagir avec l'API Pilote (DITP).

Project description

Pylote

Ce code permet d'interroger l'API de Pilote pour exporter et importer des données.

Installation

Installer les dépendences dans un environnement virtuel avec pip install ..

Usage

Exemple d'utilisation:

# [init] Initialisation de l'objet Pylote
pilote = Pylote(environ.get("BASE_URL"), environ.get("API_KEY"))

# [export]
## [export] Export des données de IND-208
donnees_208 = pilote.get_donnees_indicateur("CH-047", "IND-208")

# [export]
## [export] Export des données du chantier CH-080
chantier_080 = pilote.get_donnees_chantier("CH-080")

# [import]
## [import] Import de données d'une liste Python
data_to_import = [
    {"identifiant_indic": "IND-208", "zone_id": "D01", "zone_nom": None, "date_valeur": "2024-07-15", "type_valeur": "va", "valeur": 12.64},
    {"identifiant_indic": "IND-208", "zone_id": "D01", "zone_nom": None, "date_valeur": "2022-12-01", "type_valeur": "vi", "valeur": 11.17},
]
pilote.import_donnees_indicateur_array("CH-047", "IND-208", data_to_import)

# [import] Import de données d'un fichier CSV
pilote.import_donnees_indicateur_file("CH-047", "IND-208", "./data-ind208-import-sample.csv", is_excel=False)

Exemples

Des fichiers d'exemple fonctionnels sont mis à disposition dans le dossier examples. Plus de détails dans README correspondant examples/README.md.

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

pylote-1.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

pylote-1.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file pylote-1.1.0.tar.gz.

File metadata

  • Download URL: pylote-1.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.1

File hashes

Hashes for pylote-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5ded9608b271084e7461bdb876133d7ef6f3927e474fd9af3afe5d2ea8e7433a
MD5 8eccb175c375d1acdb2a0d99efc43dc3
BLAKE2b-256 e5545d2e372f5507fa034188f99a58dcdc2dd1254ab6b3c8a3621a1f938cda29

See more details on using hashes here.

File details

Details for the file pylote-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pylote-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.1

File hashes

Hashes for pylote-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c31bae24b5cb16fa4383f0dc22f04b3666b60bd64f7052044cb5ca50c5cb639
MD5 be837d29cfa24e68fa55dd0de36bb6a4
BLAKE2b-256 c320433651fd9c4104e5ee145b5a78847d92434b84b8de0b6dd1b5852e783fa6

See more details on using hashes here.

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