nrgpy.convert package#
Submodules#
nrgpy.convert.convert_rld module#
- class nrgpy.convert.convert_rld.local(rld_dir: str = '', out_dir: str = '', encryption_pass: str = '', hex_key: str = '', filename: str = '', sympro_path: str = '"C:/Program Files (x86)/Renewable NRG Systems/SymPRO Desktop/SymPRODesktop.exe"', process_type: str = 'convert', convert_type: str = 'meas', nec: str = '', site_filter: str = '', site_file: str = '', **kwargs)[source]#
Bases:
object
For handling NRG SymphoniePRO Data Logger raw data files in the *.rld format.
This method uses locally installed SymphoniePRO Desktop software to convert *.rld files to txt format (tab-delimited-text).
- Parameters:
- rld_dirstr, optional (path-like)
specify directory. Note for unc values, you will need to escape all forward slashes, e.g. rld_dir = “\networktechsupportdata" or use the r’path odir’ approach
- out_dirstr, optional (path-like)
see note for rld_dir.
- encryption_passstr
specify data encryption password if logger is set up for that.
- hex_keystr
specify if using hex data encryption key
- sympro_pathstr
default is “C:Program Files (x86)Renewable NRG SystemsSymPRO DesktopSymPRODesktop.exe”
- process_typestr
[convert], or import
- convert_typestr
‘meas’, alternately specify ‘comm’, ‘diag’, ‘sample’, or ‘events’
- necstr
path to nec file
- site_filterstr
specify part or all of the file you’d like to filter on, like site_filter=’123456_2018-09’ would filter on site 123456 and only the month of September in 2018.
- site_filebool or str
set to True to use local ndb site file, or set to path to an alternate ndb site file
Examples
Convert a folder of RLD files to Text with SymphoniePRO Desktop Software
>>> from nrgpy.convert_rld import local >>> converter = local( rld_dir='/path/to/rld/files', out_dir=/path/to/txt/outputs, file_filter='123456_2020-01', # for files from January 2020 ) >>> converter.convert()
nrgpy.convert.convert_rwd module#
- class nrgpy.convert.convert_rwd.local(rwd_dir: str = '', out_dir: str = '', filename: str = '', encryption_pin: str = '', sdr_path: str = 'C:/NRG/SymDR/SDR.exe', convert_type: str = 'meas', file_filter: str = '', wine_folder: str = '~/.wine/drive_c/', use_site_file: bool = False, raw_mode: bool = False, progress_bar: bool = True, show_result: bool = True, **kwargs)[source]#
Bases:
object
nrgpy.convert_rwd.local - use local installation of Symphonie Data Retriever (SDR) to convert *.RWD files to *.TXT
- Parameters:
- filenamestr
if populated, a single file is exported
- encryption_pinstr
four digit pin, only used for encrypted files
- sdr_pathstr
r‘“C:/NRG/SymDR/SDR.exe”’, may be any path
- file_filterstr
filters files on text in filename
- rwd_dirstr (path-like)
folder to check for RWD files
- out_dirstr (path-like)
folder to save exported TXT files into
- wine_folderstr
‘~/.wine/drive_c/’, for linux installations
- use_site_filebool
set to True to use local site file
- raw_modebool
set to True to convert raw counts and voltages
- progress_barbool
set to False to see individual file conversions
- show_resultbool
set to False to hide prints to console
- Returns:
- None
Examples
Convert a folder of RWD files to Text with SymphoniePRO Desktop Software
>>> from nrgpy.convert_rwd import local >>> converter = local( rwd_dir='/path/to/rwd/files', out_dir=/path/to/txt/outputs, file_filter='1234202001', # for files from January 2020 )
>>> converter.convert()
Convert a folder … on Linux; this assumes you followed the instructions in the ‘’’SDR_Linux_README.md’’’ file.
>>> import getpass >>> import nrgpy
>>> username = getpass.getuser()
>>> rwd_dir = f"/home/{username}/data/symplus3/raw" >>> txt_dir = f"/home/{username}/data/symplus3/export" >>> wine_folder = f"/home/{username}/prefix32/drive_c"
>>> converter = nrgpy.convert_rwd.local( rwd_dir=rwd_dir, out_dir=txt_dir, wine_folder=wine_folder )
>>> converter.convert()