Date: Mon, 25 Apr 2022 15:00:00 -0400
<div class="wp-block-jetpack-markdown"><h2>Summary</h2> <p>Programmers love to automate tedious processes, including refactoring your code. In order to support the creation of code modifications for your Python projects Jimmy Lai created LibCST. It provides a richly typed and high level API for creating and manipulating concrete syntax trees of your source code. In this episode Jimmy Lai and Zsolt Dollenstein explain how it works, some of the linting and automatic code modification utilities that you can build with it and how to get started with using it to maintain your own Python projects.</p> <h2>Announcements</h2> <ul> <li>Hello and welcome to Podcast.__init__, the podcast about Python’s role in data and science.</li> <li>When you’re ready to launch your next app or want to try a project you hear about on the show, you’ll need somewhere to deploy it, so take a look at our friends over at Linode. With the launch of their managed Kubernetes platform it’s easy to get started with the next generation of deployment and scaling, powered by the battle tested Linode platform, including simple pricing, node balancers, 40Gbit networking, dedicated CPU and GPU instances, and worldwide data centers. Go to <a href="https://www.pythonpodcast.com/linode?utm_source=rss&utm_medium=rss">pythonpodcast.com/linode</a> and get a $100 credit to try out a Kubernetes cluster of your own. And don’t forget to thank them for their continued support of this show!</li> <li>Your host as usual is Tobias Macey and today I’m interviewing Zsolt Dollenstein and Jimmy Lai about LibCST, a concrete syntax tree parser and serializer library for Python</li> </ul> <h2>Interview</h2> <ul> <li>Introductions</li> <li>How did you get introduced to Python?</li> <li>Can you describe what LibCST is and the story behind it?</li> <li>How does a concrete syntax tree differ from an abstract syntax tree? <ul> <li>What are some of the situations where the preservation of the exact structure is necessary?</li> </ul> </li> <li>There are a few other libraries in Python for creating concrete syntax trees. What was missing in the available options that made it necessary to create LibCST?</li> <li>What are the use cases that LibCST is focused on supporting</li> <li>Can you describe how LibCST is implemented? <ul> <li>How have the design and goals of the project changed or evolved since you started working on it?</li> </ul> </li> <li>How might I use LibCST for something like restructuring a set of modules to move a function definition while maintaining proper imports? <ul> <li>How do the capabilities of LibCST for codemodding compare to the Rope framework?</li> </ul> </li> <li>What are some other workflows that someone might build with LibCST?</li> <li>What are some of the ways that LibCST is being used in your own work?</li> <li>What are the most interesting, innovative, or unexpected ways that you have seen LibCST used?</li> <li>What are the most interesting, unexpected, or challenging lessons that you have learned while working on LibCST?</li> <li>When is LibCST the wrong choice?</li> <li>What do you have planned for the future of LibCST?</li> </ul> <h2>Keep In Touch</h2> <ul> <li>Zsolt <ul> <li><a href="https://github.com/zsol?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">zsol</a> on GitHub</li> <li><a href="https://www.linkedin.com/in/zsoltdollenstein/?originalSubdomain=uk&utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">LinkedIn</a></li> </ul> </li> <li>Jimmy <ul> <li><a href="https://github.com/jimmylai?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">jimmylai</a> on GitHub</li> <li><a href="https://www.linkedin.com/in/jimmylai1/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">LinkedIn</a></li> </ul> </li> </ul> <h2>Picks</h2> <ul> <li>Tobias <ul> <li><a href="https://www.osprey.com/us/en/product/manta-24-MANTA24_550.html?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Osprey Manta Backpack</a></li> </ul> </li> <li>Zsolt <ul> <li><a href="https://github.com/nathro/AutoTransform?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Autotransform</a></li> <li><a href="https://glean.software/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Glean</a></li> </ul> </li> <li>Jimmy <ul> <li>Paying down technical debt</li> </ul> </li> </ul> <h2>Closing Announcements</h2> <ul> <li>Thank you for listening! Don’t forget to check out our other show, the <a href="https://www.dataengineeringpodcast.com?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Data Engineering Podcast</a> for the latest on modern data management.</li> <li>Visit the <a href="https://www.pythonpodcast.com?utm_source=rss&utm_medium=rss">site</a> to subscribe to the show, sign up for the mailing list, and read the show notes.</li> <li>If you’ve learned something or tried out a project from the show then tell us about it! Email <a href="mailto:hosts@podcastinit.com">hosts@podcastinit.com</a>) with your story.</li> <li>To help other people find the show please leave a review on <a href="https://itunes.apple.com/us/podcast/podcast.-init/id981834425?mt=2&uo=6&at=&ct=&utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">iTunes</a> and tell your friends and co-workers</li> </ul> <h2>Links</h2> <ul> <li><a href="https://github.com/Instagram/LibCST/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">LibCST</a></li> <li><a href="https://carta.com/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Carta</a></li> <li><a href="https://docs.python.org/3/library/2to3.html?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">lib2to3</a></li> <li><a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Abstract Syntax Tree</a></li> <li><a href="https://en.wikipedia.org/wiki/Parse_tree?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Concrete Syntax Tree</a></li> <li><a href="https://pyre-check.org/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Pyre</a></li> <li><a href="https://parso.readthedocs.io/en/latest/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Parso</a></li> <li><a href="https://cython.org/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Cython</a> <ul> <li><a href="https://www.pythonpodcast.com/episode-45-cython-with-craig-citro-and-robert-bradshaw/?utm_source=rss&utm_medium=rss">Podcast Episode</a></li> </ul> </li> <li><a href="https://github.com/mypyc/mypyc?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">mypyc</a></li> <li><a href="https://github.com/python-rope/rope?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Rope</a></li> <li><a href="https://flake8.pycqa.org/en/latest/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Flake8</a> <ul> <li><a href="https://www.pythonpodcast.com/flake8-static-analysis-episode-309/?utm_source=rss&utm_medium=rss">Podcast Episode</a></li> </ul> </li> <li><a href="https://pylint.pycqa.org/en/latest/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Pylint</a></li> <li><a href="https://eslint.org/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">ESLint</a></li> <li><a href="https://github.com/Instagram/fixit?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Fixit</a></li> <li><a href="https://github.com/Instagram/MonkeyType?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">MonkeyType</a> <ul> <li><a href="https://www.pythonpodcast.com/monkeytype-with-carl-meyer-and-matt-page-episode-146/?utm_source=rss&utm_medium=rss">Podcast Episode</a></li> </ul> </li> </ul> <p>The intro and outro music is from Requiem for a Fish <a href="http://freemusicarchive.org/music/The_Freak_Fandango_Orchestra/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">The Freak Fandango Orchestra</a> / <a href="http://creativecommons.org/licenses/by-sa/3.0/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">CC BY-SA</a></p> </div> <img alt="" height="0" src="https://analytics.boundlessnotions.com/piwik.php?idsite=1&rec=1&url=https%3A%2F%2Fwww.pythonpodcast.com%2Flibcst-automated-code-modification-episode-361%2F&action_name=Automatically+Enforce+Software+Structures+With+Powerful+Code+Modifications+Powered+By+LibCST+-+Episode+361&urlref=https%3A%2F%2Fwww.pythonpodcast.com%2Ffeed%2F&utm_source=rss&utm_medium=rss" style="border: 0; width: 0; height: 0;" width="0" />