PyDev of the Week: Giampaolo Rodola’

This week we welcome Giampaolo Rodola’ (@grodola) as our PyDev of the Week! Giampaolo is the creator and maintainer of the psutil project as well as the pyftpdlib and pysendfile packages. He is also been a core developer and maintainer of ftplib, asyncore and asynchat stdlib modules. You can check out some of his work over on Github or check out his blog! Let’s take some time to get to know our fellow Pythonista better!

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

I am a Python freelancer working remotely. I am Italian and I am currently based in Prague. My main hobby is programming and I also enjoy playing guitar, singing and astronomy. I also enjoy traveling and have been semi-nomadic for the last 3.5 years. As such I may also work and travel at the same time, although if I get a long gig I prefer to stay in Prague. I have no formal IT education. I learned programming because it was fun and I ended up paying the rent with it by accident.

Why did you start using Python?

Initially (early 2000s) I was fascinated by hacking and the underground hacking scene. I remember I used to read lots of articles and hacking e-zines. I was particularly interested in networking and was fascinated by vulnerabilities which could be exploited via the network. I had a huge limit though: I didn’t know any programming language, and those articles often contained code samples and exploits which were written in C. I was stuck, so I decided I would learn C. I started reading a tutorial but I got discouraged pretty soon because I just couldn’t wrap my head around the language (pointers in particular). I didn’t give up and started looking for an easier language to learn and I eventually ended up on a Python tutorial (I don’t remember how exactly). Contrarily to C I found Python easy to learn and extremely fun to play with. I wasn’t really sure what I was doing but I focused my efforts around (RAW) sockets and libpcap, because that was what I needed to realize my idea (a backdoor). After a couple of months I released my first hack-related tool: a remote shell using ICMP instead of TCP. Shortly after I came up with a second tool, a port knocker, which is basically a sniffer which listens for combinations of packets in order to open ports on a firewall. Funnily, shortly after the release of these two hack toys, I gradually started losing interest for hacking but I still liked networking and sockets, so I decided I would write a server, I didn’t care which one. I started reading RFC-959, the FTP protocol spec, I kind of liked it, so I ended up writing my first network server! Initially it was a command line tool and it was using threads for concurrency, I later rewrote it from scratch by using an event-driven approach and ended up being a library intended for other developers: pyftpdlib. That was my first “official” open source project including a VCS, a bug tracker and (some time later) an actual user base.

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

I know C, mainly because I had to learn it for psutil, but I’m not particularly good at it nor I particularly like it. 🙂

What projects are you working on now?

The only project I’m actively working on right now is psutil. Other ones I work on from time to time are pyftpdlib, pysendfile and confix. I also contribute some patches to python-dev every now and then or propose something on python-ideas when I’m particularly inspired.

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

I think my favourite is docopt. Other favourites are Tornado (because of the great code quality) and curio (because it’s just awesome).

How did you get started with the psutil project?

I think it happened when pyftpdlib started getting a user base and I received my first job offer for it. With pyftpdlib I learned tons of things about networking, asynchronous programming and API design. I even became the maintainer of ftplib, asyncore and asynchat stdlib modules because the whole FTP server was centered around them and they were poorly maintained. But above all I learned that I enjoyed taking care of an open source project: writing doc for it, make it evolve release after release, respond to bug reports and feature requests, interact with users, etc. It was good and I wanted more of that.

Back then I had a “remote friend” living in New Jersey, Jay, who was also a Python developer. He helped me translating some American comedy shows by Jeff Dunham which I and a couple of other friends dubbed in Italian and put on YouTube. He contributed a couple of patches for pyftpdlib and he also wanted to start a Python project. I think he’s the one who came up with the idea of a “library for querying processes”. Me, personally, I didn’t care too much. I just wanted something “real” to work on, possibly together, and his idea sounded good. We did some research and noticed there was a similar Python project called PSI. Jay proposed the idea of joining their team and contribute to PSI project instead but I didn’t want to so we ended up starting from scratch. I wrote the first Python skeleton (the Process class) and the Linux implementation and Jay wrote the initial C extensions for Windows and OSX. This made sense because back then I didn’t know any C and I was on Linux while Jay knew C and was on OSX. The project didn’t receive much attention at first. To be honest I thought it was a toy compared to pyftpdlib and would remain unnoticed. In fact this is what happened for the next couple of years during which I was way more focused on pyftpdlib which in the meantime brought me another couple of good job offers from people who wanted a customization for it and even brought me to visit US. In the meantime Jay had a daughter, he gradually lost interest about psutil and eventually abandoned the project (I finally met him in person in New Jersey many years later though =)). I was sad at first to be honest, and a bit worried too because he was the C coder. That basically forced me to improve my very limited C skills and from then on psutil basically became a solo project. During this process I kept adding features, collected feedback from users, learned about system programming, virtualization, automation, API design, how to write a doc… you name it. At some point, I’m not sure when, I realized that psutil became much “bigger” than pyftpdlib in terms of user base and pyftpdlib gradually received less and less of my attention. 9 years later psutil is a very popular Python lib with a stable user base, it still occupies an important part of my free time especially while I travel and working on it still gives me a good dose of satisfaction.

Do you have any advice for new developers that would like to join an open source project?

For me having an idea and an actual project to work on was vital after I learned the basics of the language because I needed a *goal*. Actually I first came up with an idea (write a hack-related network tool) and then I learned the language. I think that is very important because you risk to invest a lot of time into acquiring a knowledge which you may end up not using if you don’t know what to do with it. The real joy of programming derives from problem solving, so it is vital to have a real problem to solve. And if you don’t have it just find one, and do it quickly, because the risk of losing interest is a real possibility, especially at first, even though you spent 2-3 months reading a tutorial in your spare time. This is exactly what I did when I started the pyftpdlib and psutil projects. I didn’t write a FTP server because I needed one. I didn’t really care about monitoring systems or system programming with psutil. I am *not* a user of my projects. I was just looking for a problem – any problem – to solve, possibly in my area of interest (networking), because I genuinely enjoyed writing code. I was looking for an excuse to start coding and keep coding. Secondly, if you plan to make a living out of programming (I wasn’t), bear in mind that your open source project doesn’t really bring you money but it may become your resume. That was especially important for me because I have no formal IT education, no official piece of paper which demonstrates what I can do. I just have my passion for programming and my open source projects. That is one of the most practical payoffs of open source in the long term (for me at least): getting recognition from your (public) work and (possibly) find good gigs with it. That is basically what I say to my friends who don’t understand why the heck I do all this for free. It’s a hobby which incidentally also happen to be a potential long term investment. 🙂

Thanks for doing the interview!

Print Friendly, PDF & Email
  • Pingback: PyDev of the Week: Giampaolo Rodola’ - Codango.Com, Codango & Codango Labs()

  • Taylor Brazelton

    Great job Giampaolo 😀

    It’s awesome reading about how you got your start. Keep it up 🙂 I am pretty sure everyone working in software who doesn’t have an open source project that’s taken off like all of yours wishes they did. I know I’m always a bit jealous. Ha