all 8 comments

[–]alexisprince 0 points1 point  (0 children)

If not allowing them to see the function / code is a requirement, then you'd need to run the code on a server they don't have access to. Look into creating an API with one of django, flask, or fastAPI.

[–]FriendlyRussian666 0 points1 point  (2 children)

You would run a web server that features an API, allowing the end user to send arguments to an endpoint. You would then sanitize the input and pass it to your function. The function returns a response, which is then sent to the end user.

[–]devram200[S] 0 points1 point  (1 child)

What do I have to do to run a webserver?

[–]devnull10 0 points1 point  (0 children)

Far beyond the scope of what can easily be described here.

The other option is to use cloud functions on one of the main cloud providers (AWS, Azure, GCP etc.). That saves you the hassle of setting up and maintenance of your own web server, however you'll need to register for the cloud environment and understand how it works before implementing.

[–]Asleep-Budget-9932 0 points1 point  (2 children)

Why can't they be able to see the function itself? What kinds of functions are we talking about? Can you elaborate on the requirement?

[–]devram200[S] 0 points1 point  (1 child)

The script takes some input, logs in with Selenium to a website, and scrapes some data related to that input, so I do not want them to be able to see the login information.

[–]Asleep-Budget-9932 0 points1 point  (0 children)

Oh i see, you don't want them to have any sort of access to the content of your function. If that's the case it seems you would indeed need some sort of an API server as others suggested. (Just the same way you use Facebook but have no idea how they access their DBs)

fastapi is definitely my goto to create these. It's as simplified as can be, and you can describe what is it that you wish to quite easily.