nrgpy.cloud_api.convert module#
- class nrgpy.cloud_api.convert.CloudConvert(rld_dir: str = '', out_dir: str = '', filename: str = '', site_filter: str = '', filter2: str = '', start_date: str = '1970-01-01', end_date: str = '2150-12-31', client_id: str = '', client_secret: str = '', url_base: str = 'https://cloud-api.nrgsystems.com/nrgcloudcustomerapi/', export_type: str = 'measurements', nec_file: str = '', unzip: bool = True, progress_bar: bool = True, **kwargs)[source]#
Bases:
CloudApi
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.CloudConvert( 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.CloudConvert( 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
- nrgpy.cloud_api.convert.cloud_convert#
alias of
CloudConvert