@python_tipi
iAccount based inCzech Republic!
About this account
- Account based in
- Czech Republic
- Connected via
- Web
! X says this location may be affected by a proxy or VPN.
Account-level information from X, not a live location or the device used for a specific post.
the most performant Python charting library, written in Rust - for charts that need 100M points
import xy as z :-)
reflex.dev/blog/xy-python-chβ¦
In doubts which LLM to use?
uvx whichllm@latest
github.com/Andyyyy64/whichllβ¦
How to organize your .claude folder. Somebody should write the same about Cursor :-)
blog.dailydoseofds.com/p/anaβ¦
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) π
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β¦
I once told at a conference dinner: "Iβve got a PhD, but 90% of my work is just applying @fastdotai stuff"
A senior researcher nodded: "Same" π
So when the new course dropped, I needed ~60s to subscribe (2-wk refund)
solve.it.com/?via_id=gifvtbwβ¦
15% off (and yes, I get 15% too)
Python 3.14 is here! π
Highlights: free-threaded CPython (PEP 779), deferred annotations (PEP 649), t-strings (PEP 750), multiple interpreters (PEP 734), zstd module (PEP 784), faster UUID + nicer errors.
Time to upgrade & test. #Python #Py314
python.org/downloads/releaseβ¦
Two Python gems Iβve been playing with:
π Tenacity β painless retry logic for anything. No more rolling your own loops + sleeps
tenacity.readthedocs.io/en/lβ¦
β‘ DumPy β a bold rethink of NumPy: βdonβt make me think, just run (fast, on GPUs)β
dynomight.net/dumpy/
Both worth a π
Today I learned... `uv init` now not only creates a new Python environment but also creates
βββ .gitignore
βββ README.md
βββ main.py
βββ pyproject.toml
βββ .python-version
realpython.com/python-uv/#crβ¦
marimo = Jupyter for serious Python work π₯
- Pure .py files (git-friendly!)
- No more restart & run all
- Deploy as scripts OR interactive web apps
- Built-in SQL support
- Reactive cells that auto-update dependencies
marimo.io/
When I started with Python, I was confused by the murky difference between variables and references. π€
This π explains it brilliantly:
Why Python has No Variables?
medium.com/@king_star/why-pyβ¦
Happy (20 + 25)**2
Happy sum(i**3 for i in range(10))
Happy sum(i for i in range(10))**2
#HappyNewYear!
MarkItDown = a tool from Microsoft to convert Word / Excel / PPT / PDF... to Markdown
github.com/microsoft/markitdβ¦
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.
π Python environments got easier!
uv is the new rust-powered packaging tool that might finally solve the XKCD-famous dependency puzzle m.xkcd.com/1987/
Quick start:
* `uv run` for most cases
* `uv venv` for virtual envs
* `uv pip` for packages (don't mix with regular pip!)
Fast, simple, cargo-like π
For more, read
* github.com/astral-sh/uv
* astral.sh/blog/uv-unified-pyβ¦
Automate your virtualenv activation!
Using autoenv (github.com/hyperupcall/autoeβ¦), you can:
1. Automatically activate virtualenv when entering a directory
2. Run ANY command when cd-ing into a folder
Example:
# Set up autoenv
echo "source venv/bin/activate" > .env
# Or run custom commands
echo "echo 'Project: $(pwd)'" >> .env
cd ./project # Triggers .env automatically! πͺ
AI is changing how we code, but should it change how we teach Python? I've embraced LLMs for coding, especially with pandas, but I'm unsure if beginners should start this way.
Anyway, curious about the AI way? Try Andrew Ng's 'AI Python for Beginners': deeplearning.ai/short-courseβ¦
"Tired of scrolling through Jupyter notebooks on GitHub? Try nbsanity.com:
π Just replace 'github' with 'nbsanity' in the URL to get much cleaner view
π For example nbsanity.com/jakevdp/PythonDβ¦
#JupyterNotebook
#EuroPython2024 videos are live! πΊ My top 3 ML talks:
1) "From Text to Context..." about combining semantic & traditional search
youtube.com/live/vfmS8uwT448β¦
2) "Scikit-LLM..." because of beginner-friendly NLP with dynamic few-shots
youtube.com/live/m1P5baHpPvIβ¦
3) "Representation is King": quality dialog embeddings by Adam Zika
youtube.com/live/We61aNWJvTYβ¦