Creating and Promoting Python PyPI Libraries

Peter Kogan
6 min readMar 31, 2022

--

This article will provide you with the knowledge, skills, insight, and encouragement you need to start an open-source library now and maintain and promote it for the next few years.

For the past few years, I’ve been promoting a python library I’ve created. This was a journey full of revelations, many of them outside the scope of engineering and software design.

I came across many obstacles and a general lack of knowledge about the most effective ways of promoting a code library. My intuition and many good friends helped along the way.

In this article, I’ll share the best solutions I’ve found for creating and promoting open source libraries.

Getting Started

Let’s begin with the knowledge and encouragement you need to start your open source project today.

Myth-Busting

These are some of the common misconceptions I’ve heard throughout the years:

“Only the most experienced developers can create open-source projects.”

“It’s difficult to publish to PyPI.”

“It takes a lot of time to support a project.”

It turns out that the above statements are false.

I was a novice Python developer when I published my open-source library for the first time. It was pretty easy then. Nowadays, it’s even easier — there are a lot more tools and resources available.

I recommend that you use a project template like this one. You can create and configure your project in a matter of minutes, add it to GitHub for free and publish it on PyPI in a few hours (also free).

I speak from experience — I used this template to:

It was quick, intuitive, and I learned a few things along the way.

In my experience, supporting an open-source project doesn’t take a lot of time. It can vary, depending on how big is your project, your audience size, and the feature request ratio. If you do have a large and vibrant community using your library, some of them should be able to help you out with pull requests and such.

Maintaining and Improving

Now that I’ve shown you the tools to build and publish your project, let’s talk about the specifics and how to make it great!

The Need

You should create a library that solves a real need. If there is no real need, the library would have a very low adoption. The need can start as your personal need, but you should assess the need for your library in the target community.

Assessing and adapting to the needs of your users is key.

I started by solving my immediate needs and then used an internal developer workshop from within my company to help me take my library to the next level.

Quantity Does Not Equal Quality

It’s easy to get confused between the two; you can have broad attention by posting to large crowds, but if most of the people there are not your actual target audience, it would do little in terms of getting useful feedback or actual traction of your library.

Try to find the right communities and forums to promote the library: newsletters, meetups, conferences, email lists, etc.

The point here is to be narrow: target the exact audience.

Meeting Your Customers Early

You have to meet your customers early. By “meet” I mean any interaction that your customers have with your product and that is reported back to you by any means.

This can be achieved by: answering questions on various forums, writing blog posts, collecting usage statistics, running a workshop, observing a few selected customers while they use your product, etc.

The two most effective ways for me to “meet” customers were through the workshops mentioned earlier and by answering and discussing stack-overflow questions of people who had similar problems.

Getting Feedback

Getting feedback is possible by meeting the customers. You can’t have feedback unless you meet customers. Responding to feedback is a crucial ingredient throughout the entire cycle of your library development, promotion, support, and maintenance.

You have to be willing to accept good feedback and pivot when the time is right. Failing to do so might leave you with a product you like, but has no real use to almost anyone else.

Quick Iterations

When you get useful feedback — act quickly.

One good example in my case was simplifying the API: the library was working, but it wasn’t trivial to use. I simplified the API and it made a big difference.

Another example is updating the documentation based on user feedback: if they can’t understand how to use the library — they won’t. Responding to difficulties your users encounter, can have a huge effect both on them and on future users.

The biggest pivot I made in my library was a feature request by a novice Python engineer — he expected the library to be more intuitive as he had no prior background. This “feature request” turned out to be a massive code rewrite that took my library to the next level and helped many more engineers, including those with a stronger background in Python.

Having several funnels

Have several funnels to feed the interest of your library.

Leverage your social media and online presence, even if it’s not directly tied to the library.

If you are well known on social media for other things you do, including and especially technical programming, you can use that when promoting — because you have a big community of followers.

Posts on multiple social media networks, events (physical and virtual), mail lists and newsletters, stack overflow answers, and many other ideas can help you get some traction. You never know which of them would be a game-changer.

Most of the people are shy. Don’t be shy. If you publish your work you will stand out almost immediately. (Peter Kogan 2022)

Playing the Long Game

Success takes time, don’t waste your energy too quickly, you’ll need it later.

Be ready to apply many different plans and strategies: answer questions in stack-overflow and let it reach more and more audiences, get into mailing lists and publications, publish several posts and conduct training, have ambassadors of your library. These are just a few of the examples I used.

You can do more than that — consider heavy use of multiple social media channels, doing or joining existing podcasts, conferences and the list goes on… apply some thought and come up with even more ideas. Try to think outside the box and outside of your comfort area.

Try several vectors instead of focusing on just one tactic: most of the steps you would do, would have a limited effect, so it’s important to mix and spread them over time.

Have Fun

Remember why you started the project in the first place, think about the joy you make from it. Is it the desire to do something new and innovative? Is it to learn new skills? Maybe improving the life of your customers? Perhaps you wanted to get out of your comfort zone and engage with people?

Having fun can increase the chance of you reaching your final destination and in any case, it would make the journey more joyful.

I hope that this guide helped you. If you are promoting your library, I’d be happy if you add a comment in this article:

  1. What were the steps that worked best for you?
  2. Can you share the barriers you have encountered in your journey?
  3. Any additional methods you may have to promote libraries?

P.S
Help me promote Pytest Mock Generator: a pull request, a social media share, or even a simple star can go a long way.

Thanks to Joshua Sheats for his timeless “Radical Personal Finance” podcast intro:

“…the show dedicated to providing you with the knowledge, skills, insight, and encouragement you need to live a rich and meaningful life now while building a plan for financial freedom in 10 years or less.”

I’ve borrowed it and modified it to fit this post.

--

--