This week we welcome Patrick Arminio (@patrick91) as our PyDev of the Week! Patrick works on Strawberry GraphQL, a Python GraphQL library based on dataclasses. You can catch up with Patrick over on his website.
Let's spend a few moments getting to know Patrick better!
Can you tell us a little about yourself (hobbies, education, etc):
Hi, my name is Patrick Arminio, I’m a Swiss/Italian Python developer living in the UK. I’m currently working for Pollen, a marketplace for experiences. I work in the platform team mainly focusing on the GraphQL infrastructure and developer experience.
I’ve started university while working part-time for a web agency and decided to focus on work as I enjoyed that much more than university.
I love travelling, attending to conference and organising them, I’m currently chair of Python Italia where we organise PyCon Italy which I hope some readers are familiar with (if not make sure to join us in the next edition! hopefully soon).
I’m also a runner, I’m attempting a marathon in October this year!
Why did you start using Python?
Uh, that was quite a while ago, I was still in high school, I was working on a website for my parents and decided to join a channel dedicated to HTML on an italian IRC server. This is where I met my friend Germano who suggested me to try Python. I initially used it just for fun and tried to build some GUIs with it. I quickly pivoted to using Django as I was really interested in making websites, after that I never really stopped using Django and Python. Germano was also the person that suggested me to attend PyCon Italy in 2007 (if I remember correctly), that small suggest (along with the awesome organisers and staff) changed my life and I become involved with the community and made a lot of amazing friends.
What other programming languages do you know and which is your favorite?
I know TypeScript (and JavaScript) quite well as I still do frontend work from time to time, I quite like it, especially because there’s always something new to learn and experiment with. I know this is a double edged sword, but even if there’s fatigue with this constant fluctuation of frameworks and tools; I find it inspiring 🙂
I’m also slowly learning Rust as I needed to write a CLI tool that needed to be fast. So far I’m liking it and I feel like it might be a good addition to my toolset, especially for building tools and CLIs. I’d still use Python for most of work, especially for web.
What projects are you working on now?
I’m mostly working on Strawberry, a library for building GraphQL APIs using modern Python. I had a couple of goals with this:
1. I wanted to build a community around it
2. I wanted to improve the Python ecosystem for GraphQL
3. I wanted to make a library that was really user friendly and had really useful features
I think we achieved the first two points, we now have a nice community around Strawberry with awesome people that contribute a lot of useful discussion in our discord server. Also the library is being used in a few companies in production so we definitely have provided some value there. And I’m super happy to not be the only core dev, as I wanted this library to become a community project, not my project.
For the last point, there’s still work to do, but we are getting there. I’m planning to spend more time on the library soon.
Which Python libraries are your favorite (core or 3rd party)?
I really like dataclasses (and by extensions attrs), the syntax is pretty nice and they give a lot of useful features without having to write a lot of code. We copied the syntax for Strawberry from dataclasses 🙂
I also really like rich, it’s a very nice library for building nice CLIs. I think CLIs (and UIs in general) should look as nice as possible. Rich helps with that.
I love types so another favourite library would be the typings module, even if Python is evolving to make this modules less and less useful by bringing some features into the main syntax (for example the pipe operator for unions).
And of course, django, but django is not just a library, it is an awesome community with strong values, I wish there were more communities like that.
Could you explain the benefits of GraphQL versus REST?
That’s an interesting question! For me, the benefits are mostly in terms of dev experience, especially when working with GraphQL on the frontend as there are many libraries that make the experience much easier. For Python, we are trying to improve the dev experience with Strawberry 🙂
Other than having nice libraries the experience is better because GraphQL has typing and documentation built-in by default (so it’s not really an after though). That makes the APIs easy to use and discover and also gives you guarantees on the data that’s coming back.
One of the strong reason to adopt GraphQL is that it solves over and under-fetching, which is true, but it also a double edges sword, as you might start requesting a lot of data without thinking too much.
What lessons have you learned while working on GraphQL?
I guess working on GraphQL as library author gave me a lot of learnings about having empathy for other developers. Our goal is to create a feature-rich and user-friendly library so we are trying to approach both people unfamiliar with GraphQL and people with lots of GraphQL experience.
I’d say it is tricky to get a balance sometimes, especially when you keep the expert hat on, as it is easy to assume everyone is familiar with all the concept of GraphQL.
I’ve also learned that making other developers happy makes me happy. It’s nice to build tools and libraries that save time to other developers!
Is there anything else you’d like to say?
Thanks for reading this interview! And if you’re interested in GraphQL feel free to join the Strawberry discord server or hit me up directly 🙂
Thanks for doing the interview, Patrick!
Copyright © 2024 Mouse Vs Python | Powered by Pythonlibrary