nrgpy.cloud_api.convert module
nrgpy.cloud_api.convert module#
- class nrgpy.cloud_api.convert.cloud_convert(rld_dir='', out_dir='', filename='', site_filter='', filter2='', start_date='1970-01-01', end_date='2150-12-31', client_id='', client_secret='', export_type='measurements', nec_file='', unzip=True, progress_bar=True, **kwargs)[source]#
Bases:
nrgpy.cloud_api.auth.cloud_api
Uses NRG hosted web-based API to convert RLD and RWD files to text format To sign up for the service, go to https://cloud.nrgsystems.com/.
Note that the site must exist in the NRG Cloud platform, and you must have Contributor or Administrator level access to the site to use these features.
Examples
Convert a single raw data file to Text with NRG Convert API
>>> import nrgpy >>> filename = "/home/user/data/sympro/000123/000123_2019-05-23_19.00_003672.rld >>> client_id = "go to https://cloud.nrgsystems.com/data-manager/api-setup for access" >>> client_secret = "go to https://cloud.nrgsystems.com/data-manager/api-setup for access" >>> converter = nrgpy.cloud_convert( file_filter=file_filter, filename=filename, client_id=client_id, client_secret=client_secret, )
Convert a folder of raw data files to Text with NRG Convert API
>>> import nrgpy >>> file_filter = "000175" >>> rld_directory = "rlds" >>> txt_dir = "/home/user/data/sympro/000123/txt/" >>> client_id = "go to https://cloud.nrgsystems.com/data-manager/api-setup for access" >>> client_secret = "go to https://cloud.nrgsystems.com/data-manager/api-setup for access" >>> converter = nrgpy.cloud_convert( file_filter=file_filter, rld_dir=rld_directory, out_dir=txt_dir, client_id=client_id, client_secret=client_secret, start_date="2020-01-01", end_date="2020-01-31", ) >>> converter.process()
- Attributes
- rld_dirstr (path-like)
path to rld file directory
- out_dirstr (path-like)
path to save text export files
- filenamestr
provide for single file conversion
- site_filterstr, optional
text filter for limiting file set
- filter2str, optional
another text filter…
- start_datestr, optional
text start date to filter on “YYYY-mm-dd”
- end_datestr, optional
text end date to filter on “YYYY-mm-dd”
- client_idstr
provided by NRG Systems
- client_secretstr
provided by NRG Systems
- nec_filestr, optional
path to NEC file for custom export formatting
- export_typestr
[measurements], diagnostic, events, communication
- unzipbool
whether to extract the .txt data file from the .zip file
- session_tokenstr
- headersstr
headers passed in API call
- datastr
data passed in API call
- respstr
API response
- export_filepathstr (path-like)
path of export file