Skip to content

Instantly share code, notes, and snippets.

@rbotzer
Created December 4, 2019 04:42
Show Gist options
  • Save rbotzer/2bdda915bd06e7ac6510b08fd2fa4168 to your computer and use it in GitHub Desktop.
Save rbotzer/2bdda915bd06e7ac6510b08fd2fa4168 to your computer and use it in GitHub Desktop.
One year of data for one sensor
print("\nGet a year's data for sensor{}".format(sensor_id))
if options.interactive:
pause()
dt = datetime.datetime(2018, 1, 1, 0, 0, 0)
keys = []
for i in range(1, 366):
keys.append((namespace, set,"sensor{}-{:02d}-{:02d}".format(sensor_id, dt.month, dt.day)))
dt = dt + timedelta(days=1)
sensor_year = client.get_many(keys)
for rec in sensor_year:
k, _, b = rec
print(k[2])
pp.pprint(b["t"])
print(spacer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment