Access folder in python prediction endpoint code

RohitRanga
Level 3
Access folder in python prediction endpoint code

I am implementing a custom python prediction endpoint. Here I need to access a folder which contains some files and folders inside it. Any advice for how this can be done? I am not able to use a managed folder since I have a folder (and not a single file) to upload . Thanks!

0 Kudos
2 Replies
dgraham
Dataiker

Hi @RohitRanga ,

You could add the managed folder(s) to the API endpoint (under "Settings" > "Working folder"). In doing so, the contents of the folder will be automatically bundled with the API service and copied over to the local file system where the API service runs when the service is deployed. The folder(s) and its contents can be accessed in your Python code as described in the following documentation article: https://doc.dataiku.com/dss/latest/apinode/endpoint-python-function.html#using-managed-folders

0 Kudos
RohitRanga
Level 3
Author

Thanks @dgraham! I will check this out

0 Kudos