Many NHS staff, especially those in Trusts, still cannot access Python.
NHS.pycom was created to support NHS colleagues leverage the benefit of Python in their workflows, with a key element being to tackle the barriers to uptake that are hindering innovation and optimisation where it's needed most.
The NHS Python Community Board has put together some guidance to help when you're asking IT departments to install Python on your NHS laptop.
We'll soon be publishing guidance specifically aimed at IT specialists approving these requests.
Why is Python important?
Python is a high-level, open source, interpreted programming language known for its simplicity and readability. It's widely used in various fields like web development, data science, artificial intelligence, and more. The NHS Python Community was founded to promote collaboration, knowledge sharing, and skill development among Python enthusiasts within the National Health Service (NHS) in the UK. Core to widening participation across the NHS is supporting colleagues with access to this tooling.
Who do I need to ask to get Python installed on my provisioned device?
Your path to accessing Python will vary significantly depending on where you work, and what you are using it for. In the majority of cases, your local IT team will be the first people to ask around how you can get access to a coding language like Python on your device. It is not uncommon for this request to be the first time that IT teams may have encountered Python, as such, it may be necessary to provide further evidence around why you require a Python installation (See 3. What evidence can I reference to support my request?) or may require specifics around exactly what you want installed (See 4. Versions, package management and IDEs).
What evidence can I reference to support my request?
The Goldacre review makes specific reference to the need to update IT policies to enable the use of Python e.g.: “NHSA 23. Revise NHS IT policy for analysts to ensure it is fit for purpose. Analysts need to be able to use modern computational data science tools such as python, GitHub and docker on their NHS computers.”
Consider your specific use case holistically: Will you be accessing internal or external data? Is the data confidential? Does your proposed means of access adhere to information governance requirements? Do you have access to an SRE (Secure Research Environment), SDE (Secure Data Environment) or TRE (Trusted Research Environment) which may be the preferred option to working locally?
Versions, package management and IDEs
What version should I ask for? Python is frequently updated and your version of Python will have an important impact on how reusable your code is. A rule of thumb is to try to use the most recent security release of Python e.g. Python 3.12 at the time of writing.
What about packages? Beyond the core functionality of Python, there are a plethora of third-party packages available to complete your tasks. Many of these are hosted on the Python Package Index (PyPI) and together with your IT team you will need to evaluate whether it is appropriate to have full access to PyPI for obtaining and updating packages, or if there needs to be an alternative way to approve installation and update of packages.
What Python libraries are commonly used in healthcare applications?
Note: this list is not exhaustive
Pandas for data manipulation.
PySpark for analysing very large datasets.
NumPy for numerical operations.
SciPy for scientific computing.
Matplotlib/Seaborn for data visualisation.
Scikit-learn for machine learning.
TensorFlow/Keras/PyTorch for deep learning.
NLTK/spaCy for Natural Language Processing (NLP)
PyMC for Bayesian Statistics
StatsModels for Statistics (such as forecasting)
LangChain for LLMs
PyMedTermino for medical terminology management.
NiBabel for neuroimaging data.
What else might I need to ask for?
Integrated Development Environments (IDEs), such as Visual Studio Code and Atom, can help you manage your code and package dependencies.
Version control is an essential element of good code practice, check if you might have access to GitHub from your work device or it is possible to install git locally.
This is also a good opportunity to ask your IT team around other colleagues using Python in your organisation which can be a helpful way to build a support network as you explore Python.
What are my responsibilities as a Python user?
For more information on how to use python, see the Reproducible Analytical Pipelines (RAP) community of practice.
Do I need a DPIA or DPA to use Python?
Not specifically. Python itself is a general-purpose programming language—much like Excel is a general-purpose spreadsheet tool. The use of Python does not automatically require a Data Protection Impact Assessment (DPIA) or a Data Processing Agreement (DPA). However, the way you use Python and the type of data you process may require one.
If you're using Python to process personal, sensitive, or confidential data, then you must follow your organisation’s information governance (IG) policies. This may include completing a DPIA for the project or ensuring a DPA is in place with any third-party data processors.
You should also consider:
1. Where the data is processed: Are you allowed to use your local machine, or must you work within a secure data environment?
2. The type of data: If you're handling personal or patient data, IG controls will almost certainly apply.
A good rule of thumb: if your organisation permits processing this type of data in Excel, then using Python for similar processing likely raises no additional IG concerns. But always confirm with your local IG or Data Protection team
I want to learn more - where should I go?
Slack channel: Join us on Slack to chat to the community or ask us your questions.
LinkedIn page: Follow our LinkedIn page to be notified about all our future events.
YouTube channel: Show and tells and event recordings
GitHub repository: Fork our repositories on GitHub and use our code.