Skip to content

Commit 2c19ee1

Browse files
committed
Add example for loading data
* Include backup from parquet example
1 parent 4392ccb commit 2c19ee1

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

examples/scripts/get_device_data.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# Set verbose level
88
config.log_level = 'DEBUG'
99

10-
# Device id needs to be as str
1110
device = sc.Device(blueprint='sc_air',
1211
params=sc.APIParams(id=16784))
1312
device.options.min_date = None #Don't trim min_date
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/python
2+
3+
'''
4+
Example to load device data from a parquet backup on AWS
5+
For this example to work, you need to have the following environment variables set:
6+
7+
# S3 bucket
8+
S3_DATA_BUCKET=
9+
S3_PUBLIC_BUCKET=
10+
AWS_ACCESS_KEY_ID=
11+
AWS_SECRET_ACCESS_KEY=
12+
AWS_REGION=
13+
'''
14+
15+
import scdata as sc
16+
device = sc.Device(blueprint='sc_air',
17+
params=sc.APIParams(id=18445))
18+
19+
# Load
20+
device.backup_load()
21+
22+
print (device.json)
23+
print (device.data.describe())

0 commit comments

Comments
 (0)