Quick answer: a Raspberry Pi can print a newspaper on your normal home printer. A Python program fetches the weather from Open-Meteo and headlines from RSS feeds, draws a one-page A4 PDF with reportlab, and sends it to the printer with the CUPS command lp. A cron line, 0 7 * * *, runs it at 7:00 every morning, and a push button on GPIO 27 prints a copy whenever you like.
Imagine coming down to breakfast and finding a fresh newspaper on the printer, with your name at the top. In this project you build exactly that. Every morning at 7:00 your Raspberry Pi 4 makes a one-page newspaper: today's date and edition number, the weather for your town, the top headlines from the news sections you choose, and a word of the day. Then it prints it on the family printer, over USB or Wi-Fi. You pick the newspaper's name. A "print now" button and a status LED on a breadboard let you print an extra copy at any time.

What you need
- A Raspberry Pi 4 Model B with Raspberry Pi OS on a microSD card, its USB-C power supply and an internet connection. New to the Pi? Start with Set up your Raspberry Pi 4 and write your first Python program.
- 1 push button, 1 LED, 1 resistor of 220 Ω, a breadboard and jumper wires. All of them are in the EEMENTOR ESP32 IoT Starter Kit, which the Raspberry Pi lessons borrow parts from.
- Female-to-male jumper wires for the Pi's pins. If you don't have any, plug a female-female and a male-male Dupont wire from the kit together.
- Any home printer that works with A4 paper, connected by USB or on the same Wi-Fi network. Not in the kit and not sold by us: use the one your family already has, and ask before you use its paper and ink.
- Optional: an email account for sending the PDF to a phone, and a Claude API key from an adult's account for the editor's note.
Step 1: Install the software
Open a Terminal on the Pi. Make a folder for the project and install the Python libraries and CUPS, the printing system Linux uses:
mkdir ~/newspaper
cd ~/newspaper
sudo apt update
sudo apt install python3-feedparser python3-requests python3-reportlab cups
feedparser reads news feeds, requests downloads things from the internet, and reportlab draws PDF files. gpiozero, for the button and LED, is already part of Raspberry Pi OS.
Now give your user permission to manage printers, then log out and back in (or restart) so the change works:
sudo usermod -aG lpadmin $USER
Last, check the Pi's time zone: run date. If the time is wrong, open sudo raspi-config, choose Localisation Options → Timezone and pick your city.
Step 2: Wire the button and the status LED
Look after your Pi: shut it down and unplug it before you change any wiring.
The LED tells you what the newspaper is doing: on means ready, blinking means it is making and printing a paper, and three quick flashes mean something went wrong. Put the button across the gap in the middle of the breadboard, so its two sides are not joined until you press it. The LED's long leg is the + leg (anode).

| From | To |
|---|---|
| Pi GPIO 17 (pin 11) | 220 Ω resistor, then the LED's long leg (+) |
| LED short leg (−) | The blue (−) rail |
| Pi GPIO 27 (pin 13) | One leg of the push button |
| The button leg on the other side of the gap | The blue (−) rail |
| Pi GND (pin 9) | The blue (−) rail |
The button doesn't need its own resistor. gpiozero switches on a pull-up resistor inside the Pi, which holds GPIO 27 at 3.3 V. Pressing the button connects the pin to GND, so the Pi sees it go LOW.
Step 3: Set up your printer with CUPS
Switch on the printer. Plug it into one of the Pi's USB ports, or make sure it is on the same Wi-Fi network as the Pi. Then add it to CUPS:
- Open the Pi's web browser and go to
http://localhost:631, the CUPS web page. - Click Administration → Add Printer. Sign in with your Pi username and password if asked.
- Choose your printer from the list. Network printers usually appear under Discovered Network Printers. For the driver, most modern printers work with IPP Everywhere (driverless printing), so try that first.
- Give it a short name without spaces, such as
Home_Printer, and finish.
Back in the Terminal, list the printers and make yours the default one. Then print a test line:
lpstat -p -d
lpoptions -d Home_Printer
echo "Hello from my Raspberry Pi" | lp
If a page with "Hello from my Raspberry Pi" comes out, printing works. If not, see Common problems before you go on.
Step 4: Choose your newspaper's name and sections
All your choices live in one settings file, so you never need to change the program itself. Save this as newspaper.ini in the ~/newspaper folder and change it to suit you:
# Settings for your morning newspaper. Lines that start with # are notes.
[paper]
# The name printed at the top (the masthead)
name = The Morning Pebble
# Your town, and where it is (find the numbers on open-meteo.com or a map app)
town = Tallinn
latitude = 59.44
longitude = 24.75
# The first day of your paper: edition No. 1
start_date = 2026-12-01
# Days to print. Remove sat,sun for school days only.
print_days = mon,tue,wed,thu,fri,sat,sun
# Leave empty to use the default printer, or put a name from: lpstat -p
printer =
copies = 1
items_per_section = 3
[sections]
# Section name = RSS feed address. Pick 2 to 4 sections.
World = https://feeds.bbci.co.uk/news/world/rss.xml
Science = https://feeds.bbci.co.uk/news/science_and_environment/rss.xml
Sport = https://feeds.bbci.co.uk/sport/rss.xml
[words]
# Your own words of the day (word = meaning). Delete this part to use the built-in list.
Serendipity = finding something good without looking for it
Luminous = giving off light; bright
Meander = to wander slowly with no fixed direction
[email]
# Optional: also email the PDF. Ask an adult; use an app password, not your normal one.
enabled = no
server = smtp.example.com
port = 465
user = me@example.com
password =
to = me@example.com
[claude]
# Optional: a 2-sentence editor's note written by Claude. Needs an API key from console.anthropic.com.
enabled = no
api_key =
- name is the masthead, the big title at the top.
- town, latitude and longitude set the weather. Find the two numbers by searching for your town on open-meteo.com or in a map app.
- start_date is the day of edition No. 1.
-
print_days lets you skip days. Use
mon,tue,wed,thu,frifor school days only. - Each line under [sections] is a section name and an RSS feed address. Two to four sections fit nicely on one page.
Be fair to the news sites: the program prints headlines and short summaries for your family only, and every item shows its source. Each publisher sets its own rules for its feeds, so read them. For example, the BBC's terms of use say you must credit BBC News and must not change the feed, and business use needs permission. Never sell or publish your paper.
Step 5: Add the newspaper program
Save this program as newspaper.py in the same folder. It is long, but it is split into numbered parts, and How it works explains each one.
# newspaper.py - makes a one-page A4 morning newspaper as a PDF and prints it.
# Run: python3 newspaper.py (makes today's paper and prints it)
# python3 newspaper.py --no-print (only makes today.pdf)
# python3 newspaper.py --force (prints even on a day that is switched off)
import argparse
import configparser
import datetime as dt
import html
import re
import subprocess
from pathlib import Path
import feedparser
import requests
from reportlab.lib.pagesizes import A4
from reportlab.lib.utils import simpleSplit
from reportlab.pdfgen import canvas
HERE = Path(__file__).resolve().parent
DAYS = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
# ---------- 1. Settings ----------
def load_config(path):
cfg = configparser.ConfigParser()
cfg.optionxform = str # keep "World" with a capital W
if not cfg.read(path, encoding="utf-8"):
raise SystemExit(f"Can't find the settings file {path}")
p = cfg["paper"]
settings = {
"name": p.get("name", "The Morning Post").strip(),
"town": p.get("town", "").strip(),
"latitude": p.getfloat("latitude"),
"longitude": p.getfloat("longitude"),
"start_date": dt.date.fromisoformat(p.get("start_date", dt.date.today().isoformat()).strip()),
"print_days": [d.strip().lower() for d in p.get("print_days", ",".join(DAYS)).split(",") if d.strip()],
"printer": p.get("printer", "").strip(),
"copies": p.getint("copies", 1),
"items": p.getint("items_per_section", 3),
"sections": [(name, url.strip()) for name, url in cfg["sections"].items()] if cfg.has_section("sections") else [],
"words": [],
"email": dict(cfg["email"]) if cfg.has_section("email") else {},
"claude": dict(cfg["claude"]) if cfg.has_section("claude") else {},
}
for d in settings["print_days"]:
if d not in DAYS:
raise SystemExit(f"print_days: '{d}' is not a day. Use mon, tue, wed, thu, fri, sat, sun.")
if cfg.has_section("words"):
settings["words"] = [(w, meaning.strip()) for w, meaning in cfg["words"].items()]
return settings
# ---------- 2. Which day, which edition ----------
def is_print_day(settings, day):
return DAYS[day.weekday()] in settings["print_days"]
def edition_number(settings, day):
# counts the print days from start_date up to and including today
start = settings["start_date"]
if day < start:
return 1
n = 0
d = start
while d <= day:
if is_print_day(settings, d):
n += 1
d += dt.timedelta(days=1)
return max(n, 1)
# ---------- 3. Weather (Open-Meteo, no key needed) ----------
WEATHER_URL = ("https://api.open-meteo.com/v1/forecast?latitude={lat}&longitude={lon}"
"¤t=temperature_2m,weather_code,wind_speed_10m"
"&daily=weather_code,temperature_2m_max,temperature_2m_min,precipitation_probability_max,sunrise,sunset"
"&timezone=auto&forecast_days=1")
WMO = {0: "Clear sky", 1: "Mainly clear", 2: "Partly cloudy", 3: "Overcast", 45: "Fog", 48: "Icy fog",
51: "Light drizzle", 53: "Drizzle", 55: "Heavy drizzle", 56: "Freezing drizzle", 57: "Freezing drizzle",
61: "Light rain", 63: "Rain", 65: "Heavy rain", 66: "Freezing rain", 67: "Freezing rain",
71: "Light snow", 73: "Snow", 75: "Heavy snow", 77: "Snow grains", 80: "Light showers",
81: "Showers", 82: "Heavy showers", 85: "Snow showers", 86: "Heavy snow showers",
95: "Thunderstorm", 96: "Thunderstorm and hail", 99: "Thunderstorm and hail"}
def get_weather(settings, get=requests.get):
try:
r = get(WEATHER_URL.format(lat=settings["latitude"], lon=settings["longitude"]), timeout=15)
r.raise_for_status()
return parse_weather(r.json())
except Exception as e: # no internet, server busy, strange answer...
print("Weather unavailable:", e)
return None
def parse_weather(data):
day = data["daily"]
return {
"now": round(data["current"]["temperature_2m"]),
"wind": round(data["current"]["wind_speed_10m"]),
"sky": WMO.get(day["weather_code"][0], "Mixed weather"),
"high": round(day["temperature_2m_max"][0]),
"low": round(day["temperature_2m_min"][0]),
"rain": day["precipitation_probability_max"][0],
"sunrise": day["sunrise"][0][-5:],
"sunset": day["sunset"][0][-5:],
}
# ---------- 4. News from RSS feeds ----------
def clean(text):
text = re.sub(r"<[^>]+>", " ", text or "") # some feeds put HTML in the summary
return re.sub(r"\s+", " ", html.unescape(text)).strip()
def parse_feed(xml, how_many):
feed = feedparser.parse(xml)
source = clean(feed.feed.get("title", "")) or "Unknown source"
items = []
for e in feed.entries[:how_many]:
title = clean(e.get("title", ""))
if title:
items.append({"title": title, "summary": clean(e.get("summary", "")), "source": source})
return items
def get_news(settings, get=requests.get):
news = []
for name, url in settings["sections"]:
try:
r = get(url, timeout=15, headers={"User-Agent": "morning-newspaper/1.0"})
r.raise_for_status()
items = parse_feed(r.content, settings["items"])
except Exception as e:
print(f"{name}: news unavailable:", e)
items = []
news.append((name, items))
return news
# ---------- 5. Word of the day ----------
BUILT_IN_WORDS = [
("Serendipity", "finding something good without looking for it"),
("Ephemeral", "lasting a very short time"),
("Luminous", "giving off light; bright"),
("Resilient", "able to recover quickly after something hard"),
("Curious", "eager to know or learn something"),
("Meander", "to wander slowly with no fixed direction"),
("Gregarious", "enjoying the company of other people"),
]
def word_of_the_day(settings, day):
words = settings["words"] or BUILT_IN_WORDS
return words[day.toordinal() % len(words)]
# ---------- 6. Optional: a 2-sentence editor's note from Claude ----------
def editors_note(settings, news, post=requests.post):
c = settings["claude"]
if c.get("enabled", "no").strip().lower() != "yes" or not c.get("api_key", "").strip():
return None
headlines = "\n".join(f"- {s}: {i['title']}" for s, items in news for i in items)
if not headlines:
return None
body = {
"model": "claude-opus-5-5",
"max_tokens": 1000,
"output_config": {"effort": "low"},
"fallbacks": "default",
"messages": [{"role": "user", "content":
"You write the editor's note for a family's one-page morning newspaper. Readers are 12 and up. "
"In exactly two short, friendly sentences, sum up today's headlines below. "
"Only use facts from the headlines. Plain text, no lists.\n\n" + headlines}],
}
try:
r = post("https://api.anthropic.com/v1/messages", json=body, timeout=60, headers={
"x-api-key": c["api_key"].strip(),
"anthropic-version": "2026-10-21",
"anthropic-beta": "server-side-fallback-2026-07-01",
"content-type": "application/json"})
r.raise_for_status()
answer = r.json()
if answer.get("stop_reason") == "refusal":
return None
text = " ".join(b["text"] for b in answer["content"] if b.get("type") == "text").strip()
return text or None
except Exception as e:
print("Editor's note skipped:", e)
return None
# ---------- 7. The PDF page ----------
FONTS = {"serif": "Times-Roman", "serif-bold": "Times-Bold", "sans": "Helvetica",
"sans-bold": "Helvetica-Bold", "italic": "Times-Italic"}
def use_dejavu():
# Raspberry Pi OS has the DejaVu fonts, which can print almost every letter.
# Without them, the built-in PDF fonts are used (Western European letters only).
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
folder = Path("/usr/share/fonts/truetype/dejavu")
files = {"serif": "DejaVuSerif.ttf", "serif-bold": "DejaVuSerif-Bold.ttf", "sans": "DejaVuSans.ttf",
"sans-bold": "DejaVuSans-Bold.ttf"}
if not all((folder / f).exists() for f in files.values()):
return False
italic = folder / "DejaVuSerif-Italic.ttf" # only in the fonts-dejavu-extra package
files["italic"] = italic.name if italic.exists() else files["serif"]
for key, f in files.items():
pdfmetrics.registerFont(TTFont("DV-" + key, str(folder / f)))
FONTS[key] = "DV-" + key
return True
def safe(text):
# the built-in fonts only know Windows-1252 letters: swap the rest for "?"
if FONTS["serif"].startswith("DV-"):
return text
return text.encode("cp1252", "replace").decode("cp1252")
def lines_of(text, font, size, width, max_lines):
lines = simpleSplit(safe(text), font, size, width)
if len(lines) > max_lines:
lines = lines[:max_lines]
lines[-1] = lines[-1].rstrip(" .,;:") + "…"
return lines
def build_pdf(path, settings, day, weather, news, word, note=None):
W, H = A4 # 595 x 842 points
M = 40 # page margin
c = canvas.Canvas(str(path), pagesize=A4)
c.setTitle(f"{settings['name']} - {day.isoformat()}")
# masthead
size = 46
while c.stringWidth(safe(settings["name"]), FONTS["serif-bold"], size) > W - 2 * M and size > 20:
size -= 2
c.setFont(FONTS["serif-bold"], size)
c.drawCentredString(W / 2, H - M - size + 8, safe(settings["name"]))
y = H - M - size - 6
c.setLineWidth(2); c.line(M, y, W - M, y)
c.setFont(FONTS["sans"], 9.5)
c.drawString(M, y - 13, f"{day:%A} {day.day} {day:%B %Y}")
c.drawCentredString(W / 2, y - 13, f"Edition No. {edition_number(settings, day)}")
c.drawRightString(W - M, y - 13, safe(settings["town"]))
y -= 19
c.setLineWidth(0.6); c.line(M, y, W - M, y)
# weather strip
y -= 8
c.setFillColorRGB(0.94, 0.95, 0.97); c.rect(M, y - 40, W - 2 * M, 40, stroke=0, fill=1); c.setFillColorRGB(0, 0, 0)
c.setFont(FONTS["sans-bold"], 11)
c.drawString(M + 10, y - 16, safe(f"Weather in {settings['town']}" if settings["town"] else "Weather"))
c.setFont(FONTS["sans"], 10.5)
if weather:
c.drawString(M + 10, y - 31, safe(f"{weather['sky']}. Now {weather['now']} °C, high {weather['high']} °C, low {weather['low']} °C."))
c.drawRightString(W - M - 10, y - 16, safe(f"Chance of rain {weather['rain']}% · wind {weather['wind']} km/h"))
c.drawRightString(W - M - 10, y - 31, f"Sunrise {weather['sunrise']} · sunset {weather['sunset']}")
else:
c.drawString(M + 10, y - 31, "Weather unavailable this morning.")
y -= 52
# editor's note (optional)
if note:
c.setFont(FONTS["italic"], 11)
for line in lines_of("Editor's note: " + note, FONTS["italic"], 11, W - 2 * M, 3):
c.drawString(M, y - 10, line); y -= 14
y -= 6
# news in two columns
gap, bottom = 22, M + 112
colw = (W - 2 * M - gap) / 2
x, top = M, y
for name, items in news:
need = 34 + (len(items) or 1) * 70
if y - need < bottom and x == M:
x, y = M + colw + gap, top # move to the right-hand column
c.setFont(FONTS["sans-bold"], 12)
c.drawString(x, y - 12, safe(name.upper()))
c.setLineWidth(1.2); c.line(x, y - 17, x + colw, y - 17)
y -= 30
if not items:
c.setFont(FONTS["italic"], 10.5)
c.drawString(x, y - 8, "News unavailable this morning.")
y -= 26
for it in items:
if y < bottom + 40:
break # the page is full
c.setFont(FONTS["serif-bold"], 12.5)
for line in lines_of(it["title"], FONTS["serif-bold"], 12.5, colw, 2):
c.drawString(x, y - 10, line); y -= 15
c.setFont(FONTS["serif"], 10.5)
for line in lines_of(it["summary"], FONTS["serif"], 10.5, colw, 3):
c.drawString(x, y - 9, line); y -= 12.5
c.setFont(FONTS["sans"], 8)
c.setFillColorRGB(0.4, 0.4, 0.4); c.drawString(x, y - 8, safe("Source: " + it["source"])); c.setFillColorRGB(0, 0, 0)
y -= 20
y -= 6
# word of the day box
c.setLineWidth(1); c.rect(M, M + 22, W - 2 * M, 72)
c.setFont(FONTS["sans-bold"], 11); c.drawString(M + 12, M + 76, "WORD OF THE DAY")
c.setFont(FONTS["serif-bold"], 20); c.drawString(M + 12, M + 50, safe(word[0]))
c.setFont(FONTS["serif"], 11.5)
for i, line in enumerate(lines_of(word[1], FONTS["serif"], 11.5, W - 2 * M - 24, 1)):
c.drawString(M + 12, M + 32, line)
c.setFont(FONTS["sans"], 7.5)
c.drawCentredString(W / 2, M + 6, "Made by a Raspberry Pi. Headlines from the feeds in newspaper.ini, for family use only. Weather: Open-Meteo.com (CC BY 4.0).")
c.showPage()
c.save()
return path
# ---------- 8. Printing and email ----------
def print_pdf(path, settings, run=subprocess.run):
cmd = ["lp", "-n", str(settings["copies"]), "-o", "media=A4", "-o", "fit-to-page"]
if settings["printer"]:
cmd += ["-d", settings["printer"]]
try:
result = run(cmd + [str(path)], capture_output=True, text=True, timeout=60)
except FileNotFoundError:
print("The lp command is missing. Install CUPS: sudo apt install cups")
return False
if result.returncode != 0:
print("Printing failed:", result.stderr.strip())
return False
print(result.stdout.strip()) # e.g. "request id is HP_DeskJet-12 (1 file(s))"
return True
def email_message(path, settings, day):
from email.message import EmailMessage
e = settings["email"]
msg = EmailMessage()
msg["Subject"] = f"{settings['name']} - {day:%A %d %B}"
msg["From"] = e["user"]
msg["To"] = e["to"]
msg.set_content("Good morning! Today's newspaper is attached.")
msg.add_attachment(Path(path).read_bytes(), maintype="application", subtype="pdf", filename=Path(path).name)
return msg
def email_pdf(path, settings, day):
import smtplib
e = settings["email"]
if e.get("enabled", "no").strip().lower() != "yes":
return False
try:
with smtplib.SMTP_SSL(e["server"], int(e.get("port", 465)), timeout=30) as s:
s.login(e["user"], e["password"])
s.send_message(email_message(path, settings, day))
print("Emailed to", e["to"])
return True
except Exception as err:
print("Email failed:", err)
return False
# ---------- 9. Put it all together ----------
def make_paper(settings, day, get=requests.get, post=requests.post):
weather = get_weather(settings, get)
news = get_news(settings, get)
note = editors_note(settings, news, post)
out = HERE / "today.pdf"
return build_pdf(out, settings, day, weather, news, word_of_the_day(settings, day), note)
def main():
ap = argparse.ArgumentParser()
ap.add_argument("--config", default=str(HERE / "newspaper.ini"))
ap.add_argument("--no-print", action="store_true", help="only make today.pdf")
ap.add_argument("--force", action="store_true", help="print even if today is switched off")
args = ap.parse_args()
settings = load_config(args.config)
use_dejavu()
today = dt.date.today()
if not args.force and not is_print_day(settings, today):
print("Not a print day:", today.strftime("%A"))
return 0
pdf = make_paper(settings, today)
print("Made", pdf)
ok = True
if not args.no_print:
ok = print_pdf(pdf, settings)
email_pdf(pdf, settings, today)
return 0 if ok else 1
if __name__ == "__main__":
raise SystemExit(main())
Make a paper without printing it first, so you don't waste any paper while testing:
cd ~/newspaper
python3 newspaper.py --no-print --force
Open today.pdf from the file manager and check your name, the weather and the headlines. --force makes a paper even if today is not a print day.
Step 6: Print your first edition
Happy with the page? Print it for real:
python3 newspaper.py --force
The Terminal shows something like request id is Home_Printer-12 (1 file(s)), and a few seconds later the printer starts.
Step 7: Print every morning at 7:00 with cron
cron is a timer that is built into Linux. It reads a list of jobs, called a crontab, and runs each one at its time. Open your crontab:
crontab -e
The first time, it asks which editor to use: choose nano. Go to the bottom of the file and add this line:
0 7 * * * cd ~/newspaper && python3 newspaper.py >> newspaper.log 2>&1
Save with Ctrl+O, Enter, and leave with Ctrl+X. The five fields at the start mean minute 0, hour 7, every day of the month, every month, every day of the week. Everything the program prints goes into newspaper.log.
The Pi must be switched on at 7:00, because cron can't wake it up.
Step 8: Add the "print now" button
Save this small program as button.py in the same folder:
# button.py - "print now" button on GPIO 27 and a status LED on GPIO 17.
# LED on = ready, LED blinking = making and printing, 3 quick flashes = something went wrong.
import subprocess
import sys
from pathlib import Path
from signal import pause
from gpiozero import LED, Button
HERE = Path(__file__).resolve().parent
led = LED(17)
button = Button(27, bounce_time=0.1) # other leg of the button goes to GND
def print_now():
led.blink(on_time=0.2, off_time=0.2)
result = subprocess.run([sys.executable, str(HERE / "newspaper.py"), "--force"])
if result.returncode == 0:
led.on()
else:
led.blink(on_time=0.1, off_time=0.1, n=3, background=False)
led.on()
button.when_pressed = print_now
led.on()
print("Ready. Press the button to print today's newspaper.")
pause()
Test it with python3 button.py. Press the button: the LED blinks while the paper prints, then stays on. Press Ctrl+C to stop it. To start the button program every time the Pi starts, add one more line to your crontab (crontab -e):
@reboot cd ~/newspaper && python3 button.py >> button.log 2>&1
Restart the Pi with sudo reboot. When the LED comes on by itself, your newspaper machine is ready.
Optional: email the PDF to a phone
The program can also email the PDF, for example to a phone. Ask an adult to help, because this uses a real email account. Fill in the [email] part of newspaper.ini with your email provider's SMTP server, the port (465 for a secure SSL connection), the account and the address to send to, then change enabled = no to enabled = yes. Many providers want an app password here instead of your normal password; you make one in the account's security settings. Keep newspaper.ini private, for example with chmod 600 newspaper.ini, because it now holds a password.
Optional: let Claude write an editor's note
Your program can ask Claude, an AI model, to write two friendly sentences that sum up today's headlines. Claude's API is a paid service, and the account must belong to an adult. Ask a parent or teacher to create one (see our Claude API page), set a low monthly spend limit and create an API key. Paste the key into the [claude] part of newspaper.ini and set enabled = yes. The key works like a password, so never share the file.
editors_note() sends only the headlines to the model claude-opus-5-5. If anything goes wrong, the paper simply prints without a note.
How it works

Every morning at 7:00, cron starts newspaper.py. Part 1 reads and checks newspaper.ini. Part 2 decides whether today is a print day and works out the edition number by counting the print days since start_date.
Part 3 asks Open-Meteo for the weather. It is free for non-commercial use and needs no key. The answer comes back as JSON, and weather codes such as 3 become words like "Overcast". Part 4 downloads each RSS feed. RSS is a simple XML format that lists a site's latest stories. feedparser turns it into a list, and clean() removes any HTML. The feed's own title becomes the "Source:" line under each story.
Part 7 draws the page with reportlab's canvas. An A4 page is 595 × 842 points, and y counts up from the bottom, so the program starts near the top and moves down after every line. simpleSplit() breaks long text into lines that fit the column. Part 8 hands the PDF to lp, which passes it to CUPS, and CUPS turns it into something your printer understands.
No internet? Every download is wrapped in try and except, with a 15-second time limit. If the weather or a feed fails, the program still prints a page, with "Weather unavailable this morning" or "News unavailable this morning" in that spot. A paper with gaps is better than no paper.
When you press the button, gpiozero calls print_now(), which starts newspaper.py --force. The program ends with code 0 when it worked and 1 when printing failed, and the LED shows which.
Common problems
-
"lp: Error - No default destination": CUPS doesn't know which printer to use. Run
lpoptions -d Home_Printerwith your printer's name fromlpstat -p, or put the name afterprinter =innewspaper.ini. - The printer isn't in the CUPS list: check it is on the same Wi-Fi as the Pi, or try a USB cable. Older printers may need a driver from the maker.
-
Nothing happens at 7:00: look in
newspaper.log. If it is empty, check the crontab line withcrontab -l, and check the time zone withdate. "Not a print day" means today isn't inprint_days. - "News unavailable this morning": the Pi had no internet, or the feed address is wrong. Open the address in the browser; you should see XML, not an error page.
-
The button does nothing: check the button sits across the middle gap and the wires go to pin 13 and the (−) rail. Is
button.pyrunning? Look inbutton.log. -
Odd letters print as "?": the DejaVu fonts are missing. Install them with
sudo apt install fonts-dejavu-core.
FAQ
Can a Raspberry Pi print to a normal home printer?
Yes. Raspberry Pi OS uses CUPS, and most modern USB and Wi-Fi printers work with its driverless IPP Everywhere mode. Once the printer is added, any program can print with the lp command.
How do I make the Raspberry Pi do something at the same time every day?
Add a line to your crontab with crontab -e. The line 0 7 * * * followed by a command runs that command at 7:00 every day. The Pi has to be switched on at that time, and its time zone must be set correctly.
Do I need an API key for the weather and the news?
No. Open-Meteo gives free weather forecasts for non-commercial use without a key, and RSS feeds are public. Only the optional Claude editor's note needs an API key, from an adult's account.
Is it OK to print news headlines from RSS feeds?
For a paper that only your family reads, printing headlines and short summaries with the source on every item is how feeds are meant to be used. Each publisher has its own terms, so check them, and never sell or publish your newspaper.
What happens if the internet is down at 7:00?
The program still prints a page. Any part it couldn't download says "unavailable this morning", and the rest prints as normal.
Next lessons
- Read a push button with Python on the Raspberry Pi, if you want to practise buttons and LEDs first
- Log temperature to a database with a live web chart, and add your own room temperature to the paper
- Build a smart relay panel with timers
- Build a keypad alarm with an LCD and phone alerts