Watch on YouTube
About the show
Sponsored by Compiler Podcast from Red Hat.
Connect with the hosts
- Michael: @mkennedy@fosstodon.org
- Brian: @brianokken@fosstodon.org
- Show: @pythonbytes@fosstodon.org
Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too.
Michael #1: pydantic-xml extension
- via Ilan
- Recall untangle. How about some pydantic in the mix?
- pydantic-xml is a pydantic extension providing model fields xml binding and xml serialization / deserialization. It is closely integrated with pydantic which means it supports most of its features.
Brian #2: How virtual environments work
- Brett Cannon
- This should be required reading for anyone learning Python.
- Maybe right after “Hello World” and right before “My first pytest test”, approximately.
- Some history of environments
- Back in the day, there was global and your directory.
- How environments work
- structure: bin, include, and lib
- pyvenv.cfg configuration file
- How Python uses virtual environments
- What activation does, and that it’s optional.
- Yes, activation is optional.
- A new project called microvenv that helps VS Code.
- Mostly to fix the “Debian doesn’t ship python3 with venv” problem.
- It doesn’t include script activation stuff
- It’s super small, less than 100 lines of code, in one file.
Michael #3: DbDeclare
- Declarative layer for your database.
- https://raaidarshad.github.io/dbdeclare/guide/controller/#example
- Sent in by creator raaid
- DbDeclare is a Python package that helps you create and manage entities in your database cluster, like databases, roles, access control, and (eventually) more.
- It aims to fill the gap between SQLAlchemy (SQLA) and infrastructure as code (IaC).
- You can:
- Declare desired state in Python
- Avoid maintaining raw SQL
- Tightly integrate your databases, roles, access control, and more with your tables
- Migrations like alembic coming too.
Brian #4: Testing multiple Python versions with nox and pyenv
Extras
Michael:
- GitHub makes 2FA mandatory next week for active developers
- New adventure bike [image 1, image 2].
- Who’s got good ideas for where to ride in the PNW?
- Wondering why I got it, here’s a fun video.
Joke: Case of the Mondays