diff --git a/ramp/__init__.py b/ramp/__init__.py index 3f23af7e..8cfc59ca 100644 --- a/ramp/__init__.py +++ b/ramp/__init__.py @@ -19,6 +19,7 @@ from ramp.core.utils import yearly_pattern, get_day_type from ramp.example.examples import load_data, download_example from ramp.post_process.post_process import Plot +from ramp.ramp_convert_old_input_files import convert_old_user_input_file as ramp_py2xlsx __authors__ = "Listed in AUTHORS" __copyright__ = ( diff --git a/ramp/ramp_convert_old_input_files.py b/ramp/ramp_convert_old_input_files.py index 747e30e8..9fc1355a 100644 --- a/ramp/ramp_convert_old_input_files.py +++ b/ramp/ramp_convert_old_input_files.py @@ -8,7 +8,7 @@ parser = argparse.ArgumentParser( prog="python ramp_convert_old_input_files.py", - description="Convert old python input files to xlsx ones", + description="Convert RAMP python input files to xlsx ones", ) parser.add_argument( "-i", @@ -88,7 +88,7 @@ def convert_old_user_input_file( UseCase(users=user_list).save(output_fname) -if __name__ == "__main__": +def cli(): args = vars(parser.parse_args()) fname = args["fname_path"] output_path = args.get("output_path") @@ -105,3 +105,6 @@ def convert_old_user_input_file( ) else: convert_old_user_input_file(fname, output_path=output_path, suffix=suffix) + +if __name__ == "__main__": + cli() diff --git a/setup.py b/setup.py index 81211ae9..6509f650 100644 --- a/setup.py +++ b/setup.py @@ -39,6 +39,7 @@ entry_points={ "console_scripts": [ "ramp=ramp.cli:main", + "ramp_convert=ramp.ramp_convert_old_input_files:cli", ], }, )