Skip to content

Instantly share code, notes, and snippets.

@CognitiveDave
Created January 29, 2022 14:19
Show Gist options
  • Save CognitiveDave/5df2e533bd87af2f55726192dac89eea to your computer and use it in GitHub Desktop.
Save CognitiveDave/5df2e533bd87af2f55726192dac89eea to your computer and use it in GitHub Desktop.
get data from file
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