7 key VS Code enhancements for Python builders in 2021

We have listed them best VS extensions for JS developers. Now is the time for the Python community.

I’m a PyCharm user and I probably won’t be switching editors anytime soon, but given the hype surrounding VS Code and so many people on Reddit and Twitter suggesting the move, I had to try.

My VS Code experience has been amazing and while my heart still belongs to PyCharm, VS Code is a fantastic product that I can 100% recommend. It’s customizable, fast, and comes with a ton of extensions that make it very powerful.

Today we’re going to cover the top VS Code enhancements to Python for 2021.

python

python

VS Code supports code highlighting for Python without this extension. However, if you are using Python, this is the extension you should install. It is developed by Microsoft itself, the same developer of VS Code. So important to the productivity of Python developers is that VS Code will automatically suggest that you install it right after you open your first one .py file.

[Read: Meet the 4 scale-ups using data to save the planet]

But why do I need it when I already have syntax highlighting? This extension is a feature powerhouse when it comes to working with Python. It offers features like:

  • IntelliSense: Edit your code with autocompletion, code navigation, syntax checking, and more
  • Fluff: Get additional code analysis with Pylint, Flake8, and more
  • Code formatting: Format your code with Schwarz, Autopep or Yapf
  • Debug: Debug your Python scripts, web applications, remote or multithreaded processes
  • Testing: Run tests in the Test Explorer with Unittest, Pytest or Nase and debug them
  • Jupyter Notebooks: Create and edit Jupyter Notebooks, add and run code cells, render charts, visualize variables using the Variable Explorer, visualize data frames using the Data Viewer, and more
  • Environments: Automatically enable and switch between the virtualenv, venv, pipenv, conda, and pyenv environments
  • Refactoring: Restructure your Python code with variable extraction, method extraction and import sorting

Check it out in action:

Python extension demo

Download Python

Python snippets

Python snippets

Python snippets is an extension full of built-in snippets packages developed by Ferhat Yalçın. This extension is ideal for any developer, but especially for beginners in Python. It contains numerous built-in snippets such as string, list, sets, tuple, dictionary, class and much more. Another benefit of using this plugin is that it has at least one example for each snippet, which makes it awesome when learning Python.

Download python snippets

Python docstring generator

Python docstring generator

We’ve already talked about the importance of documentation and how much I love documenting the code, but we all know that it can be a frustrating task. Python docstring generator reduces developer endeavors by automatically creating document strings.

The best part about this extension is that it follows all of the standard docstring formats (including Google, docBlockr, Numpy, Sphinx, and PEP0257 in a nutshell), and that’s cool. In addition, this document string generator supports arguments, warnings, decorators, errors, and parameter types with multiline comment functions.

Just see it in action and be amazed:

Demo of Python Docstring Generator

Download Python Docstring Generator

Python Test Explorer for Visual Studio Code

Python Test Explorer

The Python Test Explorer The extension allows you to run your Python unit test or pytest tests using the Test Explorer user interface. This small and handy tool allows you to test your code from the comfort of VS Code with a great user interface and debugging capabilities.

We know how important unit tests are. Hence, having such a tool in your IDE or code editor is a must.

Demo of Python Test Explorer

Download the Python Test Explorer

Python preview

Python preview

Python preview is an extension that adds visual debugging to your Python code. It turns debugging code into an interactive session with animations and graphical elements to represent your application state. You just have to see it:

Python preview demo

Download the Python preview

Python type tip

Python type tip

Yes, Python has such a thing as types, and yes, it’s great. think of Type notes for Python as TypeScript is for JavaScript. It’s a game changer that hopefully we’ll see more often in tutorials and applications. Python type tip Provides elements to complete type hints for built-in types, estimated types, and the typing engine. It can also look for Python files for type estimation purposes in the type space.

Demo of Python Type Hint

Download Python Type Hint

Jupyter

Jupyter

Jupyter is one of my favorite VS Code extensions. Yeah that’s what you think It’s Jupyter Notebooks right in VS Code. As someone who always works with Jupyter notebooks, this extension was beneficial and I think I still have a lot of research to do about it.

Integration with Jupyter Notebooks is one of my favorite PyCharm features. To be fair, I love the PyCharm integration more than the VS Code integration. Even so, Jupyter is free for VS Code, while the PyCharm Jupyter Notebook integration is only available in the Pro version.

Download Jupyter

Conclusion

As I mentioned in the JS version of this post, I was positively surprised by VS Code. It is a solid tool for fast, flexible coding and with extended functions through extensions.

Interestingly, all of these extensions that I have listed here today are some of my favorite features in PyCharm, but free and with a fantastic user experience.

Still, editor’s details annoy me, so PyCharm is my favorite editor. With such quality enhancements, however, I see how difficult it can be to justify paying for them.

These items was originally published on Live code stream by Juan Cruz Martinez (Twitter: @bajcmartinez), Founder and publisher of Live Code Stream, entrepreneur, developer, author, speaker and maker of things.

Live code stream is also available as a free weekly newsletter. Sign up for updates on everything related to programming, AI and computer science in general.

Comments are closed.