Nutshell in a Python: Adapting patterns from shell scripts
By Brett Smith

Shell scripts are great for high-level tool orchestration. Python is great at parsing and traversing complex data. What do you write when you need both features equally? This talk will give you simple techniques to get shell-like features in Python, helping you write process pipelines, detect errors in them, and report those errors nicely.

Sunday 2:30 p.m.–2:55 p.m.

This talk will illustrate common patterns for writing efficient process pipelines with the subprocess module; automatically checking for errors in those pipelines; and catching those errors and reporting them to the user in a standard way by defining a custom excepthook. Used together, they'll give your script behavior more like a polished command line tool, without any serious rearchitecting. Each of these patterns is straightforward and has no dependencies outside Python's standard library, so they're easy to use in both new and existing scripts.

Brett Smith

Brett Smith is the Director of Strategic Initiatives at Software Freedom Conservancy. He works on a variety of the organization's programs, including project membership, outreach, and non-profit accounting. Over the years he's held a variety of advocacy and technical roles in free software. In the past he's been a developer and product manager at free software bioinformatics startup Curoverse; a system administration at the World Wide Web Consortium (W3C); and a license compliance engineer at the Free Software Foundation.

Twitter

Sponsors