Automatically Enforce Software Structures With Powerful Code Modifications Powered By LibCST - Episode 361

Summary

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.

Do you want to try out some of the tools and applications that you heard about on Podcast.__init__? Do you have a side project that you want to share with the world? With Linode’s managed Kubernetes platform it’s now even easier to get started with the latest in cloud technologies. With the combined power of the leading container orchestrator and the speed and reliability of Linode’s object storage, node balancers, block storage, and dedicated CPU or GPU instances, you’ve got everything you need to scale up. Go to pythonpodcast.com/linode today and get a $100 credit to launch a new cluster, run a server, upload some data, or… And don’t forget to thank them for being a long time supporter of Podcast.__init__!

Announcements

  • Hello and welcome to Podcast.__init__, the podcast about Python’s role in data and science.
  • 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 pythonpodcast.com/linode 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!
  • 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

Interview

  • Introductions
  • How did you get introduced to Python?
  • Can you describe what LibCST is and the story behind it?
  • How does a concrete syntax tree differ from an abstract syntax tree?
    • What are some of the situations where the preservation of the exact structure is necessary?
  • 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?
  • What are the use cases that LibCST is focused on supporting
  • Can you describe how LibCST is implemented?
    • How have the design and goals of the project changed or evolved since you started working on it?
  • How might I use LibCST for something like restructuring a set of modules to move a function definition while maintaining proper imports?
    • How do the capabilities of LibCST for codemodding compare to the Rope framework?
  • What are some other workflows that someone might build with LibCST?
  • What are some of the ways that LibCST is being used in your own work?
  • What are the most interesting, innovative, or unexpected ways that you have seen LibCST used?
  • What are the most interesting, unexpected, or challenging lessons that you have learned while working on LibCST?
  • When is LibCST the wrong choice?
  • What do you have planned for the future of LibCST?

Keep In Touch

Picks

Closing Announcements

  • Thank you for listening! Don’t forget to check out our other show, the Data Engineering Podcast for the latest on modern data management.
  • Visit the site to subscribe to the show, sign up for the mailing list, and read the show notes.
  • If you’ve learned something or tried out a project from the show then tell us about it! Email hosts@podcastinit.com) with your story.
  • To help other people find the show please leave a review on iTunes and tell your friends and co-workers

Links

The intro and outro music is from Requiem for a Fish The Freak Fandango Orchestra / CC BY-SA

Liked it? Take a second to support Podcast.__init__ on Patreon!