Created
January 13, 2020 10:13
-
-
Save stevenklar/b6543554cd867993ec834e41032c9400 to your computer and use it in GitHub Desktop.
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
| from flatten_json import flatten | |
| import json | |
| print("> Open File") | |
| file = open("FILEPATH","r") | |
| print("> Print File") | |
| data = file.read() | |
| print("> Load json from file") | |
| translationDict = json.loads(data) | |
| print("> Flatten") | |
| flattenedData = flatten(translationDict, '.') | |
| maxLength = 0 | |
| for data in flattenedData: | |
| dataLen = len(data) | |
| if maxLength < dataLen: | |
| # print("%d is bigger than last %d" % (dataLen, maxLength)) | |
| maxLength = dataLen | |
| else: | |
| # print("%d is less than last %d" % (dataLen, maxLength)) | |
| print(maxLength) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment