Ask HN: High quality Python scripts or small libraries to learn from

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. openai-cookbook

    Examples and guides for using the OpenAI API

    https://github.com/openai/openai-cookbook/blob/main/examples...

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. ruff

    An extremely fast Python linter and code formatter, written in Rust.

    I think I mention this all the time when this comes up, but I learned the most 'best practices' through using ruff.

    https://docs.astral.sh/ruff/

    I just installed and enabled all the rules by setting

  4. simonw

    https://simonwillison.net/2020/Jul/10/self-updating-profile-readme/

    Everything @simonw has worked on, honestly: https://github.com/simonw

  5. datasette

    An open source multi-tool for exploring and publishing data

    Simon Willison's github would be a great place to get started imo -

    https://github.com/simonw/datasette

  6. sqlite-utils

    Python CLI utility and library for manipulating SQLite databases

    https://github.com/simonw/sqlite-utils

    So, his code might not be a good place to find best patterns (for ex, I don't think they are fully typed), but his repos are very pragmatic, and his development process is super insightful (well documented PRs for personal repos!). Best part, he blogs about every non-trivial update, so you get all the context!

  7. elements-of-python-style

    Goes beyond PEP8 to discuss what makes Python code feel great. A Strunk & White for Python.

    I had 2 suggestions (plus a blog post) in my style guide here:

    https://github.com/amontalenti/elements-of-python-style#some...

    The style guide itself, published a few years back, also has some suggestions with small code snippets.

  8. beyond-jupyter

    Software design principles for machine learning applications

    If you're looking for some best practices related but limited to machine learning application code, you could have a look at [Beyond Jupyter](https://github.com/aai-institute/beyond-jupyter)

    Here's an excerpt from the readme:

  9. pytudes

    Python programs, usually short, of considerable difficulty, to perfect particular skills.

    Peter Norvig's work is great to learn from https://github.com/norvig/pytudes

  10. Flask

    The Python micro framework for building web applications.

    I'd suggest Flask or some of the smaller projects in the Pallets ecosystem:

    https://github.com/pallets/flask

  11. pytheus

    experimenting with a new prometheus client for python

    I don't know if I can consider my code "Great" but I dedicated way too many months on a prometheus library where I focused on quality since I did it for me.

    It's relatively small and I think the main take away would be the use of Protocols for the pluggable backend system. I hope you get something out of it :)

    https://github.com/Llandy3d/pytheus

  12. tasktiger

    Python task queue using Redis

    I've recently looked at tasktiger https://github.com/closeio/tasktiger. It's a simple queue system that helped me understand how workers and schedulers work.

  13. starcel-panda3d

    Check out https://github.com/recursion-computing/starcel-panda3D for bleeding edge Python OS development

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • AI Doesn't Reduce Work–It Intensifies It

    7 projects | news.ycombinator.com | 10 Feb 2026
  • The current state of LLM-driven development

    7 projects | news.ycombinator.com | 10 Aug 2025
  • Welcome to Datasette Cloud

    6 projects | news.ycombinator.com | 20 Aug 2023
  • SQLite Functions for Working with JSON

    10 projects | news.ycombinator.com | 10 Aug 2023
  • I'm sure I'm being stupid.. Copying data from an API and making a database

    2 projects | /r/Database | 19 Jan 2023