Relearning Python: From Economics to Full-Stack AI Development

I first touched Python at university—utilising it for data analysis on my course and for research. It was undeniably a useful skill, but my preferred language for data analysis remained as R.

Python from data analysis to AI development

Returning to Python

I picked it back up when I first caught the coding bug in 2024, and was introduced to Streamlit. Streamlit is a framework that allows data scientists to quickly spin up a front-facing data app that visualises tables, graphs, and can even be used to create forms. After following The Data Professor on YouTube, I created some simple machine learning visualisations in Streamlit. Then I used this knowledge to build a couple of internal tools at work to save my team time.

Fast forward to 2025, after having thrown myself into full-stack development—picking up JavaScript, TypeScript, and React — I found that the Python ecosystem had developed significantly. I decided to revisit Python from a full-stack perspective and incorporate it into my project.

I’m currently training with Founders and Coders - and whilst working on my latest project, found the perfect use case for an AI agent to improve the onboarding flow. I wanted to use the OpenAI Agent-SDK which only supported python, and got the go-ahead from my teammates to explore this further.

After doing research, I decided to run two servers concurrently: a FastAPI server running on python, and an Express server running on Node.js. This would enable me to use OpenAI’s agents whilst the rest of the application’s logic was handled by the javascript server.


Here are some things I’ve learned about Python since approaching it from a full-stack perspective:

Python as a Backend Powerhouse

One of the biggest revelations was learning that Python can power the entire backend of websites and applications. Coming from a data-focused background, this opened up entirely new possibilities.

I discovered two major frameworks: Flask vs FastAPI.

  • Flask remains the most popular choice with its mature ecosystem and flexibility, but requires more manual setup for complex features.
  • FastAPI has emerged as a compelling modern alternative with built-in API documentation, native async support, and excellent type hints, though it has a smaller community and steeper learning curve for async programming.

The AI Development Shift

From JavaScript to Python for AI

Initially, I was calling OpenAI functions directly from JavaScript, which worked fine for simple implementations. However, as I began working on more sophisticated AI agents, I realised Python’s advantages in the AI ecosystem are undeniable.

Why Python dominates AI development:

  • Rich ecosystem: Libraries like LangChain, Hugging Face Transformers, and countless ML frameworks
  • Better debugging: More robust tools for handling complex AI workflows
  • Community: The AI research community primarily shares code in Python
  • Performance: Better handling of computationally intensive AI operations
  • Integration: Seamless connection between data processing, model training, and deployment

The transition felt natural once I embraced Python’s strengths for AI agent development. What took multiple JavaScript libraries and workarounds could often be accomplished with a few lines of well-designed Python code.


Development Environment Essentials

Jupyter Notebooks: Beyond Data Analysis

While I’d used Jupyter notebooks for data analysis before, I discovered that you could run them locally in VS Code using a Python kernel. This changed things for me as it meant I could prototype my code within a Jupyter notebook before incorporating it into my larger codebase.

Virtual Environments: A Game Changer with UV

Given that I was working on a group project, learning more about virtual environments became essential as my colleagues hadn’t touched Python before. I found UV, a modern Python package manager and environment manager, which does for Python what npm (Node Package Manager) does for JavaScript.

It also had the benefit of removing some of the pains of Python virtual environments—as my colleagues wouldn’t have to manually activate/deactivate environments.

Bridging Languages: Python and JavaScript Integration

One unexpected discovery was how seamlessly you can integrate Python scripts within JavaScript/TypeScript applications.

I first found how you can directly call Python scripts from JavaScript, as well as vice versa, during a hackathon project. This was called Direct Script Execution.

However, for this project I decided to do a server-side integration. I ran a FastAPI server which enabled me to use Python for the AI processing, expose these results via REST APIs, and consume from my frontend. I decided to run two servers in the backend: a Python server and a JavaScript server.


Lessons Learned and Looking Forward

Returning to Python with a full-stack and AI perspective taught me that programming languages evolve not just in syntax, but in their ecosystem and use cases. The Python I’m using today feels fundamentally different from the data analysis tool I’ve known before.

Key takeaways:

  • Context matters: The same language can feel completely different depending on your use case
  • Ecosystem evolution: Python’s AI libraries have exploded in sophistication
  • Integration opportunities: Modern development often benefits from multi-language approaches
  • Python is versatile and powerful

Whether you’re building AI agents, creating web applications, or bridging different technologies, Python’s versatility continues to impress. My journey from economics data analysis to full-stack AI development has taught me not to underestimate this programming language.