0

I am using a library that has a function like the below, where it expects a file location. The thing is, I store the content of this file in AWS so I can just use AWS api to securely return values I have stored in that resource as a string. How can I transform this string value to be able to pass in a function that is looking for file path - without actually just writing the string values to the local directory as .txt for json file? (I know I can convert the string to a json object but not certain as to how this solves the fact this function is looking for a path) function below:

file_location = 'String values I get returned when I return it from its safe and secure location'

password = credential_function.from_kefile_name(file_location)
0004
  • 1,156
  • 1
  • 14
  • 49
  • 2
    Have a look: https://stackoverflow.com/questions/44672524/how-to-create-in-memory-file-object – PM 77-1 Feb 03 '21 at 00:40
  • @PM77-1 - thank you, when using the io.stringIO (similar to what is referenced above) I am getting TypeError: expected str, bytes or os.PathLike object, not _io.StringIO – 0004 Feb 03 '21 at 01:36
  • @PM77-1 I have variable = 'string' output = io.StringIO() output.write(variable) FILE_LOCATION = output.seek(0) And it is not working? – 0004 Feb 03 '21 at 02:47

0 Answers0