Podcasts about pycascades

  • 11PODCASTS
  • 27EPISODES
  • 39mAVG DURATION
  • ?INFREQUENT EPISODES
  • Sep 17, 2024LATEST

POPULARITY

20172018201920202021202220232024


Best podcasts about pycascades

Latest podcast episodes about pycascades

Python Bytes
#401 We must replace uWSGI with something else

Python Bytes

Play Episode Listen Later Sep 17, 2024 31:05


Topics covered in this episode: “We must replace uwsgi by something else” Let's build and optimize a Rust extension for Python Fake recruiter coding tests target devs with malicious Python packages Monthly PSF Board Office Hours Extras Joke Watch on YouTube About the show Sponsored by ScoutAPM: pythonbytes.fm/scout 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 Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: “We must replace uwsgi by something else” uWSGI is now in maintenance mode: https://uwsgi-docs.readthedocs.io/en/latest/ The project is in maintenance mode (only bugfixes and updates for new languages apis). Do not expect quick answers on github issues and/or pull requests (sorry for that) A big thanks to all of the users and contributors since 2009. Reasonable options look like: granian uvicorn hypercorn gunicorn (potentially with uvicorn workers for async) Brian #2: Let's build and optimize a Rust extension for Python Itamar Turner-Trauring Example: algorithm for approximating the number of unique values in a list Comparison to non-approximation non-approx is faster but uses way more memory Rust version Use Maturin and PyO3 Pull in Rust dependencies (rand for random numbers) Optimization link-time optimization faster random store hashes only Future optimizations change algorithm maybe pass numpy array instead of Python list (I'd like to see that spedup) Michael #3: Fake recruiter coding tests target devs with malicious Python packages via python weekly GitHub projects that have been linked to previous, targeted attacks in which developers are lured using fake job interviews. Attackers posing as employees of major financial services firms. This previously happened via other means such as NPM This analysis revealed that the direct parent of the detected, malicious files is a PythonPYC file, meaning that once again the team encountered malware hidden in a compiled Python file. “The README files tell would-be candidates to make sure the project is running successfully on their system before making modifications.” What can you do (according to Michael)? Try out new packages in a docker container Work on code and projects using a VM which has snapshotting (to roll back completely after you're done) Fire up a Windows desktop in the cloud for the project then destroy it Brian #4: Monthly PSF Board Office Hours “The Office Hours will be sessions where you can share with us how we can help your community, express your perspectives, and provide feedback for the PSF.” “Unless we have a dedicated topic for a session, you are not limited to talking with us about the above topics, although the discussions should be focused on Python, the PSF, and our community. If you think there's something we can help with or we should know, we welcome you to come and talk to us!” Upcoming office hours October 8th, 2024: 9pm UTC November 12th, 2024: 2pm UTC December 10th, 2024: 9pm UTC January 14th, 2025: 2pm UTC February 11th, 2025: 9pm UTC March 11th, 2025: 1pm UTC April 8th, 2025: 9pm UTC May 13th, 2025: 1pm UTC (Live from PyCon US!) June 10th, 2025: 9pm UTC July 9th, 2025: 1pm UTC August 12th, 2025: 9pm UTC Extras Brian: PyCascades CFP closes Friday, Sept 20 PyCascades is in Portland in 2025 (Feb 8 & 9) uv now supports Python 3.13.0rc2 uv self update uv venv -p 3.13 Free threaded is still an open issue Michael: Big Python Humble Bundle with both of our products Get $1,800 worth of Python content and tools for $30 and contribute to charity Includes 5 Talk Python courses Several of Brian's and his book Djangonaut Space Session 3 Applications Open! I interviewed Sarah and Tushar on Talk Python AltTab: Windows alt-tab on macOS Joke: Election joke

Python People
Pamela Fox - Teaching Python, Accessibility, and Tools

Python People

Play Episode Listen Later Jan 16, 2024 50:25


Pamela Fox is a Python Cloud Developer Advocate at Microsoft. Topics include:Girl Develop ItDjango GirlsGirls Who CodeTeaching a language vs teaching a toolWhat a dev advocate doesAccessibility (A11y) testingPlaywrightaxe-coreSnapshot testingpytest plugin authoringFlask SQLAlchemyRelearning GoLinks from the show:Python Bytes 323 with Pamela: AI search wars have begunPython Test 199 with Pamela: Is Azure Right for a Side Project?gdi: Girl Develop ItDjango GirlsGirls Who Code"Automated accessibility audits" - Pamela Fox (North Bay Python 2023)Playwrightaxe-corepytest-axe-playwright-snapshot, plugin from Pamelapytest-crayons plugin is from a PyCascades talk about building pluginspytest-check, yet another pluginFlaskSQLAlchemyConcurrency is not Parallelism by Rob Pike The Complete pytest CourseLevel up your testing skills and save time during coding and maintenance.Check out courses.pythontest.com ★ Support this podcast on Patreon ★

Python Bytes
#365 Inheritance, but not Inheritance!

Python Bytes

Play Episode Listen Later Dec 20, 2023 34:29


Topics covered in this episode: * Hatch v1.8* svcs: A Flexible Service Locator for Python Steering Council 2024 Term Election Results Python protocols. When to use them in your projects to abstract and decoupling Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training The Complete pytest Course 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/live to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too. Michael #1: Hatch v1.8 Hatch now manages installing Python for you. Hatch can build .app and .exe stand-alone binaries for you The macOS ones are signed (signed!) Discussion here Brian #2: svcs : A Flexible Service Locator for Python Hynek A library to help structure and test Python web applications. “svcs (pronounced services) is a dependency container* for Python. It gives you a central place to register factories for types/interfaces and then imperatively acquire instances of those types with automatic cleanup* and **health checks.” “Benefits: Eliminates tons of repetitive boilerplate code, unifies acquisition* and cleanups of services, provides full static type safety for them, simplifies testing through loose coupling, improves live introspection and monitoring* with **health checks.” Hynek has started a YouTube channel, and is starting with an explanation of svcs. Yes, Hynek, we want more videos. I like that it's not a beginner level. My request for future videos: just past beginner, and also intermediate level. There are plenty of basics videos out there, not as many filling the gaps between beginner and production. Michael #3: Steering Council 2024 Term Election Results The 2024 Term Python Steering Council is: Pablo Galindo Salgado Gregory P. Smith Emily Morehouse Barry Warsaw Thomas Wouters Full results are available in PEP 8105 . How do you become a candidate? Candidates must be nominated by a core team member. If the candidate is a core team member, they may nominate themselves. Brian #4: Python protocols. When to use them in your projects to abstract and decoupling Carlos Vecina “Protocols are an alternative (or a complement) to inheritance, abstract classes and Mixins.” Understanding interactions between ABC, MixIns and Protocols in Python With examples Extras Brian: Donations. It's a decent time of the year to donate to projects that help you Python Software Foundation Django Software Foundation Python Bytes Also, look for “Sponsor this project” links in GitHub for projects you depend on. Michael: Mastodon guidelines (mine): If you have a picture and description, I'll probably follow you back If you have posts that seem relevant +1 If you have a verified webpage +1 If your account is private, won't. I don't understand really since private group messages already exist and the profile itself is public. Speaking of Mastodon. I had a productive conversation with the PSF and others around masks and conferences. Dropbox spooks users by sending data to OpenAI for AI search features There was a comment in the above article to the effect of “Once you give your data to a third party (even trusted like Dropbox), you no longer control that data.” That sent me searching and thinking… sync.com? proton drive (discount code)? nextcloud? filen.io? icedrive.net? ownCloud's recent CVE makes me a bit nervous of self-hosted options. Either way, Cryptomator is very interesting. Beyond privacy, this got me thinking, just how many hours of dev time have been diverted to add mediocre-at-best AI features to everything? I'm doing a big digital decluttering and have lots to say on that soon. Not submitting my talks to PyCascades this year. But I did submit 3 talks to PyCon US.

Python Bytes
#364 Holy Match-Cases Batman!

Python Bytes

Play Episode Listen Later Dec 12, 2023 27:09


Topics covered in this episode: A Python/Django Advent calendar Dropbase helps you build internal web apps with Python Real-world match/case Extra, extra, extra, so many extras! Extras Joke Watch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python Training The Complete pytest Course 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/live to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too. Brian #1: A Python/Django Advent calendar James Bennett's take on an Advent Calendar “I'm going to try to publish one short blog post each day of Advent 2023, each covering a small but hopefully useful tip or bit of information for Python and/or Django developers” First post also discusses using enums A couple cool testing posts Don't mock Python's HTTPX I didn't know HTTPX had built in transport mocking, very cool Test your documentation doctest discussion Michael #2: Dropbase helps you build internal web apps with Python Build fullstack web apps for your internal teams. Import existing Python scripts Quickly layer UIs and granular permissions on top. Turn any SQL SELECT into an admin panel with Smart Tables. Watch the video for the zen of it. Freemium model Brian #3: Real-world match/case Ned Batchelder Structural pattern matching example taken from a GitHub bot Matching nested dictionaries, pulling out bits of data The examples of not just matching but using case [structure] if [test on component] are neat. Michael #4: Extra, extra, extra, so many extras! WAY better DNS with Bunny.net DNS Terminal Secrets essay Meet the Supporting Developer in Residence (via Pycoders) Songs in Python code BohemianRhapsody.py MoneyForNothing.py PyCascades 2024 Project names blocked on PyPI to avoid name collision for downstream free-threaded Python distributions An Open Letter to the Python Software Foundation PSF's official mission https://discuss.python.org/t/python-3-12-1-now-available/40603 https://discuss.python.org/t/python-3-11-7-is-available/40778 Obfuscated Python winning (via Johannes Lippmann) Extras Brian: Python for VSCode, Dec 2023 release, rolls out better test discovery to everyone. Forcing pip to use virtualenv Advent of Code Joke: Too many open tabs

Python People
Brett Cannon - Core Python, Fountain Pens

Python People

Play Episode Listen Later Jul 26, 2023 66:28


Topics:“I don't know about the rest of you... I came for the language, but I stayed for the community." Brett Cannon, Python Core Dev, Pycon US 2014 Opening remarksPublic speakingBeing encouraging to othersWhy CanadaMeanings of Back Bacon, Toque, and PopWalking in VancouverSnowshoeingPhilosophy and thinking logicallyProving the existence of GodRewriting code. “You're probably going to have to write this 3 times before you're happy with it.”1 week per month on technical debt.Fountain pensWriting a gratitude journalBooks“What goes on in your brain is not the same as everyone else's.”"Steeped in the world of tea." - nice punLinks from the show:Podcast interviewsDjango Chat - 20 Years of Python - Brett CannonThe Changelog - There's a whole PEP about that - Brett CannonTim Urban's TED talk which is about procrastination and not public speaking, so I have no idea what Brett is talking about. Good talk though. Brett's PyCascades talk: Python's Syntactic SugarBrian's PyCascades talk: Sharing is Caring: Sharing pytest Fixtures The Complete pytest CourseLevel up your testing skills and save time during coding and maintenance.Check out courses.pythontest.com ★ Support this podcast on Patreon ★

sharing python pep toque steeped fountain pens brett cannon brian okken pycascades
The Real Python Podcast
Volunteering, Organizing, and Finding a Python Community

The Real Python Podcast

Play Episode Listen Later Jun 9, 2023 60:33


Have you thought about getting more involved in the Python community? Are you interested in volunteering for an event or becoming an organizer? This week on the show, we speak with organizers from this year's PyCascades conference about making connections, learning new skills, and rationing your time.

Python Bytes
#328 We are going to need some context here

Python Bytes

Play Episode Listen Later Mar 21, 2023 24:48


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. But what if you want to access those articles outside the Apple News app, such as on a different device or with someone who doesn't use Apple News? Or what if you want to automatically post links to those articles on your blog? That's where the nerd powers come in. The linked article shows how to use Python to solve your own problem Leading to Rhet Turnbull's CLI: apple-news-to-sqlite Brian #3: What is a context manager? Trey Hunner Also look at all the cool goodies in contextlib from standard library @contextmanager closing suppress redirect_stdout, redirect_stderr chdir Michael #4: nox-poetry: Use Poetry inside Nox sessions via 2 people: John Hagen and Marc Prewitt This package provides a drop-in replacement for the nox.session decorator, and for the nox.Session object passed to user-defined session functions. Comes from Claudio Jolowicz's hypermodern python cookiecutter Covered this on Talk Python: talkpython.fm/episodes/show/362/hypermodern-python-projects This session performs the following steps: Build a wheel from the local package. Install the wheel as well as the pytest package. Invoke pytest to run the test suite against the installation. Consider what would happen in this session if we had imported @session from nox instead of nox_poetry: Package dependencies would only be constrained by the wheel metadata, not by the lock file. In other words, their versions would not be pinned. The pytest dependency would not be constrained at all. Poetry would be installed as a build backend every time. Extras Brian: Sharing is Caring: Sharing pytest fixtures talk availabe at about 2:40:58 on Day 2 video of PyCascades 2023. Also full Day 1 and Day 2 Michael: Wired connection to remote mesh router == wow! Using the Linksys Atlas Max 6E Joke: UnsafeWarnings

The Real Python Podcast
Django Deployment Strategies & Preparing for PyCascades 2023

The Real Python Podcast

Play Episode Listen Later Mar 3, 2023 67:41


Have you decided how you're going to deploy your Django project? Should you use a VPS or a PaaS? Christopher Trudeau is back this week, bringing another batch of PyCoder's Weekly articles and projects. We also have organizers from PyCascades to share details about this year's hybrid in-person and virtual conference.

Python Bytes
#269 Get Rich and replace your cat

Python Bytes

Play Episode Listen Later Feb 3, 2022 40:35


Watch the live stream: Watch on YouTube About the show Sponsored by Datadog: pythonbytes.fm/datadog Special guest: Luciana Brian #1:rich-cli suggested by Lance Reinsmith rich on the command line. why? syntax highlighting rich example.py rich -m README.md use -m for markdown why Will? .md seems clear enough to me. comes with themes. ex: --theme monokai formats json, --json or -j and a bunch of other features I probably won't use, but you might. alignment, maybe width, yeah, I'll probably use -w a bunch more In my .zshrc: alias cat='rich --theme monokai' after pipx install rich-cli feel free to tell me that I shouldn't used cat for looking at file contents. (although, why not?) I'm not, I'm using rich. :) Luciana #2: debugpy - a debugger for Python The debugger we use in the Python extension for VS Code Super heplful features that can save up a lot of time and a lot of folks don't seem to know about: Conditional breakpoints Helpful when you want the code to break only on a specific condition e.g. # of execution times, or when an expression is true Debug console Helpful for quick testing using the context of the program at the breakpoint Temp edits on variable values, expresison evaluation, etc. Jump to Cursor (a.k.a. Set Next Statement) Control on what is the next line the debugger will execute Including previously executed lines Brian #3: Documentation unit tests Simon Willison Post talking about using pytest and tests to check documentation. Simon has test code that introspects the code introspects the docs then makes sure some items are definitely in the docs This is used in Datasette, so you can look at the example in the repo What's tested: config options are all documented plugin hooks are documented views are all documented Cool use of parametrize to generate test cases based on introspection Nice use of fixtures Very cool idea Luciana #4: PEP 673 — Self Type Heard from Brett Cannon that it has been accepted! Interesting for me as I'm learning more about types in Python Adds a way to annotate methods that return an instance of their class Particularly interesting for subclasses, exemple they gave: from __future__ import annotations class Shape: def set_scale(self, scale: float) -> Shape: self.scale = scale return self class Circle(Shape): def set_radius(self, r: float) -> Circle: self.radius = r return self Circle().set_scale(0.5) # *Shape*, not Circle Circle().set_scale(0.5).set_radius(2.7) # => Error: Shape has no attribute set_radius Extras Luciana: Black is no longer in beta! Version 22.1.0 is out

Python Bytes
#268 Wait, you can Google that?

Python Bytes

Play Episode Listen Later Jan 27, 2022 45:09


Watch the live stream: Watch on YouTube About the show Sponsored by us: Check out the courses over at Talk Python And Brian's book too! Brian #1: (draft) PEP 679 -- Allow parentheses in assert statements Pablo Galindo Salgado This is in draft, not approved, and not scheduled for any release But it seems like a really good idea to me. assert(1 == 2, "seems like it should fail") will always pass currently since the tuple (False,"seems like it should fail") is a non-empty tuple. Current Python will emit a warning >>> assert(1 == 2, "seems like it should fail") [stdin]:1: SyntaxWarning: assertion is always true, perhaps remove parentheses? But really, why not just change the language to allow assert with or without parens. Also would allow multi-line assert statements more easily: assert ( very very long expression, "very very long " "message", ) I hope this is a slam dunk and gets in ASAP. Michael #2: Everything I googled as a dev by Sophie Koonin In an attempt to dispel the idea that if you have to google stuff you're not a proper engineer, this is a list of nearly everything I googled in a week at work Rather than my posting a huge list, check out the day logs on her post Worth calling out a few: Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? - said React upgrade then started causing some super fun errors. semantic HTML contact details - wanted to check if the [HTML_REMOVED] tag was relevant here editing host file - desperate times (and it didn't even work) Madison #3: PyCascades 2022! Another year of excellent and diverse talks across an array of subjects. Talks from some well known folks (Thursday Bram, Jay Miller) as well as first time speakers (Joseph Riddle, Isaac Na) PSF's DE&I Panel is doing a meet & greet, and they have a survey they'd like Python community members to fill out. Socials Friday & Saturday night, sprints on Sunday. Tickets are still available! Brian #4: Strict Python function parameters Seth Michael Larson We have keyword only parameters def process_data(data, *, encoding="ascii"): ... notice the * encoding has to be a keyword argument, cannot be positional. We have position only parameters: def process_data(data, /, encoding="ascii"): ... notice the / data has to be positional, cannot be passed in as a keyword argument Combine the two: def process_data(data, /, *, encoding="ascii"): ... Now data has to be positional, and encoding has to be a keyword, if present. This way a function really can only be called as intended and all uses of the function will be consistent. This is a good thing. There are many benefits, including empowering library authors to make changes without weird behaviors cropping up in user code. Commentary: extra syntax may be confusing for some new users. For a lot of library API entry points, I think this makes a lot of sense. Michael #5: mureq - vendored requests mureq is a single-file, zero-dependency alternative to python-requests Intended to be vendored in-tree by Linux systems software and other lightweight applications. Doesn't support connection pooling (but neither does requests.get()). Uses much less memory Avoids supply chain attack vulnerabilities Consider my prod branch until PRs #2 and #3 are merged. Madison #6: Openverse No, not Metaverse! Previously “CC Search” Search engine for openly licensed media, for free and public use/remix of content. Currently images & audio, hope to include video, text, 3D models down the line. Start your search here Extras Michael: We now have playable times in the transcript section (example). Very cool tool for building regex-es I used for the above: regex101.com Next video is out: Do you even need loops in Python? A Python short by Michael Kennedy Remember, we have full-text search Brian: pip-secure-install - from Brett Cannon Python Testing with pytest is, when I last checked, the #2 bestseller at Pragmatic so cool My Maui trip was also a work trip. Gave me time to completely re-read the book, make notes, and make last minute changes. Changes went in this week and tonight is my “pencils down” date. This is getting real, folks. Thanks to everyone for buying beta copies and supporting the re-write. Madison: spd.watch - new police accountability/information tool for the Seattle area Shoutout to just (mentioned in Ep 242) ghcr.io - free docker image hosting for open source projects, easy integration with GitHub Actions Joke: via Josh Thurston How did the hacker get away from the police? He just ransomware. That joke makes me WannaCry… Where do you find a hacker? In decrypt.

Python Bytes
#266 Python has a glossary?

Python Bytes

Play Episode Listen Later Jan 13, 2022 26:46


Watch the live stream: Watch on YouTube About the show Sponsored by Datadog: pythonbytes.fm/datadog Brian #1: Python glossary and FAQ Inspired by a tweet by Trey Hunner that referenced the glossary glossary All the Python and programming terms in one place Often refers to other parts of the documentation. Forget what an “abstract base class” is? Just look it up FAQ Has sections on General Python Programming Design and History Library and Extension Extending/Embedding Python on Windows Graphic User Interface “Why is Python Installed on my Computer?” Some decent reading here, actually. Example What is the difference between arguments and parameters? - that's under Programming Michael #2: Any.io Learned about it via asyncer AnyIO is an asynchronous networking and concurrency library that works on top of either asyncio or trio. It implements trio-like structured concurrency (SC) on top of asyncio Works in harmony with the native SC of trio itself Check out the features AnyIO also comes with its own pytest plugin which also supports asynchronous fixtures. Brian #3: Vaex : a high performance Python library for lazy Out-of-Core DataFrames suggested by Glen Ferguson “Vaex is a python library for lazy Out-of-Core DataFrames (similar to Pandas), to visualize and explore big tabular datasets.” out-of-core: “The term out-of-core typically refers to processing data that is too large to fit into a computer's main memory.” - from machinelearning.wtf, a Machine Learning Glossary site. nice tie in, right? Vaex uses memory mapping, a zero memory copy policy, and lazy computations. There's a great intro in the form of a presentation from SciPy 2019 Michael #4: Django Community Survey Results Only 15% of Django developers use it ONLY for work, while two thirds use it both for work and for personal, educational, or side projects. Majority use latest Django Most devs upgrade every stable release Postgres is the primary DB (MongoDB is nowhere in sight) Most sites have Redis caching tiers Michael #5: Extra, Extra, Extra, Extra: Django security releases issued: 4.0.1, 3.2.11, and 2.2.26 Static Sites with Sphinx and Markdown course by Paul Everitt is now out CalDigit Thunderbolt 4 Element Hub review (more info Video by Doc Rock, get it on Amazon here) StreamDeck setup for our live streams Michael's PyBay HTMX talk is up Python Web Conf 2022 - I'll be speaking there and we're media sponsors of the conference so use code PythonBytes@PWC2022 for 15% off, March 21-25. PyCascades 2022 is also happening soon, February 5th-6th, 2022 Joke:

Python Bytes
#255 Closember eve, the cure for Hacktoberfest?

Python Bytes

Play Episode Listen Later Oct 20, 2021 46:49


Watch the live stream: Watch on YouTube About the show Sponsored by us: Check out the courses over at Talk Python And Brian's book too! Special guest: Will McGugan Michael #1: Wrapping C++ with Cython By Anton Zhdan-Pushkin A small series showcasing the implementation of a Cython wrapper over a C++ library. C library: yaacrl - Yet Another Audio Recognition Library is a small Shazam-like library, which can recognize songs using a small recorded fragment. For Cython to consume yaacrl correctly, we need to “teach” it about the API using `cdef extern It is convenient to put such declarations in *.pxd files. One of the first features of Cython that I find extremely useful — aliasing. With aliasing, we can use names like Storage or Fingerprint for Python classes without shadowing original C++ classes. Implementing a wrapper: pyaacrl - The most common way to wrap a C++ class is to use Extension types. As an extension type a just a C struct, it can have an underlying C++ class as a field and act as a proxy to it. Cython documentation has a whole page dedicated to the pitfalls of “Using C++ in Cython.” Distribution is hard, but there is a tool that is designed specifically for such needs: scikit-build. PyBind11 too Brian #2: tbump : bump software releases suggested by Sephi Berry limits the manual process of updating a project version tbump init 1.2.2 initializes a tbump.toml file with customizable settings --pyproject will append to pyproject.toml instead tbump 1.2.3 will patch files: wherever the version listed (optional) run configured commands before commit failing commands stop the bump. commit the changes with a configurable message add a version tag push code push tag (optional) run post publish command Tell you what it's going to do before it does it. (can opt out of this check) pretty much everything is customizable and configurable. I tried this on a flit based project. Only required one change # For each file to patch, add a [[file]] config # section containing the path of the file, relative to the # tbump.toml location. [[file]] src = "pytest_srcpaths.py" search = '__version__ = "{current_version}"' cool example of a pre-commit check: # [[before_commit]] # name = "check changelog" # cmd = "grep -q {new_version} Changelog.rst" Will #3: Closember by Matthias Bussonnier Michael #4: scikit learn goes 1.0 via Brian Skinn The library has been stable for quite some time, releasing version 1.0 is recognizing that and signalling it to our users. Features: Keyword and positional arguments - To improve the readability of code written based on scikit-learn, now users have to provide most parameters with their names, as keyword arguments, instead of positional arguments. Spline Transformers - One way to add nonlinear terms to a dataset's feature set is to generate spline basis functions for continuous/numerical features with the new SplineTransformer. Quantile Regressor - Quantile regression estimates the median or other quantiles of Y conditional on X Feature Names Support - When an estimator is passed a pandas' dataframe during fit, the estimator will set a feature_names_in_ attribute containing the feature names. A more flexible plotting API Online One-Class SVM Histogram-based Gradient Boosting Models are now stable Better docs Brian #5: Using devpi as an offline PyPI cache Jason R. Coombs This is the devpi tutorial I've been waiting for. Single machine local server mirror of PyPI (mirroring needs primed), usable in offline mode. $ pipx install devpi-server $ devpi-init $ devpi-server now in another window, prime the cache by grabbing whatever you need, with the index redirected (venv) $ export PIP_INDEX_URL=http://localhost:3141/root/pypi/ (venv) $ pip install pytest, ... then you can restart the server anytime, or even offline $ devpi-server --offline tutorial includes examples, proving how simple this is. Will #6: PyPi command line Extras Brian: I've started using pyenv on my Mac just for downloading Python versions. Verdict still out if I like it better than just downloading from pytest.org. Also started using Starship with no customizations so far. I'd like to hear from people if they have nice Starship customizations I should try. vscode.dev is a thing, announcement just today Michael: PyCascades Call for Proposals is currently open Got your M1 Max? Prediction: Tools like Crossover for Windows apps will become more of a thing. Will: GIL removal https://docs.google.com/document/u/0/d/18CXhDb1ygxg-YXNBJNzfzZsDFosB5e6BfnXLlejd9l0/mobilebasic?urp=gmail_link https://lwn.net/SubscriberLink/872869/0e62bba2db51ec7a/ vscode.dev Joke: The torture never stops IE (“Safari”) Eating Glue

Sustain
BONUS - Sustain our Docs Pilot Episode

Sustain

Play Episode Listen Later Oct 11, 2021 26:35


Panelists Justin Dorfman Guest Portia Burton · Eric Holscher Show Notes Hello and welcome to Sustain! Today, we have a bonus episode for you to listen to, and we're calling it “Sustain Our Docs.” If you are looking for your place in open source, then you have found it. We'll be sharing with you a new concept around documentation and sustainability and all that kind of cool stuff. We're going to talk about how you can leverage documentation, how you can leverage content to bring more people, more attention, and more funding to your products. We will talk to experts who know how to write content engagingly, interview people who speak about the importance of content having goals, and talk to people who have successfully built projects, used excellent documentation and used the content as the pillar of their success. Our hosts are Portia Burton and Eric Holscher. Portia is the owner of Document-Write, a technical documentation agency, and Eric is the co-founder of Read the Docs, Write the Docs, EthicalAds, and PyCascades. We learn about Portia and Eric's backgrounds, businesses, and visions for this podcast. They also have conversations about the sponsorship model, the multi-pronged finding model, the meaning of funneling, and the importance of documentation and sustainability. So go ahead and download this episode now to find out much more! [00:00:38] We learn all about the hosts, Portia and Eric. [00:02:05] Portia tells us why she is super excited to talk about financial sustainability when it comes to open source projects. [00:05:35] Eric shares his thoughts on how in the software ecosystem, documentation is a huge part of how people get involved in projects, and he talks more about documentation and sustainability. [00:08:09] Portia wonders what kind of conversation Eric has when talking to a maintainer of an open source project about economic sustainability and its connection to documentation. [00:09:18] We learn more about EthicalAds and the sponsorship model. [00:13:45] Portia goes deeper into the multi-pronged funding model. [00:17:01] Eric explains more about what they mean by “funnelling.” [00:18:27] Portia and Eric explain what this podcast is all about. [00:21:50] We learn from Portia why money was the most off-putting part about open source and one of the biggest problems she had with having conversations about money. [00:24:29] Eric touches on the huge benefits to having really good documentation and some great teasers are mentioned for future episodes. Quotes [00:02:58] “I guess you know the vision is I want to see open source developers get paid.” [00:03:14] “And it just breaks my heart to see such talented, smart people not know how to make that next step and to be able to take a little bit of value or monetize, basically the gifts they put out in the world.” [00:04:45] “So I think documentation is a form of ethical content marketing.” [00:07:12] “Yeah, it's one of those things that really brings me a lot of joy is seeing success in open source and people getting paid for the work that they're doing.” [00:09:44] “And advertising is one of the ways, but I think developers know all the issues with online advertising around privacy and everything else.” [00:10:44 “Sponsorship model is a model that you see in other industries such as fitness and beauty, and it's definitely something that open source projects could emulate as well.” [00:13:52] “I think we also need to have more conversations in the open source community about having different revenue streams, as opposed to depending on one.” [00:17:10] “It's all the stuff that the successful projects are already doing.” [00:18:04] “And when you write documentation, when you write your blog posts, you're actively finding your people, and how beautiful is that?” [00:20:42] “ And I'm just remembering, I ran into this thing in the Dev Rel World called the “Orbit Model” or something, and I do think that was a way of rebranding funnels in a way that's a little bit less kinda loaded already.” [00:23:28] “I just think about the person who's dropped from a bootcamp and they go into the ecosystem of software or whatever and they're trying to learn how to be a developer, and they run into so many terrible documentation sites and software that they actually think that the problem is them, when actually the problem is the terrible state of documentation and in many parts of the ecosystem, and working to improve that situation is a huge benefit to lots of people.” Links SustainOSS (https://sustainoss.org/) SustainOSS Twitter (https://twitter.com/SustainOSS?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor) SustainOSS Discourse (https://discourse.sustainoss.org/) Portia Burton Linkedin (https://www.linkedin.com/in/portialburton) Portia Burton Twitter (https://twitter.com/agencycecil?lang=en) DocumentWrite (https://documentwrite.dev/) Eric Holscher Linkedin (https://www.linkedin.com/in/eric-holscher-2b975111b) Eric Holscher Twitter (https://twitter.com/ericholscher?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor) Eric Holscher Website (https://ericholscher.com/) Read the Docs (https://readthedocs.org/) Write the Docs (https://www.writethedocs.org/) Ethical Ads (https://www.ethicalads.io/) PyCascades (https://2021.pycascades.com/) Credits Produced by Justin Dorfman (https://www.justindorfman.com/) Edited by Paul M. Bahr at Peachtree Sound (https://www.peachtreesound.com/) Show notes by DeAnn Bahr at Peachtree Sound (https://www.peachtreesound.com/) Special Guests: Eric Holscher and Portia Burton.

pilot write quotes edited docs sustain bahr paul m eric holscher pycascades portia burton
Talk Python To Me - Python conversations for passionate developers
#331: Meet the Python Developer in Residence: Lukasz Langa

Talk Python To Me - Python conversations for passionate developers

Play Episode Listen Later Aug 27, 2021 66:21


Python is a technology and community built upon the goodwill and volunteer time of 1,000s of contributors from the core devs inside CPython to the authors of 100,000s of external packages on PyPI. Until recently, the only full time folks have been at the PSF doing very important work but that work has been largely outside of CPython the technology. In July, 2021, the PSF created the Python Developer in Residence position. The first person in that role is Łukasz Langa and he's here to tell us how it's going and how it will benefit Python at large. Links from the show Łukasz Langa on twitter: @llanga Black: github.com/psf/black CPython PRs: github.com Weekly reports: lukasz.langa.pl Visionary Sponsors: python.org/psf/sponsorship/sponsors What do you get when you sponsor the PSF?: www.python.org/sponsors/application Brett Canon's PyCascades talk: youtube.com Django fellowship program: djangoproject.com Lukasz's prior episodes: Gradual Typing of Production Applications: talkpython.fm/151 Dive into CPython 3.8 and beyond: talkpython.fm/214 Python Language Summit 2018: talkpython.fm/179 Episode transcripts: talkpython.fm Sponsors Talk Python Training AssemblyAI

The ReadME Podcast
Humanizing bots and building community

The ReadME Podcast

Play Episode Listen Later May 24, 2021 32:21


When Mariatta Wijaya arrived in Canada from Indonesia, she got a job as a software developer, and the first language she learned was Python. Now a Python core developer, she creates GitHub bots that are not just functional, but friendly. She's also the co-organizer of Vancouver PyLadies and the PyCascades conference, was nominated twice for the Google Open Source Peer Bonus Program, and has received the Python Software Foundation (PSF) community service award. Hear how it all unfolded on Mariatta's episode, available now.

Educative Sessions
#58: "PuPPys Welcome! Lessons From an Expert Python Community Organizer" with Alan Vezina of LabKey Software | Educative Sessions

Educative Sessions

Play Episode Listen Later Apr 5, 2021 24:11


Alan Vezina has helped build two successful tech communities from the ground up, Puget Sound Programming Python (PuPPy), and PyCascades. Nearly everything that could have gone wrong has, but it hasn't prevented PuPPy or PyCascades from thriving. PyCascades has sold out every single year, and despite leadership changing quite a lot over time, it has continued to be a success, even during a pandemic. Watch the YouTube HERE: https://youtu.be/d1f1UyvoM7o   ABOUT OUR GUEST   Alan Vezina is a Software Engineer, Community Organizer, Painter, and Home Chef. You can find Alan on twitter @fancysandwiches where he posts his new paintings regularly. Don't forget to subscribe to Educative Sessions on YouTube! ►► https://bit.ly/39sIrUN   ABOUT EDUCATIVE   Educative (educative.io) provides interactive and adaptive courses for software developers. Whether it’s beginning to learn to code, grokking the next interview, or brushing up on frontend coding, data science, or cybersecurity, Educative is changing how developers continue their education. Stay relevant through our pre-configured learning environments that adapt to match a developer’s skill level. Educative provides the best author platform for instructors to create interactive and adaptive content in only a few clicks.   More Videos from Educative Sessions: https://www.youtube.com/channel/UCT_8FqzTIr2Q1BOtvX_DPPw/   Episode 58: "PuPPys Welcome! Lessons From an Expert Python Community Organizer" with Alan Vezina of LabKey Software | Educative Sessions

The Real Python Podcast
Creating an Interactive Online Python Conference for PyCascades 2021

The Real Python Podcast

Play Episode Listen Later Jan 22, 2021 64:19


How do you create a virtual conference that retains the interactivity of an in-person event? What are the tools needed for talk submissions, ticketing, and live hosting? Can you find those tools written in Python? This week on the show, we have several of the organizers of the PyCascades 2021 conference. They share the process of restructuring a Python conference to meet those challenges.

Python Bytes
#217 Use your cloud SSD for fast, cross-process caching

Python Bytes

Play Episode Listen Later Jan 19, 2021 38:38


Sponsored by Linode! pythonbytes.fm/linode Special guest: Ogi Moore Watch the live stream on YouTube. Michael #1: diskcache via Ian Maurer Python disk-backed cache (Django-compatible). Faster than Redis and Memcached. Pure-Python. The cloud-based computing of 2020 puts a premium on memory. Gigabytes of empty space is left on disks as processes vie for memory. Among these processes is Memcached (and sometimes Redis) which is used as a cache. Wouldn't it be nice to leverage empty disk space for caching? Features: Pure-Python Fully Documented Benchmark comparisons (alternatives, Django cache backends) 100% test coverage Hours of stress testing Performance matters Django compatible API Thread-safe and process-safe Supports multiple eviction policies (LRU and LFU included) Keys support "tag" metadata and eviction Developed on Python 3.8 Tested on CPython 3.5, 3.6, 3.7, 3.8 Tested on Linux, Mac OS X, and Windows Tested using Travis CI and AppVeyor CI Brian #2: TOML is 1.0.0 now. What does that mean for Python? Hopefully, some kind of toml parser will make it into Python core. Any Python access to 1.0.0? Mixed Implementations and TOML version support page lists: pytomlpp supports 1.0.0-rc.3, which is a wrapper around C++ tomlplusplus, which does support 1.0.0. Confusing tomlkit supports 1.0.0-rc.1, so that’s promising toml supports 0.5.0, great name. It’d be cool if it would support 1.0.0 What’s different between 0.5.0 and 1.0.0? Unless I’m mistaken, not much: CHANGELOG 1.0.0-rc1 Leading zeroes in exponent parts of floats are permitted. Allow raw tab characters in basic strings and multi-line basic strings. Allow heterogenous values in arrays. Other than that, lots of “Clarify …”, which I’m not sure how those all affect implementation. I’d love to hear more from people who know more about this Ogi #3: pyqtgraph pyqtgraph - plotting library, for when you need fast/interactive plots Uses qt5 (and soon qt6) bindings to generate plots within Qt applications Fills a niche role, want easy mouse interactivity, running locally on a machine Often used in engineering/scientific applications when looking at a lot of data, and wanting interactivity Michael #4: Parler + Python = Insurrection in public via Jim Kring and Mark Little According to Wikipedia: Parler (/ˈpɑːrlər/) is an American alt-tech microblogging and social networking service. Parler has a significant user base of Donald Trump supporters, conservatives, conspiracy theorists, and right-wing extremists. ArsTechnica article send in by Mark Little Ars: Parler’s amateur coding could come back to haunt Capitol Hill rioters Coding mess A key reason for her success: Parler’s site was a mess. Its public API used no authentication. When users deleted their posts, the site failed to remove the content and instead only added a delete flag to it. Oh, and each post carried a numerical ID that was incremented from the ID of the most recently published one. Another amateur mistake was Parler’s failure to scrub geolocations from images and videos posted online. Some 80 terabytes of posts, 1M videos, many already deleted, preserved for posterity. Catalog and Python pointed out by Shaun King. See the catalog (maybe, it’s the ugly side of people). The gist: https://gist.github.com/kylemcdonald/d8884da1a82ef50754ee49e0b6561071 Partially back online with Russian hosting service? Brian #5: Best-of Web Development with Python Suggested by Douglas Nichols Cool list with nice icons Covers Frameworks, HTTP Clients, Servers Auth tools, HTML Processing, URL utilities OpenAPI, GraphQL, Websocket RPC, Serverless, Content Management Web Testing, Web Forms, Markdown Third-party APIs Email, Web Scraping & Crawling, Monitoring Admin UI API Proxies Flask/FastAPI/Pyramid/Django Utilities Nice to see lots of FastAPI projects: fastapi-sqlalchemy - Adds simple SQLAlchemy support to FastAPI. fastapi-plugins - FastAPI framework plugins. fastapi_contrib - Opinionated set of utilities on top of FastAPI. starlette_exporter - Prometheus exporter for Starlette and FastAPI. fastapi-utils - Reusable utilities for FastAPI. fastapi-code-generator - This code generator creates FastAPI app from an.. slowapi - A rate limiter for Starlette and FastAPI. fastapi-versioning - api versioning for fastapi web applications. fastapi-react - Cookiecutter Template for FastAPI + React Projects. Using.. fastapi_cache - FastAPI simple cache. Ogi #6: Assorted Pyjion - https://github.com/tonybaloney/Pyjion a JIT extension for CPython that compiles python code using .NET 5 CLR CuPy - NumPy compatible multi-dimensional array on CUDA, uses _``*array_function_* (enabled with numpy 1.17) code using numpy to operate directly on CuPy arrays see NEP-18 and CuPy docs compatible with other libraries as well Extras: Michael: Trying Firefox + Brave + VPN Python Web Conf 2021 call for talks, due Jan 29, I’ll be speaking! PyCon US 2021 launched call for proposals: December 22, 2020 — Call for proposals opened February 12, 2021 — Proposals are due March 16, 2021 — Notifications will be sent to presenters March 23, 2021 — Deadline for speakers to confirm participation March 30, 2021 — Schedule is publicly released April 28, 2021 — Deadline to submit pre-recorded presentation (tutorials will be live) May 12-13, 2021 — Tutorial days May 15-16, 2021 — Conference days Apple launching Racial Equity and Justice Initiatives with partners across a broad range of industries and backgrounds — from students to teachers, developers to entrepreneurs, and community organizers to justice advocates Brian: PyCascades 2021 schedule https://2021.pycascades.com/program/schedule/ Ogi: Anthony Explains Video Series Learn X in Y minutes Reading Working in Public by Nadia Eghbal - provides some sanity checks for existing maintainers, might be a fantastic perspective for new contributors to open source Joke Tech Support, 2x Working at the help desk? Get the theme song: Here to help song And help by chat: "Running a successful open source project is just Good Will Hunting in reverse, where you start out as a respected genius and end up being a janitor who gets into fights." - Byrne Hobart

Python Bytes
#169 Jupyter Notebooks natively on your iPad

Python Bytes

Play Episode Listen Later Feb 19, 2020 25:44


Sponsored by Datadog: pythonbytes.fm/datadog Brian #1: D-Tale suggested by @davidouglasmit via twitter “D-Tale is the combination of a Flask back-end and a React front-end to bring you an easy way to view & analyze Pandas data structures. It integrates seamlessly with ipython notebooks & python/ipython terminals. Currently this tool supports such Pandas objects as DataFrame, Series, MultiIndex, DatetimeIndex & RangeIndex.” way cool UI for visualizing data Live Demo shows Describe shows column statistics, graph, and top 100 values filter, correlations, charts, heat map Michael #2: Carnets by Nicolas Holzschuch A standalone Jupyter notebooks implementation for iOS. The power of Jupyter notebooks. In your pocket. Anywhere. Everything runs on your device. No need to setup a server, no need for an internet connection. Standard packages like Numpy, Matplotlib, Sympy and Pandas are already installed. You're ready to edit notebooks. Carnets uses iOS 11 filesharing ability. You can store your notebooks in iCloud, access them using other apps, share them. Extended keyboard on iPads, you get an extended toolbar with basic actions on your keyboard. Install more packages: Add more Python packages with %pip (if they are pure Python). OpenSource: Carnets is entirely OpenSource, and released under the FreeBSD license. Brian #3: BeeWare Podium suggested by Katie McLaughlin, @glasnt on twitter NOT a pip install, download a binary from https://github.com/beeware/podium/releases Linux and macOS Still early, so you gotta do the open and trust from the apps directory thing for running stuff not from the app store. But Oh man is it worth it. HTML5 based presentation frameworks are cool. run a presentation right in your browser. My favorite has been remark.js presenter mode, notes are especially useful while practicing a talk running timer super helpful while giving a talk write talk in markdown, so it’s super easy to version control issues: presenter mode, full screen, with extended monitor hard to do. notes and timer on laptop, full presentation on extended screen super cool but requires full screening with mouse Podium uses similar syntax as remark.js and I think uses remark under the hood. but it’s a native app, not a browser Handles the presenter mode and extended screen smoothly, like keynote and others. Removes the need for boilerplate html in your markdown file (remark.js md files have cruft). Can’t wait to try this out for my next presentation Michael #4: pytest-mock-resources via Daniel Cardin pytest fixture factories to make it easier to test against code that depends on external resources like Postgres, Redshift, and MongoDB. Code which depends on external resources such a databases (postgres, redshift, etc) can be difficult to write automated tests for. Conventional wisdom might be to mock or stub out the actual database calls and assert that the code works correctly before/after the calls. Whether the actual query did the correct thing truly requires that you execute the query. Having tests depend upon a real postgres instance running somewhere is a pain, very fragile, and prone to issues across machines and test failures. Therefore pytest-mock-resources (primarily) works by managing the lifecycle of docker containers and providing access to them inside your tests. Brian #5: How James Bennet is testing in 2020 Follow up from Testing Django applications in 2018 Favors unittest over pytest. tox for testing over multiple Django and Python versions, including tox-travis plugin pyenv for local Python installation management and pyenv-virtualenv plugin for venvs. Custom runtests.py for setting up environment and running tests. Changed to src/ directory layout. Coverage and reporting failure if coverage dips, with a healthy perspective: “… this isn’t because I have 100% coverage as a goal. Achieving that is so easy in most projects that it’s meaningless as a way to measure quality. Instead, I use the coverage report as a canary. It’s a thing that shouldn’t change, and if it ever does change I want to know, because it will almost always mean something else has gone wrong, and the coverage report will give me some pointers for where to look as I start investigating.” Testing is more than tests, it’s also black, isort, flake8, mypy, and even spell checking sphinx documentation. Using tox.ini for utility scripts, like cleanup, pipupgrade, … Michael #6: Python and PyQt: Building a GUI Desktop Calculator by by Leodanis Pozo Ramos at realpython Some interesting take-aways: Basics of PyQt Widgets: QWidget is the base class for all user interface objects, or widgets. These are rectangular-shaped graphical components that you can place on your application’s windows to build the GUI. Layout Managers: Layout managers are classes that allow you to size and position your widgets at the places you want them to be on the application’s form. Main Windows: Most of the time, your GUI applications will be Main Window-Style. This means that they’ll have a menu bar, some toolbars, a status bar, and a central widget that will be the GUI’s main element. Applications: The most basic class you’ll use when developing PyQt GUI applications is QApplication. This class is at the core of any PyQt application. It manages the application’s control flow as well as its main settings. Signals and Slots: PyQt widgets act as event-catchers. Widgets always emit a signal, which is a kind of message that announces a change in its state. Due to Qt licensing, you can only use the free version for non-commercial projects or internal non-redistributed or purchase a commercial license for $5,500/yr/dev. Extras Brian PyCascades 2020 livestream videos of day 1 & day 2 are available. Huge shout-out and thank you to all of the volunteers for this event. In particular Nina Zakharenko for calming me down before my talk. Michael Recording for Python for .NET devs webcast available. Take some of our free courses with our mobile app. Joke Why do programmers confuse Halloween with Christmas? Because OCT 31 == DEC 25. Speed dating is useless. 5 minutes is not enough to properly explain the benefits of the Unix philosophy.

Google Cloud Platform Podcast
Python with Katie McLaughlin

Google Cloud Platform Podcast

Play Episode Listen Later Feb 18, 2020 28:20


Aja Hammerly and Brian Dorsey are here this week to start off a new year of podcasts! In an interview with Google Developer Advocate Katie McLaughlin, we talk about the advantages of Python 3 and why version 2 has been retired, as well as the cool things you can do with Django. Later, Katie discusses the complexities of deployment and how she makes it work smoothly with GCP, and we have some fun with emojis! Katie McLaughlin Katie has worn many different hats over the years. She is currently a Developer Advocate at Google Cloud, and a Director of the Python Software Foundation. When she’s not changing the world, she enjoys making tapestries, cooking, and seeing just how well various application stacks handle emoji. Cool things of the week Running workloads on dedicated hardware just got better blog Container security summit is going on as we record this site Easily upgrade Windows Server 2008 R2 while migrating to Google Cloud blog Launch of the BigQuery Weekly Data Challenge! site New data engineering learning path site Interview Python Software Foundation site PyCascades site Django Demo site Emojipedia site App Engine site Compute Engine site Cloud Run site Cloud Build site Secrets Manager site Kakapo Mountain Parrot site The Power ⚡️ and Responsibility 😓 of Unicode Adoption ✨ video Question of the week I need to run something later, but Cron isn’t a good fit. What do I do? Where can you find us next? We’ll be at Cloud Next in San Francisco in April! Katie will also be at PyCon US in April! Sound Effects Attribution “African Gray” by Jmagiera of Freesound.org

Python Bytes
#167 Cheating at Kaggle and uWSGI in prod

Python Bytes

Play Episode Listen Later Feb 3, 2020 28:30


Sponsored by Datadog: pythonbytes.fm/datadog Special guest: Vicki Boykis: @vboykis Michael #1: clize: Turn functions into command-line interfaces via Marcelo Follow up from Typer on episode 164. Features Create command-line interfaces by creating functions and passing them to [clize.run](https://clize.readthedocs.io/en/stable/api.html#clize.run). Enjoy a CLI automatically created from your functions’ parameters. Bring your users familiar --help messages generated from your docstrings. Reuse functionality across multiple commands using decorators. Extend Clize with new parameter behavior. I love how this is pure Python without its own API for the default case Vicki #2: How to cheat at Kaggle AI contests Kaggle is a platform, now owned by Google, that allows data scientists to find data sets, learn data science, and participate in competitions Many people participate in Kaggle competitions to sharpen their data science/modeling skills Recently, a competition that was related to analyzing pet shelter data resulted in a huge controversy Petfinder.my is a platform that helps people find pets to rescue in Malaysia from shelters. In 2019, they announced a collaboration with Kaggle to create a machine learning predictor algorithm of which pets (worldwide) were more likely to be adopted based on the metadata of the descriptions on the site. The total prize offered was $25,000 After several months, a contestant won. He was previously a Kaggle grandmaster, and won $10k. A volunteer, Benjamin Minixhofer, offered to put the algorithm in production, and when he did, he found that there was a huge discrepancy between first and second place Technical Aspects of the controversy: The data they gave asked the contestants to predict the speed at which a pet would be adopted, from 1-5, and included input features like type of animal, breed, coloration, whether the animal was vaccinated, and adoption fee The initial training set had 15k animals and the teams, after a couple months, were then given 4k animals that their algorithms had not seen before as a test of how accurate they were (common machine learning best practice). In a Jupyter notebook Kernel on Kaggle, Minixhofer explains how the winning team cheated First, they individually scraped Petfinder.my to find the answers for the 4k test data Using md5, they created a hash for each unique pet, and looked up the score for each hash from the external dataset - there were 3500 overlaps Did Pandas column manipulation to get at the hidden prediction variable for every 10th pet and replaces the prediction that should have been generated by the algorithm with the actual value Using mostly: obfuscated functions, Pandas, and dictionaries, as well as MD5 hashes Fallout: He was fired from H20.ai Kaggle issued an apology Michael #3: Configuring uWSGI for Production Deployment We run a lot of uWSGI backed services. I’ve spoken in-depth back on Talk Python 215: The software powering Talk Python courses and podcast about this. This is guidance from Bloomberg Engineering’s Structured Products Applications group We chose uWSGI as our host because of its performance and feature set. But, while powerful, uWSGI’s defaults are driven by backward compatibility and are not ideal for new deployments. There is also an official Things to Know doc. Unbit, the developer of uWSGI, has “decided to fix all of the bad defaults (especially for the Python plugin) in the 2.1 branch.” The 2.1 branch is not released yet. Warning, I had trouble with die-on-term and systemctl Settings I’m using: # This option tells uWSGI to fail to start if any parameter # in the configuration file isn’t explicitly understood by uWSGI. strict = true # The master uWSGI process is necessary to gracefully re-spawn # and pre-fork workers, consolidate logs, and manage many other features master = true # uWSGI disables Python threads by default, as described in the Things to Know doc. enable-threads = true # This option will instruct uWSGI to clean up any temporary files or UNIX sockets it created vacuum = true # By default, uWSGI starts in multiple interpreter mode single-interpreter = true # Prevents uWSGI from starting if it is unable to find or load your application module need-app = true # uWSGI provides some functionality which can help identify the workers auto-procname = true procname-prefix = pythonbytes- # Forcefully kill workers after 60 seconds. Without this feature, # a stuck process could stay stuck forever. harakiri = 60 harakiri-verbose = true Vicki #4: Thinc: A functional take on deep learning, compatible with Tensorflow, PyTorch, and MXNet A deep learning library that abstracts away some TF and Pytorch boilerplate, from Explosion Already runs under the covers in SpaCy, an NLP library used for deep learning type checking, particularly helpful for Tensors: PyTorchWrapper and TensorFlowWrapper classes and the intermingling of both Deep support for numpy structures and semantics Assumes you’re going to be using stochastic gradient descent And operates in batches Also cleans up the configuration and hyperparameters Mainly hopes to make it easier and more flexible to do matrix manipulations, using a codebase that already existed but was not customer-facing. Examples and code are all available in notebooks in the GitHub repo Michael #5: pandas-vet via Jacob Deppen A plugin for Flake8 that checks pandas code Starting with pandas can be daunting. The usual internet help sites are littered with different ways to do the same thing and some features that the pandas docs themselves discourage live on in the API. Makes pandas a little more friendly for newcomers by taking some opinionated stances about pandas best practices. The idea to create a linter was sparked by Ania Kapuścińska's talk at PyCascades 2019, "Lint your code responsibly!" Vicki #6: NumPy beginner documentation NumPy is the backbone of numerical computing in Python: Pandas (which I mentioned before), scikit-learn, Tensorflow, and Pytorch, all lean heavily if not directly depend on its core concepts, which include matrix operations through a data structure known as a NumPy array (which is different than a Python list) - ndarray Anne Bonner wrote up new documentation for NumPy that introduces these fundamental concepts to beginners coming to both Python and scientific computing Before, you went directly to the section about arrays and had to search through it find what you wanted. The new guide, which is very nice, includes a step-by-step on how arrays work, how to reshape them, and illustrated guides on basic array operations. Extras: Vicki I write a newsletter, Normcore Tech, about all things tech that I’m not seeing covered in the mainstream tech media. I’ve written before about machine learning, data for NLP, Elon Musk memes, and Nginx. There’s a free version that goes out once a week and paid subscribers get access to one more newsletter per week, but really it’s more about the idea of supporting in-depth writing about tech. vicki.substack.com Michael: pip 20.0 Released - Default to doing a user install (as if --user was passed) when the main site-packages directory is not writeable and user site-packages are enabled, cache wheels built from Git requirements, and more. Homebrew: brew install python@3.8 Joke: An SEO expert walks into a bar, bars, pub, public house, Irish pub, tavern, bartender, beer, liquor, wine, alcohol, spirits...

Python Bytes
#164 Use type hints to build your next CLI app

Python Bytes

Play Episode Listen Later Jan 16, 2020 29:02


Sponsored by Datadog: pythonbytes.fm/datadog Michael #1: Data driven journalism via cjworkbench via Michael Paholski The data journalism platform with built in training Think spreadsheet + ETL automation Designed around modular tools for data processing -- table in, table out -- with no code required Features include: Modules to scrape, clean, analyze and visualize data An integrated data journalism training program Connect to Google Drive, Twitter, and API endpoints. Every action is recorded, so all workflows are repeatable and transparent All data is live and versioned, and you can monitor for changes. Write custom modules in Python and add them to the module library Brian #2: remi: A Platform-independent Python GUI library for your applications. Python REMote Interface library. “Remi is a GUI library for Python applications which transpiles an application's interface into HTML to be rendered in a web browser. This removes platform-specific dependencies and lets you easily develop cross-platform applications in Python!” No dependencies. pip install git+https://github.com/dddomodossola/remi.git doesn’t install anything else. Yes. Another GUI in a web page, but for quick and dirty internal tools, this will be very usable. Basic app: import remi.gui as gui from remi import start, App class MyApp(App): def __init__(self, *args): super(MyApp, self).__init__(*args) def main(self): container = gui.VBox(width=120, height=100) self.lbl = gui.Label('Hello world!') self.bt = gui.Button('Press me!') self.bt.onclick.do(self.on_button_pressed) container.append(self.lbl) container.append(self.bt) return container def on_button_pressed(self, widget): self.lbl.set_text('Button pressed!') self.bt.set_text('Hi!') start(MyApp) Michael #3: Typer Build great CLIs. Easy to code. Based on Python type hints. Typer is FastAPI's little sibling. And it's intended to be the FastAPI of CLIs. Just declare once the types of parameters (arguments and options) as function parameters. You do that with standard modern Python types. You don't have to learn a new syntax, the methods or classes of a specific library, etc. Based on Click Example (min version) import typer def main(name: str): typer.echo(f"Hello {name}") if __name__ == "__main__": typer.run(main) Brian #4: Effectively using Matplotlib Chris Moffitt “… I think I was a little premature in dismissing matplotlib. To be honest, I did not quite understand it and how to use it effectively in my workflow.” That very much sums up my relationship with matplotlib. But I’m ready to take another serious look at it. one reason for complexity is 2 interfaces MATLAB like state-based interface object based interface (use this) recommendations: Learn the basic matplotlib terminology, specifically what is a Figure and an Axes . Always use the object-oriented interface. Get in the habit of using it from the start of your analysis. Start your visualizations with basic pandas plotting. Use seaborn for the more complex statistical visualizations. Use matplotlib to customize the pandas or seaborn visualization. Runs through an example Describes figures and plots Includes a handy reference for customizing a plot. Related: StackOverflow answer that shows how to generate and embed a matplotlib image into a flask app without saving it to a file. Style it with pylustrator.readthedocs.io :) Michael #5: Django Simple Task django-simple-task runs background tasks in Django 3 without requiring other services and workers. It runs them in the same event loop as your ASGI application. Here’s a simple overview of how it works: On application start, a queue is created and a number of workers starts to listen to the queue When defer is called, a task(function or coroutine function) is added to the queue When a worker gets a task, it runs it or delegates it to a threadpool On application shutdown, it waits for tasks to finish before exiting ASGI server It is required to run Django with ASGI server. Example from django_simple_task import defer def task1(): time.sleep(1) print("task1 done") async def task2(): await asyncio.sleep(1) print("task2 done") def view(requests): defer(task1) defer(task2) return HttpResponse(b"My View") Brian #6: PyPI Stats at pypistats.org Simple interface. Pop in a package name and get the download stats. Example use: Why is my open source project now getting PRs and issues? I’ve got a few packages on PyPI, not updated much. cards and submark are mostly for demo purposes for teaching testing. pytest-check is a pytest plugin that allows multiple failures per test. I only hear about issues and PRs on one of these. So let’s look at traffic. cards: downloads day: 2 week: 24 month: 339 submark: day: 5 week: 9 month: 61 pytest-check: day: 976 week: 4,524 month: 19,636 That totally explains why I need to start actually supporting pytest-check. Cool. Note: it’s still small. Top 20 packages are all downloaded over 1.3 million times per day. Extras: Comment from January Python PDX West meetup “Please remember to have one beginner friendly talk per meetup.” Good point. Even if you can’t present here in Portland / Hillsboro, or don’t want to, I’d love to hear feedback of good beginner friendly topics that are good for meetups. PyCascades 2020 discount code listeners-at-pycascades for 10% off FireFox 72 is out with anti-fingerprinting and PIP - Ars Technica Joke: Language essays comic

Test & Code - Python Testing & Development
71: Memorable Tech Talks, The Ultimate Guide - Nina Zakharenko

Test & Code - Python Testing & Development

Play Episode Listen Later Apr 5, 2019 48:32


Nina Zakharenko gives some great advice about giving tech talks. We talk about a blog series that Nina wrote called "The Ultimate Guide To Memorable Tech Talks". This episode is full of great help and encouragement for your own public speaking adventures. Some of what we discuss: * overcoming the fear of public speaking * breathing and pausing during talks * planning your talk as well as planning your time to get ready for the talk * writing proposals and getting feedback on proposals * Nina's talk in PyCascades on programming Adafruit chips * types of talks that are often rejected * pre-recording demos to avoid live demo problems * why you should speak, even if you are an introvert * benefits of public speaking * a super cool announcement at the end Special Guest: Nina Zakharenko.

Test & Code - Python Testing & Development
Genesynth, nox, urllib3, & PyCascades - Thea Flowers

Test & Code - Python Testing & Development

Play Episode Listen Later Dec 21, 2018 31:05


Thea Flowers is a Pythonista and open source advocate. She helps empower developers of all backgrounds and experience levels using Python and open source software and hardware. Thea is the creator of Nox, the co-chair of PyCascades 2019, the lead maintainer of urllib3, and a member of the Python Packaging Authority and Packaging Working Group. Thea works on Google Cloud Platform's wonderful Developer Relations team where she works on API client libraries and community outreach. All of that is definitely cool enough. But she is also building a synthesiser based on Sega Genesis chips. So of course, that's where we'll start the conversation. Special Guest: Thea Flowers.

Python Out Loud
Episode 0 Postscript: your_questions_answered

Python Out Loud

Play Episode Listen Later Feb 5, 2018 10:56


Episode 0 Postscript Show Notes (http://pythonoutloud.com/episode0postscript): pythonoutloud.com/episode0postscript (http://pythonoutloud.com/episode0postscript) While we create Episode 1, this Episode 0 Postscript answers some of your questions, discusses our plans for the show, and announces our first giveaway! In addition, Isaiah shared some stories from PyCascades (https://www.pycascades.com/) (https://www.pycascades.com/ (https://www.pycascades.com/)), a regional Python conference held in Canada in January 2018. At PyCascades, Isaiah even gave a Lightning Talk announcing Python Out Loud to nearly 400 audience members: https://www.youtube.com/watch?v=xrzfSU-8zVY&feature=youtu.be&t=24m50s (https://www.youtube.com/watch?v=xrzfSU-8zVY&feature=youtu.be&t=24m50s) We recommend watching all of the other amazing talks, as well: https://www.youtube.com/channel/UCtWI06j1EADmEOGj2iJhSyA (https://www.youtube.com/channel/UCtWI06j1EADmEOGj2iJhSyA) Also, while explaining why we started with Episode 0 and not Episode 1, Isaiah told us about a controversial topic in mathematics. So controversial, in fact, it involves fistfights! (Please encourage Isaiah to tell us more about the fight. Was he a participant? Were calculators involved?) And finally, Isaiah took the opportunity to thank friend of the show, Michael Kennedy, for now only mentioning Python Out Loud in Python Bytes Episode 62 (https://pythonbytes.fm/episodes/show/62/wooey-and-gooey-are-simple-python-guis), but also generously donating several Talk Python 2018 Annual Course Bundles (https://training.talkpython.fm/courses/bundle/2018-annual-bundle). Follow us on Twitter as @PythonOutLoud (https://twitter.com/pythonoutloud (https://twitter.com/pythonoutloud)) to find out how you can win a Course Bundle. This episode features the song "Happy Ukulele" by Scott Holmes (http://freemusicarchive.org/music/Scott_Holmes/) and the songs "And So Then" and "Puzzle Pieces" by Lee Rosevere (http://freemusicarchive.org/music/Lee_Rosevere/). Thank you for your support, and stay tuned for Episode 1. We plan to discuss problem solving in Python, focusing on the so-called FizzBuzz Challenge. If you’re still reading, there's a statistically significant chance you want to help us build a community and support our cause! If our prediction is correct, please visit pythonoutloud.com/donate (http://pythonoutloud.com/donate). We want Python Out Loud to be community driven and non-profit oriented, which is why we pledge to be transparent and donate anything in excess of our operating expenses to the Python Software Foundation (PSF). For just $3, we'll even mail you a limited-edition Python Out Loud sticker!

Castálio Podcast
Episódio 114: Mariatta Wijaya - CPython

Castálio Podcast

Play Episode Listen Later Aug 21, 2017


CPython, Python Docs, PEPs and PyCascades with Mariatta Wijaya

Castálio Podcast
Episódio 114: Mariatta Wijaya - CPython

Castálio Podcast

Play Episode Listen Later Aug 20, 2017


Olá pessoal e sejam bem-vindos à mais um episódio do Castálio Podcast! Nossa convidada de hoje é engenheira de sofware em Vancouver, Canadá, é co-organizadora da PyLadies Vancouver e da conferencia PyCascades. Ela também é Python Core Developer, contribuindo com a documentação oficial do Python, Python Developer's Guide, Python Core …