nrgpy.api.convert module#
- class nrgpy.api.convert.nrg_api_convert(rld_dir='', out_dir='', filename='', site_filter='', filter2='', start_date='1970-01-01', end_date='2150-12-31', client_id='', client_secret='', encryption_pass='', header_type='standard', nec_file='', export_type='meas', export_format='csv_zipped', progress_bar=True, **kwargs)[source]#
Bases:
nrg_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://services.nrgsystems.com/
- Parameters:
- 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
- tokenstr
deprecated, for beta conversion service users
- encryption_passstr, optional
password for rld files (set in logger)
- header_typestr
[standard], columnonly, or none
- nec_filestr, optional
path to NEC file for custom export formatting
- export_typestr
[meas], samples, diag, comm
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 = "contact support@nrgsystems.com for access" >>> client_secret = "contact support@nrgsystems.com for access" >>> converter = nrgpy.nrg_api_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 = "contact support@nrgsystems.com for access" >>> client_secret = "contact support@nrgsystems.com for access" >>> converter = nrgpy.nrg_api_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()