Update argument handling in PDBList.py, possibly by creating a new module.
The command-line interface for the PDBList.py module is quite clunky, using a series of complicated ifs and sys.argv calls to parse input from the user. It would be super nicer to simply use argparse, although this will break compatibility with previous versions.
The solution here might pass through copying the code to a new module and along with other issues (#3988, #3987) upgrade PDBList.py and break backwards compability. We could then slap a deprecation warning on PDBList to warn users to move to the new code.
Can you please assign me this issue
@RUCHI21CODES No, there are already people working on this with open pull requests. If you can spot improvements or otherwise usefully comment on those PRs, that could be helpful.
pdblist_args.py
import argparse
def parse_args(): parser = argparse.ArgumentParser(description='PDB List arguments') parser.add_argument('-i', '--input_file', help='Input file path', required=True) parser.add_argument('-o', '--output_file', help='Output file path', required=True) parser.add_argument('-v', '--verbose', help='Verbose mode', action='store_true') return parser.parse_args()
PDBList.py
import pdblist_args
def main(): args = pdblist_args.parse_args() # Use the parsed arguments here print(f'Input file: {args.input_file}') print(f'Output file: {args.output_file}') if args.verbose: print('Verbose mode enabled')
if name == 'main': main()
@JoaoRodrigues I have made a contribution you can see it if u want