sofarocean / sofar-api-client-python

Python Client for Wavefleet
Apache License 2.0
7 stars 5 forks source link

Allow the client to get barometer/pressure data (if available) #20

Closed pieterbartsmit closed 2 years ago

pieterbartsmit commented 2 years ago

This adapts the client to include barometer/pressure data in requests following the patterns already established in the code. Minimum working example (requires access to api and Spotter):

from pysofar.spotter import Spotter

# You will need a valid access token setup for the pysofar library for this to
# work. We refer to the pysofar documentation how to set that up.
spotter = Spotter('SPOT-010149','SPOT-010149')

data = spotter.grab_data(limit=20,start_date='2021-03-22T00:00:00.000Z',end_date='2022-03-23T00:00:00.000Z',
                         include_wind=True,
                         include_barometer_data=True,
                         include_surface_temp_data=True,
                         include_microphone_data=True
                         )

print(data['barometerData'])