Data scientists are like swiss army knives, we can use our knowledge nearly everywhere if we try to understand and think about a need or a problem. Many of us are hesitating to deal with projects that seem to be out of the data science scope and personally I think that by doing that, they are losing a great opportunity to become better, and why not, make some extra income. In this post, I’ll tell you a story about how I helped a friend Andrea with his first e-commerce store.
First Problem: ERP Connector
Firstly, he needed somehow to help him with his ERP system because the ERP providers didn’t know how to connect the ERP system with Shopify which is the platform that my friend uses. At that time, I didn’t even know what an ERP is but I didn’t give up.
After long meetings with the ERP providers, I understood that they wanted a way to get the orders of the day in a specific XML format. I had so many gaps and questions about it but I thought that with some research I may be able to solve this problem.
I needed a way to extract the data from Shopify, then transform and return them in XML format. For the first step, after studying Shopify and its APIs, I managed to get all orders of the day using Python. Then, I used Pandas Dataframes to transform the data the way the ERP providers wanted, and then, I managed to transform them to an XML format using a custom function.
Finally, I created a GET API to let the ERP providers use it to get the XML data. We didn’t have any servers so I decided to use Heroku for free deployment. That was it! The solution to the problem was ready.
After a year, the connector is working great and we even updated it with some new info for the products which normally, my friend had to pay third-party apps to do it. Bellow, you can see a screenshot of the output of the API.
Second Problem: Courier Status Update
Andreas told me that his company had hard times with the courier providers. He needed somehow to track every order so if the status was unclear his employees had to communicate with the client or the courier provider to solve the problem. At that time, the employees had to manually check the delivery status of the orders that were over 400 per day. I was shocked because this is inefficient and time-consuming. I told him that we needed somehow to automate the process.
The process they currently had was to get the new orders and their tracking numbers in a CSV format from the ERP system and add them to a google spreadsheet. Then they had to manually check the delivery status of every order daily.
After hours of brainstorming, I found the best solution to their problem. I needed to create a web app that can get as input the new orders from the ERP, add them to the spreadsheet, and at the same time, automatically refresh their delivery status. Firstly I needed to find a way to use the Courier provider’s API so I can automatically update the status. After some research, I was able to find the API from the courier provider’s website. Secondly, I needed to find a way to connect my web app with their google spreadsheet which I already knew how to do it. Finally, for the UI I used my favorite Streamlit.
The Status Update App was ready! We successfully automated this task saving many working hours and of course, he had an uplift in his delivery rate. Later, this app became a dashboard with summary statistics for every delivery status(how many orders are on their way, etc.) and many more helpful features to automate and monitor the whole process of delivery.
Third Problem: Find The Optimum Delivery
The company was based in Greece and most of its clients were from Athens. After some analysis, he decided to skip the courier providers and hire two drivers to deliver the orders in Athens. The problem was that he needed to find the best route for them in order to deliver more packages per day. I thought that we needed to plot a heatmap with the orders on a map of Athens. This way we could see the hot areas and may help him decide on the best routes for his driver.
I had the postcodes of the orders and I found on the internet mapping with their corresponding latitude-longitude. Finally, I created an interactive heatmap using Plotly.
Summing it up
This was an example of how a Data Scientist can use his skills to solve business problems even if they seem to be out of his scope. Most data scientists have a huge toolbox of skills that can solve nearly anything by just using critical thinking and trying to adapt. This can help them in many ways in their working life because they’re expanding their knowledge and because adapting is one of the best and most useful things for an employee.