New Library Sprint

Choosing Code!

The hardest part of creating a new Python library is coming up with a good idea.

Suggestions for your first Python library

Pick something useful

Try to pick something useful that you've written or want to write:

  • A useful function
  • A few functions that are related somehow
  • A class that does something useful
  • A useful context manager
  • Any other useful snippet

How do you know if it's useful?

Here are some signs that a piece of code is useful:

  • You've copied and pasted it from one project to another
  • You could imagine use cases for wanting it in future projects

Don't be overambitious

For this sprint, keep your scope as small as possible. If this is your first Python package, the less lines of code, the better.

Even a useful 3-line function is worth packaging.

See cached-property: Don't copy-paste code for a story about a time that Daniel Greenfeld turned a tiny snippet that seemed unworthy of packaging into a useful package.

Still stuck?

If you have no idea what to work on, consider:

  • Simple string utility functions
  • A web scraping function
  • A function that analyzes some "Big Data"
  • A simple command line tool for doing something with files
  • A cool image processing function

Don't panic

Remember, don't panic.

Your first Python library doesn't have to be one that changes the world.

For your first effort, it's even okay if your library is a bit silly. No one is probably even going to notice your library among the 45,000+ PyPI packages.