Created
January 29, 2022 14:19
-
-
Save CognitiveDave/5df2e533bd87af2f55726192dac89eea to your computer and use it in GitHub Desktop.
get data from file
This file contains 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
def get_data_from_given_path(file_name: pycamunda.variable.Variable) -> typing.Dict[str, str]: | |
textback= p.from_file(file_name.value) | |
text = textback["content"].strip() | |
print(file_name) | |
if len(text) < 4000: | |
return {'text': text} | |
else: | |
return {'text': text[0:3800]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment