PyDev of the Week: Phil Ewels

This week, we welcome Phil Ewels as our PyDev of the Week! Phil is the creator of the rich-click package. You can find Phil on TwitterMastodon,  or BlueSky.

You can also catch up with Phil over on GitHub.

Let’s spend a few moments getting to know Phil better!

Phil Ewels

Can you tell us a little about yourself (hobbies, education, etc):

I’m a scientist turned software developer from the UK, now living in Sweden. My education and career path is a little winding: I studied Biochemistry at Bristol and went on to do a PhD in Molecular Biology at Cambridge, working with techniques to tease out the three-dimensional structure of DNA in order to figure out why some cancers happen more often than we expect. During school and university I did web development on the side for fun, and at some point the two interests fused and I got into the field of bioinformatics – computational analysis of biological data. I ended up at SciLifeLab in Sweden working at a national center doing DNA sequencing and analysis for academic researchers. I’ve been lucky enough to have the opportunity to be behind some popular open-source software for scientists over the years and recently joined Seqera to focus on building scientific OSS and the communities that drive them.

I have three young children so I don’t have much time for hobbies these days! But if I get a chance I love to get out on my bike or into the mountains, and I spent much of my earlier life rowing competitively.

Why did you start using Python?

I switched from Perl to Python when I moved to Sweden, as it was used by everyone else in the group. It immediately clicked with me and I never looked back. I’ve never had any formal training, but I had some great mentors in those early days – Per Kraulis, Mario Giovacchini and Guillermo Carrasco to name a few. I learnt quickly, mostly through their pull-request reviews!

What other programming languages do you know and which is your favorite?

My first languages were BASIC on my older brother’s BBC Micro and then Actionscript in Macromedia Flash! Then PHP, JavaScript, Perl and Python. More recently, I’ve done a lot of work with Nextflow which is a domain-specific language based on Groovy. If I start a new project I’ll always reach for Python, unless there’s a compelling reason to do otherwise.

What projects are you working on now?

As of this month I’m project manager for open-source software at Seqera, so my official remit covers Nextflow (data pipelines), MultiQC (data visualisation / reporting), Wave (on-the-fly containers) and Fusion (fast virtual filesystems). I’m also the co-founder of nf-core and am heavily involved in writing the developer tools for that community. Those are my day job projects, after that I have a long tail of pet projects lurking on GitHub that never quite get the attention that they deserve! The most recent ones are rich-click (see below) and rich-codex, for auto-generating terminal output screenshots from simple markdown commands.

Which Python libraries are your favorite (core or 3rd party)?

I have a soft spot for user-friendly interfaces and fell in love with Rich by Will McGugan / theTextualize team the moment I came across it. More recently they released Textual which is pure magic and a delight to work with. Before Textual I used Questionary for interactive CLI prompts, which is fun. Oh and I love all ofSebastián Ramírez’s libraries, but especially FastAPI. Those are beautiful in their simplicity and a great source of inspiration, as well as being super intuitive to work with. Also worth a mention are Pyodide and Ruff – neither are really libraries, but both do really cool things with Python code, in different ways.

How did the rich-click package come about?

As mentioned above, I’m a bit of a fan-boy when it comes to Rich. I had used it to pretty good effect to make the CLI output of most of my tools colourful. As a result, the output from Click (used for the CLI interface) started to stand out as being a bit.. bland. I’d been toying with the idea of building a plugin for a few months, then Will launched rich-cli complete with an attractive CLI. I took his code (with his permission, and help) and generalised it into a package that would do the same for any Python package using Click to generate a CLI. My priority was to make it as simple to use as possible: the basic usage is simply `import rich_click as click`, and the CLI output looks magically nicer. The package has since found its way into quite a few people’s projects and inspired native Typer functionality which is cool. Most recently, Daniel Reeves offered to help with maintenance which I hope gives the project a more stable base to live on (he also did a cool new logo!).

What is your elevator pitch for the MultiQC tool?

MultiQC is a data visualisation tool that understands the log outputs from hundreds of different scientific software packages. At the end of a typical genomics analysis run you might have outputs from 10s – 100s of different tools for 10s – 1000s of samples. MultiQC can scoop up the summary statistics from all of these and generate a Human-readable HTML report summarising the key quality-control metrics, letting you spot any outlier samples. Whilst MultiQC’s origins lie in genomics, it doesn’t do anything specific to that field, and it’s built in a modular way that makes it easy to extend to any tool outputs. You can play around with it in your browser (the recent Pyodidetoy I’ve been playing with) here.

Is there anything else you’d like to say?

Just a big thanks to you and everyone in the Python community for being such a lovely bunch of people. Python folk are one of a small handful of enclaves that I still really enjoy interacting with on social media and I think much of that stems from our diverse backgrounds. Long may that continue! Oh, and if anyone fancies writing a rich-pre-commit library that I could use, then that’d be awesome!

 

Thanks for doing the interview, Phil!