Created
December 4, 2019 04:42
-
-
Save rbotzer/2bdda915bd06e7ac6510b08fd2fa4168 to your computer and use it in GitHub Desktop.
One year of data for one sensor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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