The other day I wanted to demo the Google Books API (we use for Pybites Books) to somebody so I started to write some code on the fly to call its endpoints using httpx. Then I thought it would be nice to turn it into a small script to search for books and view details… Continue reading Create Project-Less Python Utilities with uv and Inline Script Metadata
Articles on Modules
A Practical Example of the Pipeline Pattern in Python
By Juan José Expósito González on 8 November 2024
What is this pattern about? The Pipeline design pattern (also known as Chain of Command pattern) is a flexible way to handle a sequence of actions, where each handler in the chain processes the input data and passes it to the next handler. This pattern is commonly used in scenarios involving data processing, web scraping,… Continue reading A Practical Example of the Pipeline Pattern in Python
From concepts to MVPs: Validate Your Idea in few Lines of Code with Streamlit
By Marco Franzon on 25 October 2023
Don’t waste you time in early optimization, stay focused on the product! Have you ever had a brilliant idea but hesitated to invest time and resources into building a full-fledged product? The fear of wasting resources on an untested concept is a common struggle for entrepreneurs and innovators. Fortunately, there’s a game-changer in the world… Continue reading From concepts to MVPs: Validate Your Idea in few Lines of Code with Streamlit
6 Cool Things You Can Do With The Functools Module
By Bob Belderbos on 21 September 2023
In this article let’s look at the functools Standard Library module and 6 cool things you can do with it (be warned, a lot of decorators are coming your way! 😍) … 1. Cache (“memoize”) things You can use the @cache decorator (formerly called @lru_cache) as a “simple lightweight unbounded function cache”. The classic example is… Continue reading 6 Cool Things You Can Do With The Functools Module
5 tips to learn any new Python library faster
By Bob Belderbos on 19 April 2023
This was a Pybites email first. To always get the latest and greatest content, subscribe here. Lately I have been learning some new libraries for weekly PDM Code Clinic demo sessions (e.g. PyScript, Flet, PySimpleGUI, Playwright, htmx, Redis, Leaflet, etc.) There is a general approach I take that makes this less painful and more fun.… Continue reading 5 tips to learn any new Python library faster
Finding new and removed Python 3.11 modules in 8 lines of code
By Bob Belderbos on 9 November 2022
In our TIL Slack channel AJ shared a cool new find: Today I learned about sys.stdlib_module_names: a frozenset of strings containing the names of standard library modules. … AJ on the Pybites Slack – TIL (today-I-learned) channel So I thought to give it a little test drive, specifically checking for modules that were added and… Continue reading Finding new and removed Python 3.11 modules in 8 lines of code
Making plots in your terminal with plotext
By Bob Belderbos on 22 August 2022
In this blog post a quick script to plot the frequency of our blog articles in the terminal. It’s good to see that we’re getting back on track 🙂 The code gist is here. First we import the libraries we are going to use. As always we separate Standard Library modules from 3rd party ones… Continue reading Making plots in your terminal with plotext
Learning Rich by making a color searcher command line app
By Bob Belderbos on 6 July 2022
The other day I wanted to get serious with the awesome Rich library. As we always say: you have to build to really learn + need ideas? Scratch your own itch. If you’re struggling for ideas, see what takes you long and/or is cumbersome and see if it’s a good candidate to automate it with… Continue reading Learning Rich by making a color searcher command line app
Automating the Boring Stuff and Plotting Student Data
By Russell Helmstedter on 28 June 2022
My name is Russell Helmstedter. I am a middle school math and computer science teacher at De Anza Academy of Technology & the Arts (DATA). My first exposure to Python was in March of 2020. For some reason, I was stuck at home and couldn’t go out and do things. I decided to learn how… Continue reading Automating the Boring Stuff and Plotting Student Data
How to make a nice graph using Django and Chart.js
By Bob Belderbos on 14 June 2022
In this article I will show you how to make a beautiful yet simple graph using Django + Chart.js. The code for this project is here. Getting the data We are going to plot the number of Bite exercises that get completed per month on our platform. For this I exported the live data from… Continue reading How to make a nice graph using Django and Chart.js