This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
""" | |
This is NOT extensive in any way -- just something quick and dirty. | |
""" | |
def lowercase_keys(original, in_lists=False): | |
if in_lists and isinstance(original, list): | |
new_list = [] | |
for item in original: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
""" | |
This is NOT extensive in any way -- just something quick and dirty. It doesn't handle all datatypes -- use at your own risk. | |
""" | |
def lowercase(original): | |
if isinstance(original, str): | |
return original.lower() | |
elif isinstance(original, list): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
# Convert this to a b64 string: | |
some_str = "Some string..." | |
b64string = base64.b64encode(some_str.encode("utf-8")).decode("utf-8") | |
# ^^ Without this, it's a byte array. | |
# /nomorehairpulling |
NewerOlder