Skip to main content

Python packages for Sensor Thing API with request `https`

Project description

Python POC implementing standard for STA OGC API for real python

License: CC BY-NC 4.0 Python Static Badge OGC WPS

Constate

This programme is an interface like :

┌───────────────┐    ┌...........┐    ┌───────────────┐
│ Client Python │──────▶  HTTP  ─────▶│ Serveur   STA │
└───────────────┘    └...........┘    └───────────────┘
       ▲                                    │
       └────────────────────────────────────┘
                Give back data

Usage:

from py_sta.model_sta import ModelSTA

url_sta = "http://.../v1.1/"

service = ModelSTA(url_sta)
# return pure dict object
model = (
        service.observations()
        .top(5)
        .count()
        .expand("FeatureOfInterest($select=@iot.id,name,feature)")
        .order_by("phenomenonTime asc")
        .execute()
       )

result = [elem for elem in model["value"] ]
df_data = pandas.DataFrame(result)[["@iot.id","phenomenonTime","result"]]
# out 
   @iot.id        phenomenonTime  result
0    47091  2025-02-09T15:10:00Z   515.0
1    47203  2025-02-09T15:10:00Z  1941.0
2    47092  2025-02-09T15:20:00Z   516.0
3    47204  2025-02-09T15:20:00Z  1950.0
4    47093  2025-02-09T15:30:00Z   516.0

Print info

>>> service.info()
╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮
🌐 URL: https://data.geoscience.fr/api/stapi/surfacewater/insitu/v1.1/
      📅 Date min: 2025-02-09 15:10:00

      📅 Date max: 2025-08-11 15:15:00
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯

                            Route:
╭─────────────────────┬──────────────────────────────────────────────╮
 Name                 endpoint                                     
├─────────────────────┼──────────────────────────────────────────────┤
 Datastreams          surfacewater/insitu/v1.1/Datastreams         
 FeaturesOfInterest   surfacewater/insitu/v1.1/FeaturesOfInterest  
 HistoricalLocations  surfacewater/insitu/v1.1/HistoricalLocations 
 Locations            surfacewater/insitu/v1.1/Locations           
 Observations         surfacewater/insitu/v1.1/Observations        
 ObservedProperties   surfacewater/insitu/v1.1/ObservedProperties  
 Sensors              surfacewater/insitu/v1.1/Sensors             
 Things               surfacewater/insitu/v1.1/Things              
╰─────────────────────┴──────────────────────────────────────────────╯

Next step

  • TODO

Credit

[!IMPORTANT] Auteur : Théo BERGUIG

No commercial, using code, contribute of code for projet AND add cite this project.

Date : 05/06/2026

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

py_sensor_things-0.1.1.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

py_sensor_things-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file py_sensor_things-0.1.1.tar.gz.

File metadata

  • Download URL: py_sensor_things-0.1.1.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for py_sensor_things-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3e9239b81cd3c94f67eae0f2370a93f554f8fae37917097d5f439f731d8fd423
MD5 b755d41969b7cc1d855c8b40187b2130
BLAKE2b-256 2149cf384f176e2c3266977f84226a15ac55e7761db2de5cbcb59e5414086109

See more details on using hashes here.

File details

Details for the file py_sensor_things-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for py_sensor_things-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09a83d172bdab40111c8a3c87812ac345265edd7cad37ecc77d2f3acec699a8c
MD5 849081b2d38d401089864c8c714dac31
BLAKE2b-256 c1ca1943fac9b7aac91308e752dc4779eeb5cd42149b53b37ac65016a22febad

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