import asyncio
import os
import sys


async def main(argv):
    card_dir = input(f'What is the full Windows path to the card directory? ')

    for x in os.listdir(card_dir):
        old_name = f'{card_dir}/{x}'
        new_name = f'{card_dir}/{x.split("[")[0].lower().replace("_","-").replace(" ","-")}.png'
        os.rename(old_name, new_name)

if __name__ == '__main__':
    asyncio.run(main(sys.argv[1:]))
