At a glance
By Adam Turner
While accountants already take advantage of tools like Excel, learning a programming language like Python opens up the ability to streamline workflows and better manipulate data in search of deeper insight.
Python is a free and open-source general-purpose programming language, designed to be easy for non-technical people to learn.
Accountants already familiar with creating Excel macros (which uses Visual Basic language) have a good foundation on which to build Python skills.
Python crunches numbers to save time
Any task which involves manually drawing together data from a range of sources is potentially a good candidate for automating with Python, says BDO data scientist Michael Spear.
Apart from Excel spreadsheets, Python can be used to extract data from files, email, databases, cloud storage and business systems like Enterprise Resource Planning software.
"This flexibility can save accountants a lot of time when it comes to repetitive regular tasks, such as manually opening spreadsheets to copy data and produce regular reports," Spear says.
"When the work is done, you can even configure Python to automatically send out group emails or post items in a Teams chat or group."
"It's not just the time saving – automating with Python, when properly used, can also reduce errors that can creep in when you're manually doing jobs over and over."
Python automates common accounting tasks
Python is a very powerful productivity tool when it comes to automating standardised recurring processes, such as preparing and distributing sales reports and profit and loss statements.
It offers extensive data cleansing and transformation capabilities, including the ability to work with unstructured data.
For example, it can fill or drop null values, fix date formats, rename columns, resample data to different time frequencies and perform many other adjustments to standardise data before it is analysed.
Automating this cleansing can also save accountants considerable time and effort when it comes to preparing data for analysis, while ensuring the results are more dependable.
Beyond preparing reports, Python is also a powerful modelling tool for quantitative and qualitative analysis, such as asset price trends and predictions.
As well as extracting data, Python also allows end users to input data. For example, it can be used to create an interactive form on a website or intranet, allowing employees to complete surveys or enter details such as travel expenses.
From here, Python can automatically collate this information, cross-check it against other business data and generate reports.
Python Fundamentals
Python's capabilities are easily extendable
The popularity of Python has built up a strong global community, along with an extensive library of packages for extending its functionality and scripts for tackling common tasks.
The fact that Python users can publish their scripts in online libraries for others to use means that accountants will often find existing solutions for common tasks, rather than needing to solve every problem from scratch, Spear says.
Python usage requires oversight
While Python allows accountants to tackle a wide range of challenges, they should be wary of using it to develop ad-hoc components of wider business processes, says Fahim Khondaker, professor of practice at UNSW Sydney as well as BDO partner and leader of the firm's data analytics and insights team.
Accountants should not create situations where critical business workflows depend on undocumented steps that are dependent on a single staff member and not supported by the IT team, says Khondaker.
"Python is certainly a powerful tool for automating some of the more repetitive parts of your role, but you don't want other people and processes depending on it," he says.
This is because the business could come to a standstill if you’re not available and no one knows how to manage the “shadow IT” Python script that has been quietly working away behind the scenes, he adds.
If Python is accessing sensitive business data, especially personally identifiable information, then it also requires governance and a risk assessment like any other business process.
"Business data is typically stored with appropriate security and access restrictions, so it can create risks if Python is extracting that data and storing it in a less secure location, such as on a desktop PC," Khondaker says.
"You do not want to be responsible for a data breach because your Python activities have been inadvertently storing sensitive data outside the castle walls."