In this lesson, you will learn,

  • the role of formatters
  • the key benefits of using a Python formatter.

The role of a formatter is to format your code to a given standard. This may be to a set of styling guidelines (Black), sorting imports (isort) or removing unused code (autoflake).

By using a formatter, you no longer have to manually update your code to align with the necessary styling recommendations, for example adding the required spaces or line spaces, or ensuring your dictionaries or lists are formatted correctly. Therefore, by using formatters against your code you can:

  • save time over manually styling your code
  • ensure code is styled consistently across developers and teams.
Want to Learn Network Automation?
Join our membership and get access to:
  • Full deep-dive course library (inc. Batfish, pyATS, Netmiko)
  • Code repositories inc. full course code, scripts and examples
  • 24x7 multi-vendor labs (Arista, Cisco, Juniper)
  • Private online community
  • Tech demos and sessions

Join Now ➜