|
Description:
|
|
Sponsored by us! Support our work through:
Special guests:
Peter Kazarinoff
Brian #1: calmcode.io
- by Vincent D. Warmerdam
- Suggested by Rens Dimmendaal
- Great short intro tutorials & videos. Not deep dives, but not too shallow either.
- Suggestions:
- I watched the whole series on datasette this morning and learned how to
- turn a csv data file into a sqlite database
- use datasette to open a server to explore the data
- filter the data
- visualize the data with datasette-vega plugin and charting options
- learn how I can run random SQL, but it’s safe because it’s read only
- use it as an API that serves either CSV or json
- deploy it to a cloud provider by wrapping it in a docker container and deploying that
- add user authentication to protect the service
- explore tons of available data sets that have been turned into live services with datasette
Michael #2: Natural sort (aka natsort)
- via Brian Skinn
- Simple yet flexible natural sorting in Python.
- Python sort algorithm sorts lexicographically
>>> a = ['2 ft 7 in', '1 ft 5 in', '10 ft 2 in', '2 ft 11 in', '7 ft 6 in']
>>> sorted(a)
['1 ft 5 in', '10 ft 2 in', '2 ft 11 in', '2 ft 7 in', '7 ft 6 in']
natsort provides a function natsorted that helps sort lists "naturally”
>>> natsorted(a)
['1 ft 5 in', '2 ft 7 in', '2 ft 11 in', '7 ft 6 in', '10 ft 2 in']
- Other things that can be sorted:
- versions
- file paths (via
os_sorted)
- signed floats (via
realsorted)
- Can go faster using fastnumbers
Peter #3: Python controlling a helicopter on Mars.
Brian #4: Pydantic, FastAPI, Typer will all run on 3.10, 3.11, and into the future
Michael #5: Extra, Extra, Extra, Extra hear all about it
- No social trackers on Python Bytes or Talk Python.
- Python packages on Mars
- More Mars
- NordVPN and “going dark”
- Nobody wants anything to do with Google's new tracking mechanism FLoC (Android Police, Ars Technica). From EFF: Google’s pitch to privacy advocates is that a world with FLoC will be better than the world we have today, where data brokers and ad-tech giants track and profile with impunity. But that framing is based on a false premise that we have to choose between “old tracking” and “new tracking.” It’s not either-or. Instead of re-inventing the tracking wheel, we should imagine a better world without the myriad problems of targeted ads.
Peter #6: Build Python books with Jupyter-Book
- There are many static site generators for Python: Sphinx, Pelican, MkDocs…
- Jupyter-Book is a static site generator that makes online books from Jupyter notebooks and markdown files. See the Jupyter-book docs.
- Books can be published on GitHub pages and there is a GitHub action to automatically re-publish your book with each git push.
- A gallery of Jupyter-books includes: Geographic Data Science with Python, Quantitative Economics with Python, the UW Data Visualization Curriculum, and a book on Algorithms for Automated Driving. All the books are free an online.
Extras
Brian
- 2021 South African Pycon, PyConZA - https://za.pycon.org/. The conference will be on 7 and 8 October entirely online
- deadpendency update . Within a day of us talking about deadpendency last week, the project maintainer added support for pyproject.toml. So projects using poetry, flit should work now. I imagine setuptools with pyproject.toml should also work.
Peter
Joke
More code comments
// Dear future me. Please forgive me.
// I can't even begin to express how sorry I am.
try {
...
} catch (SQLException ex) {
// Basically, without saying too much, you're screwed. Royally and totally.
} catch(Exception ex){
//If you thought you were screwed before, boy have I news for you!!!
}
// This is crap code but it's 3 a.m. and I need to get this working.
One more:
From TwoHardThings by Martin Fowler:
Original saying:
There are only two hard things in Computer Science: cache invalidation and naming things.
-- Phil Karlton
Then there’s This tweet. |