I am using Python Click to generate a json file. However, I need to maintain the case-sensitivity of keys. Python Click converts all keys into lower case implicitly and hence my generated json has lower case keys, not the one I like.
Example code is below
@click.option('--tempId', default=None, help='tempId')
In the above example, tempId is converted into tempid. Is there way to handle this? I am aware that values can be converted to lower or upper, but my requirement is to main the Key case as such.
This seems to work for me:
@cli.command('test')
@click.option('--tempId', '--tempId', 'tempId', default=None, help='tempId')
def test(tempId):
print(tempId)
where if I invoke it with --tempId
it finds the key, but if I invoke it with --tempid
it doesn't.