0

This is a more general question pertaining to a business need.

At my company many requests come through that require an analyst to run a mini "code snippet". These code snippets could be in SQL, Python, R, or a combination of the languages.

The code is often extremely simple (<30 lines) and either doesn't change or changes minimally from request to request (i.e. the "where" statement of a SQL query might change).

I am wondering what the best way is to give a "non-tech" interface to the users where they can run these code snippets while maintaining version control on my side?

Potential problems I've thought of:

  1. I want to ensure that the users don't have direct access to the code as they could easily break it.
  2. Additionally, if there was some way to version control the software that would be ideal as well. I'd rather that an update to Pandas (Python) or any other software/module not break all the scripts. I don't know how this is possible.
  3. The users have no tech background so running code from the command line, anaconda prompt, git bash or any other cmd like interface is probably not an option.

In our department our operation team is split into analysts and project managers. The analysts role is comprised of the following:

  • Query a data warehouse to pull data for the project managers. These requests are things like "how many patients has {x} doctor seen in the past year?". These requests are generally small (<20 lines of SQL code) as well as being repeated (the project manager asks for the same query to be run multiple times a week). Once the data warehouse has been queried, the analyst pulls the resulting table into an Excel and sends over to the project manager.
  • Write and run python scripts to automate small, standard processes. For example, the project managers receive standardized XML files that have physician information in them. The project manager will send the XML file over to the analyst, who will run the Python script to extract the data, and send the resulting Excel back over to the project manager.

The question: In the process outlined above, because the project manager is not running either the SQL code (point 1) or the Python script (point 2), the project manager has to email the analyst (which wastes time) and make a request.

Ideal Scenario: For the standard requests (where code has already been written, and does not change) I would like to give the project managers the ability to directly run the code themselves rather than having to reach out to the analysts. This will save time and allow the analysts to work on more meaningful projects. Since the project managers do not have a technology background things like the command line or an IDE are too intimidating, so we are searching for a different solution.

Please let me know if anything is confusing, thank you!

  • What happens after they run the code? Why do they do this? For what purpose?Do they just have to run the code that the request specifies or would they have to edit the code snippet? – RobbyReindeer Aug 30 '18 at 9:05
  • Let me give an example. User receives an XML file that has data within. User needs to extract data and place into a tabular structure. I have written a Python script that accomplishes this task. The user receives a similar XML every month that requires me to run the exact same Python script. I would like to give this functionality to the user, while maintaining the ability to update the script on my side if necessary. Does that make sense? – Arjun Arun Aug 30 '18 at 17:50
  • User receives an XML file that has data within. User needs to extract data and place into a tabular structure. I have written a Python script that accomplishes this task. If you've written script that completes this task then why does the user have to do anything at all? Sorry maybe I misunderstood. – RobbyReindeer Aug 31 '18 at 6:42
  • No worries; currently the user has to email me the required data and I have to run the script and send back the output. I would like the functionality of my Python script to be available to the user. This would be faster than our current process; as if I am very busy sometimes users have to wait a day or two just for me to run a script. – Arjun Arun Sep 4 '18 at 14:53
  • 1
    It is not clear to me what you are asking for. Surely version control systems exist and work, and their integration is a technical issue, not a usability concern. If your users have not technical background, a simple solution is to give them a button for each snippet (simplified). So what is your actual question? Please describe the business in a little more detail (e.g., who does the minimal changes?), and try to focus on the design question - that works best if you prepare a design which illustrates the problem. – virtualnobi Sep 5 '18 at 7:01
1

Look into using ipython (jupytr) notebooks. These are presented to a user as a webpage, with the code already entered, and all they have to do is hit a "run" button.

You can customise the ui to some extent, and it will allow users to modify the code locally in their instance if they want, without causing nightmares for your version controlled master files.

If you have any familiarity with anaconda, you'll find that jupyter has been installed locally already. So you should be able to get going quickly.

  • I have some experience with Anaconda and frequently work in Jupyter notebooks myself. Do you know if the user has to download anaconda and/or Jupyter as well? Additionally, is there a way to modify the UI enough that the user actually doesn't have access to any of the code? – Arjun Arun Sep 5 '18 at 17:55
  • nope. It all runs on the server. They just need a web browser pointed to the right place. As for modifying the UI, one of the types that you can put into the blocks is markdown. You might be able to get away with having a markdown section at the top explaining that the next paragraph is "for the computer" and not intended to be read. – Racheet Sep 5 '18 at 17:55
  • Thank you so much for your help! I will mark your answer as the solution. One last question: When you say they need a web browser pointed to the right place, I'm assuming this could be over an intranet or the internet? The users might be working with protected data that shouldn't be transmitted over an non-secure internet connection. Do you have any thoughts or materials I can study on getting the users to point their web browser at a secure location? – Arjun Arun Sep 5 '18 at 18:01
  • You'd just have to host the server somewhere that supported whatever level of access control you needed. Ideally it would stay on an intranet. The user would just have to type a url into their browser (or follow a link in an email, etc). From the user's point of view, this is just a web page. From your point of view, it's a server presenting a web page as the interface. The problem isn't "how do I secure my custom data", its "how do I secure a web page", which is a problem with standard solutions (use ssl, put it behind a login or on an intranet etc). – Racheet Sep 5 '18 at 18:04
  • Got it; so as long as we're hosting the server on the intranet, the security is not a an issue as we're already behind the company firewall. Thanks so much for your help! – Arjun Arun Sep 5 '18 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.