Python Bytes

Informações:

Sinopsis

Python Bytes is a weekly podcast hosted by Michael Kennedy and Brian Okken. The show is a short discussion on the headlines and noteworthy news in the Python, developer, and data science space.

Episodios

  • #329 Creating very old Python code

    30/03/2023 Duración: 28min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Michael #1: Prefix-cache via Brendan Hannigan You can set an environment variable or use it as a command line argument and then instead of creating tons of __pycache__ folders to store your *.pyc files right next to the source code, it puts them in some specified folder. Introduced in python 3.8. Brian #2: NiceGUI Suggested by several listeners Browser based GUI “NiceGUI is an easy-to-use, Python-based UI framework, which shows up in your web browser. You can create buttons, dialogs, Markdown, 3D scenes, plots and much more. It is great for micro web apps, dashboards, robotics projects, smart home solutions and similar use cases. You can also use it in development, for example when tweaking/configuring a machine learning algorithm or tuning motor controllers.” - from the README Michael #3: flask-ngrok A simple way to demo Flask apps from your machine. Makes your Flask apps running on localhost available over the

  • #328 We are going to need some context here

    21/03/2023 Duración: 24min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. 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. Brian #1: zipapp Part of standard library since 3.5 Yet another thing I learned recently from Brett Cannon “This module provides tools to manage the creation of zip files containing Python code, which can be executed directly by the Python interpreter. The module provides both a Command-Line Interface and a Python API.” Including: Creating Standalone Applications with zipapp Michael #2: Reverse engineering the Apple News app with #python and #nerd power As we navigate the digital world, we often come across articles we don't have time to read but still want to save for later. One way to accomplish this is by using the Read Later feature in Apple News. Bu

  • #327 Untangling XML with Pydantic

    13/03/2023 Duración: 31min

    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

  • #326 Let's Go for a PyGWalk

    08/03/2023 Duración: 33min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. 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. Brian #1: Data Classification : Does Python still have a need for class without @dataclass? Glyph dataclasses have been in the the language since 3.7 That’s pretty much all modern Python, right? “…, is there any point to having non-@dataclass classes any more? Is there any remaining justification for writing them in new code?” Options: class just becomes a dataclass if you have typehinted members in it. data instead of class, to avoid decorators Michael #2: PyGWalker Turn your pandas dataframe into a Tableau-style User Interface for visual analysis. Works with pandas and polars Open-source alternative to Tableau It allows data scientists to analyze dat

  • #325 It's called a merge conflict

    28/02/2023 Duración: 39min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. 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: Python Parquet and Arrow: Using PyArrow With Pandas Parquet is an efficient, compressed, column-oriented storage format for arrays and tables of data. Less wrangle-able than Pandas, but way faster and lower memory Questions answered Can we use Pandas DataFrames and Arrow tables together, and if so, how is this done? (It turns out the answer is yes, and it’s quite simple, as we’ll see). In what ways are Arrow tables “better” than Pandas DataFrames? In other words, for which tasks are Arrow tables better suited? Conversely, what tasks are possible or easy in Pandas that are difficult or impossible in Arrow? As an on-disk format, how does Parquet com

  • #324 JSON in My DB?

    21/02/2023 Duración: 44min

    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 Special guest, Erin Mullaney: @erinrachel@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. Brian #1: Use TOML for .env files? Brett Cannon .env files are used to store default settings that can be overridden by environmental variables. Possibly brought on by twelve-factor app design. Supported by python-dotenv, which is also used by pydantic, pipenv, and others. One issue is that it’s not a defined standard. from python-dotenv docs “The format is not formally specified and still improves over time. That being said, .env files should mostly look like Bash files.” Adafruit decided that an upcoming CircuitPython will use TOML as the format for settings.toml files, which are to be used mostly how .en

  • #323 AI search wars have begun

    14/02/2023 Duración: 50min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org - may be a minute or two late. Show: @pythonbytes@fosstodon.org Special guest: Pamela Fox - @pamelafox@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: camply A tool to find campsites at sold out campgrounds through sites like recreation.gov and Yellowstone Finding reservations at sold out campgrounds can be tough. Searches the APIs of booking services like recreation.gov (which indexes thousands of campgrounds across the USA) to continuously check for cancellations and availabilities to pop up. Once a campsite becomes available, camply sends you a notification to book your spot! Want to camp in a tower in California? camply campgrounds --search "Fire Lookout Towers" --state CA Brian #2: hatch-fancy-pypi-readme

  • #322 Python Packages, Let Me Count The Ways

    07/02/2023 Duración: 46min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Special guest: @calvinhp@fosstodon.org Join us on YouTube at pythonbytes.fm/stream/live to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too. Brian #1: Packaging Python Projects Tutorial from PyPA This is a really good starting point to understand how to share Python code through packaging. Includes discussion of directory layout creating package files, LICENSE, pyproject.toml, README.md, tests and src dir how to fill out build-system section of pyproject.toml using either hatchling, setuptools, flit, or pdm as backends metadata using build to generate wheels and tarballs uploading with twine However For small-ish pure Python projects, I still prefer flit flit init creates pyproject.toml and LICENSE will probably still need to hand tweak pyprojec

  • #321 A Memorial To Apps Past

    30/01/2023 Duración: 36min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/stream/live to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too. Michael #1: git-sim Visually simulate Git operations in your own repos with a single terminal command. Generates an image (default) or video visualization depicting the Git command's behavior. Features Run a one-liner git-sim command in the terminal to generate a custom Git command visualization (.jpg) from your repo Supported commands: log, status, add, restore, commit, stash, branch, tag, reset, revert, merge, rebase, cherry-pick Generate an animated video (.mp4) instead of a static image using the --animate flag (note: significant performance slowdown, it is recommended to use --low-quality to speed up testing and remove when ready to generate prese

  • #320 The Bug Is In The JavaScript

    24/01/2023 Duración: 28min

    Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training Test & Code Podcast Patreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/stream/live to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too. Brian #1: markdown-it-py Yes. another markdown parser. Rich recently switched markdown parsers, from commonmark to markdown-it-py. Let’s look at those a bit. Michael #2: Sketch via Jake Firman Sketch is an AI code-writing assistant for pandas users that understands the context of your data A Natural Language interface that successfully navigates many tasks in the data stack landscape. Data Cataloging: General tagging (eg. PII identification) Metadata generation (names and descriptions) Data Engineering: Data cleaning and masking (compliance) Derived feature creation and e

  • #319 CSS-Style Queries for... JSON?

    18/01/2023 Duración: 32min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/stream/live to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too. Michael #1: Secure maintainer workflow by Ned Batchelder We are the magicians, but also the gatekeepers for our users Terminal sessions with implicit access to credentials first is unlikely: a bad guy gets onto my computer and uses the credentials to cause havoc second way is a more serious concern: I could unknowingly run evil or buggy code that uses my credentials in bad ways. Mitigations 1Password: where possible, I store credentials in 1Password, and use tooling to get them into environment variables. Side bar: Do not use lastpass, see end segment I can have the credentials in the environment for just long enough to use them. This works well for

  • #318 GIL, How We Will Miss You

    10/01/2023 Duración: 39min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Connect with us Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Join us on YouTube at pythonbytes.fm/stream/live to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too. Brian #1: PEP 703 - Making the GIL Optional in CPython Author: Sam Gross Sponsor: Łukasz Langa Draft status, but on Standards Track, targeting Python 3.12 Suggested by: Will Shanks “The GIL is a major obstacle to concurrency.” Especially for scientific computing. PEP 703 proposes adding a --without-gil build configuration to CPython to let it run code without the global interpreter lock and with the necessary changes needed to make the interpreter thread-safe. PEP includes several issues with GIL and sckikit-learn, PyTorch, Numpy, Pillow, and other numerically intensive libraries. Python’s GIL makes it difficult to use modern multi-core CPUs efficiently for ma

  • #317 Most loved and most dreaded dev tools of 2022

    03/01/2023 Duración: 48min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show: @pythonbytes@fosstodon.org Michael #1: StackOverflow 2022 Developer Survey Last year we saw Git as a fundamental tool to being a developer. This year it appears that Docker is becoming a similar fundamental tool for Professional Developers, increasing from 55% to 69%. Language: Rust is […] the most loved language with 87% of developers saying they want to continue using it. JS Frameworks: Angular.js is in its third year as the most dreaded. Let me Google that for you: 62% of all respondents spend more than 30 minutes a day searching for answers or solutions to problems. 25% spending more than an hour each day. The demise of the full-stack developer is overrated. I do wish there were more women in the field. Databases: Postgres is #1 and MongoDB is still going strong. The “which web framework do you use?” question is a full o

  • #316 Python 3.11 is here and it's fast (crossover)

    30/12/2022 Duración: 01h04min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Show announcements: @pythonbytes@fosstodon.org Hi folks. For our final episode of 2022 here on Python Bytes, we're crossing the streams with my other show, Talk Python To Me. I present to you one of the more important episodes of the year, the release of Python 3.11 with it's new features and 40% performance improvements. Thank you for listening to Python Bytes in 2022, have a great holiday break, and Brian and I will see you next week. Python 3.11 is here! Keeping with the annual release cycle, the Python core devs have released the latest version of Python. And this one is a big one. It has more friendly error messages and is massively faster than 3.10 (between 10 to 60% faster) which is a big deal for a year over year release of a 30 year old platform. On this episode, we have Irit Katriel, Pablo Galindo Salgado, Mark Sh

  • #315 Some Stickers!

    20/12/2022 Duración: 29min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Michael #1: Jupyter Server 2.0 is released! Jupyter Server provides the core web server that powers JupyterLab and Jupyter Notebook. New Identity API: As Jupyter continues to innovate its real-time collaboration experience, identity is an important component. New Authorization API: Enabling collaboration on a notebook shouldn’t mean “allow everyone with access to my Jupyter Server to edit my notebooks”. What if I want to share my notebook with e.g. a subset of my teammates? New Event System API: jupyter_events—a package that provides a JSON-schema-based event-driven system to Jupyter Server and server extensions. Terminals Service is now a Server Extension: Jupyter Server now ships the “Terminals Service” as an extension (installed and enabled by default) rather than a core Jupyter Service. pytest-jupyter: A pytest plugin for Jupyt

  • #314 What are you, a wise guy? Sort it out!

    13/12/2022 Duración: 37min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Brian #1: FAQtory Will McGugan “FAQtory is a tool to auto-generate a FAQ.md (Frequently Asked Questions) document for your project. FAQtory has a FAQ.md written by itself, so you can see an example of the project in the project. Builds a markdown FAQ.md that includes questions at the top that link to answers below. “Additionally, a ‘suggest’ feature uses fuzzy matching to reply to GitHub issues with suggestions from your FAQ.” I haven’t tried this part, but looking forward to it. May help to answer GH issues that are really questions. Michael #2: Kagi search "live with it” report Still enjoying it a lot Very fast LOVE blocking SEO-heavy, content-light sites Maps are rough around the edges Not obvious how to set as a private/incognito search engine (but can be done in settings) They have browser extensions - but I don't want

  • #313 Programming Robots With a Marker

    06/12/2022 Duración: 46min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Special guest: Kelly Schuster-Paredes Special guest: Sean Tibor Michael #1: How do you say that number? Inflect: fosstodon.org/@linuxgal@techhub.social/109430499504962727 Num2Words: pypi.org/project/num2words/ # Inflect: import inflect inflector=inflect.engine() print(inflector.number_to_words(8675309)) # eight million, six hundred and seventy-five thousand, three hundred and nine # Num2Words from num2words import num2words print(num2words(8675309)) # eight million, six hundred and seventy-five thousand, three hundred and nine Num2Words also has a CLI: pipx install num2words $ num2words 2948475 two million, nine hundred and forty-eight thousand, four hundred and seventy-five Brian #2: The Origins of Python Lambert Meertens A wonderful tale starting with TELCOMP, traveling through ABC, and finally reaching Python. This is a

  • #312 AI Goes on Trial For Writing Code

    29/11/2022 Duración: 35min

    Watch on YouTube About the show Sponsored by Complier Podcast from RedHat Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Brian #1: Coping strategies for the serial project hoarder Simon Willison Also a talk from DjangoCon2022 Massively increase your productivity on personal projects with comprehensive documentation and automated tests. I’m actually not sure what title would be best, but this is an incredible video that I’m encouraging every developer to watch, whether or not you work with open source projects. Covers The perfect commit Implementation, Tests, Documentation, and a link to an issue thread Tests Prove the implementation works, pass if it works, fails otherwise A discussion of how adding tests is way easier than starting testing a project, so get the framework in place early, and devs won’t be afraid to add to it. Cookiecutter repo templates for projects you will likely start super cool idea to have your own that you keep up to date with

  • #311 Catching Memory Leaks with ... pytest?

    24/11/2022 Duración: 49min

    Watch on YouTube About the show Python Bytes 311 Sponsored by Microsoft for Startups Founders Hub. Connect with the hosts Michael: @mkennedy@fosstodon.org Brian: @brianokken@fosstodon.org Special guest: Murilo Cunha Michael #1: Latexify We are used to turning beautiful math into programming symbols. For example: amitness.com/2019/08/math-for-programmers/#sigma Take this code: def do_math(a, b, c): return (-b + math.sqrt(b ** 2 - 4 * a * c)) / (2 * a) Add @latexify.function decorator display do_math in a notebook Get this latex: \mathrm{do_math}(a, b, c) = \frac{-b + \sqrt{b^{{2}} - {4} a c}}{{2} a} Which renders as I could only get it to install with: pip install git+https://github.com/google/latexify_py Brian #2: prefixed From Avram Lubkin “Prefixed provides an alternative implementation of the built-in float which supports formatted output with SI (decimal) and IEC (binary) prefixes.” >>> from prefixed import Float >>> f'{Float(3250):.2h}' '3.25k' >>> '{:.2h}s

  • #310 Calling All Tools for Readmes

    15/11/2022 Duración: 53min

    Watch on YouTube About the show Sponsored by Microsoft for Startups Founders Hub. Special guest: Adam Hopkins Python Web Development with Sanic Brian #1: Tips for clean code in Python Bob Belderbos Generally some great tips to think about to keep code maintainable: Smaller units. Break things up into single responsibility. SRP: Single Responsibility Principle Move magic numbers into constants or parameters. Avoid global scope. (even though it’s not really global) Use linters and auto-formatters. Use very narrow try/except blocks. Idiomatic Python. (Although I agree, this is a weird one as it’s hard for new people to follow). Pay attention to data structure choice and learn to utilize standard structures and those in collections. Use the standard libary. Use mappings Flat is better than nested. But I’m gonna focus on the “smaller units” because it applies to modules as well. Try to keep modules organized such that you can keep relevant and related code concepts in your head. Michael #2: Mastod

página 4 de 20