#280: Easy terminal scripts by sourcing your Py
Published Thu, Apr 21, 2022, recorded Tue, Apr 19, 2022
About the show
Sponsored by Mergify!
Special guest: Pat Decker
Michael #0: New live stream / recording time: 12pm US PT on Tuesdays. Please subscribe to our YouTube channel to get notified and be part of the episodes.
Brian #1: BTW, don’t make a public repo private
- How we lost 54k GitHub stars
- Jakub Roztočil
- HTTPie kinda sorta accidentally flipped their main repo to private for a sec.
- And dropped the star count from 54k to 0
- They’re back up to 16k, as of today. But ouch.
- “HTTPie is a command-line HTTP client. Its goal is to make CLI interaction with web services as human-friendly as possible. HTTPie is designed for testing, debugging, and generally interacting with APIs & HTTP servers. The http & https commands allow for creating and sending arbitrary HTTP requests. They use simple and natural syntax and provide formatted and colorized output.”
- Actually, pretty cool tool to use for developing and testing APIs.
Michael #2: The counter-intuitive rise of Python in scientific computing
- via Galen Swint
- In our laboratory, a polarizing debate rages since around 2010, summarized by this question: Why are more and more time-critical scientific computations formerly performed in Fortran now written in Python, a slower language?
- Python has the reputation of being slow, i.e. significantly slower than compiled languages such as Fortran, C or Rust.
- So yes, plain Python is much slower than Fortran.
- However, this comparison makes little sense, as scientific uses of Python do not rely on plain Python.
- Used the right way, Python is slightly slower than compiled code.
- Meta donates $300,000 to PSF to add a second year for the Developer in Residence
Brian #4: Dashboards in Python
- Two suggestions from Marc Skov Madsen
- The Easiest Way to Create an Interactive Dashboard in Python
- Sophia Yang & Mark Skov Madsen
- animated gif showing the dashboard
- video of Sophia walking through the article in under 6 minutes
- “Turn Pandas pipelines into a dashboard using hvPlot .interactive"
- hvPlot is part of HoloViz and this example is pretty short and amazing to get a great dashboard with controls up very quickly.
- Python Dashboarding Shootout and Showdown | PyData Global 2021
- 5 speakers, 4 dashboard libraries, nice for comparison.
- Nice clickable index posted by Duy Nguyen
Michael #5: sourcepy
- by Dave Chevell
- Sourcepy lets you source python scripts natively inside your shell
- Imagine a Python script with functions in it. This converts those to CLI commands (kind of like entrypoints, but simpler)
- Type hints can be used to coerce input values into their corresponding types.
IOtype hints can be used to target stdin at different arguments and to receive the
- Sourcepy has full support for asyncio syntax
Pat #6: Xonsh
- Xonsh Shell Combines the Best of Bash Shell and Python in Linux Terminal
- Awesome demo video (50 min) https://youtu.be/x85LSyCxiw8
- Donate to the PSF by using https://rewards.microsoft.com
Joke: Can you really quit vim?
Joke: Forgetting how to count