[Python] How to maintain case-Sensitive key in Python Click options

Discussão em 'Python' iniciado por Stack, Junho 15, 2025.

  1. Stack

    Stack Membro Participativo

    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.

    Continue reading...

Compartilhe esta Página