What I’m working on

(Current challenges and questions I’m trying to answer)

Figure out how Python can complement our ASP.NET Core backend (C#):

  • What value does Python add beyond C#?
  • How can we connect Python services to a C# backend (APIs, files, messaging)?
  • When should a Python script remain a utility, and when should it become a microservice?

What I Learned

(Summarize new knowledge, reflections, or insights gained.)

Plain Python itself seems less impactful in our setup. Its real power comes from its libraries. For heavier backends, C# is usually the better fit (structured, fast, strongly typed). But when tasks involve analytics, machine learning, automation, or data-heavy processing, Python often wins.

To test this, I made a small Python experiment with an endpoint. From C#, I sent a list of student activity objects (login counts, time spent, submissions) to the endpoint in Python. The Python service then used pandas and matplotlib to generate a report that visualizes the data from C#.

The test project with a C# and Python: Python_Experiment

If we send a list of StudentActivity.cs-objects to the endpoint in Python… image-14.png

… we can concisely generate a useful visualization of the data in Python: reportdemo-1.gif

This showed why Python can be smart to integrate: in C#, building the same reporting pipeline would seemingly require multiple libraries and more boilerplate. In Python, this was only a few dozen lines of code.

This setup is not limited to PDFs either. Using a Pandas DataFrame, which is a data structure from the pandas library, it seems you can also aggregate data and return data very efficiently. You can then extract key metrics from the DataFrame for use in dashboards or real-time analytics.


By exposing Python as an API endpoint, we can keep our core backend in C#, but still leverage Python’s ecosystem in a way that is modular, future-proof, and easy to scale into a microservice if it grows. A Python endpoint like this could be become a microservice if it needs to scale independently, handle multiple requests, or provide specialized functionality that evolves separately from the core platform.

What do I need to do

(Obstacles, or upcoming questions, that I may need to address)

  • Consider the representation of data to users for our project (e.g., a PDF-file or via a dashboard).
  • Research how a service like this could be automated and how that would be useful to users.
  • Explore more scenarios where Python or other scripting could complement our backend.

Material

(Links, tutorials, or reference material)