←
Daily Python Tip 🐍🐧1,531 posts
Daily Python Tip 🐍🐧 avatar

Daily Python Tip 🐍🐧

@python_tip

One #python tip per day. Do you have any? Send it to bit.ly/pythontip. Edited by @simecek, @karlafej, and... you?

◷ Joined February 2017▧ 493 Photos and videos
Daily Python Tip 🐍🐧 avatar
Daily Python Tip 🐍🐧@python_tip·Mar 29

Last week, two versions of litellm package (3.4M downloads/day) contains malicious code due to previous compromise of maintainer's PyPI credentials. This seems as a cool trick to be less vulnerable to such attacks (found on LinkedIn / Hacker news) 👇

Post attachment
Daily Python Tip 🐍🐧 avatar
Daily Python Tip 🐍🐧@python_tip·4 Nov 2025

I just discovered Behind the Commit podcast! 🎧 (hosted by Mia Bajić 🎙️) First two episodes feature Python release managers Hugo van Kemenade (3.14&3.15), Pablo Galindo Salgado (3.10&3.11), Łukasz Langa (3.8&3.9) and FastAPI creator Sebastián Ramírez open.spotify.com/show/2Z9Ewk…

Daily Python Tip 🐍🐧 avatar
Daily Python Tip 🐍🐧@python_tip·1 Nov 2024

This is neat! Instead of writing scraping methods yourself, provide a few examples and let `autoscraper` to do it for you. oxylabs.io/blog/automated-we…

If you want to automatically scrape a website with Python, use `autoscraper` 💡 Its almost magical 🪄 - Instead of writing the scraping logic manually, you provide a few sample values you'd like to scrape, and `autoscraper` will deduce the scraping rules for you. It learns the scraping rules and returns the similar elements. Then you can use this learned object with new urls to get similar content or the exact same element of those new pages. `autoscraper` doesn't require detailed XPath or CSS selectors like traditional scraping libraries. Instead, it automates the pattern recognition process by learning from the example you provide. Let's design an example where we'll scrape the latest headlines from a popular news website. (Disclaimer: Make sure you have the legal right to scrape the desired website; scraping some sites might be against their terms of service). Suppose we want to scrape the latest headlines from "BBC News" (for demonstration purposes only). Remember to replace the "BBC News headline example" with an actual headline from the BBC News page so that the model can learn from it. After running the script, you should see a list of scraped headlines.

Post attachment