Top 5 VS Code Extensions for Python Users
VS Code is one of the widely used IDEs by developers, engineers & data scientists. Here are the top 5 VS Code extensions, especially for Python developers, along with examples of how they enhance your development experience. These five VS Code extensions are considered due to their comprehensive and essential features that directly address common development needs.
The code examples are shown along with the descriptions of the extension.
1. Python - by Microsoft
The official Python extension for VS Code is essential for any Python developer. Let’s look at some of its main features:
- IntelliSense: Provides intelligent code completions based on the context.
- Linting: Helps catch errors and potential issues in your code.
- Debugging: Integrated debugging tools for setting breakpoints, stepping through code, and inspecting variables.
With this extension, as you type, add(, IntelliSense will suggest adding and showing the function signature. Refer to the image below for reference. This is how it should look once you have the extension installed in your VS Code;
2. Pylance
A language server for Python that provides fast, feature-rich IntelliSense, type checking, and more. Some Main Features include;
- Type Checking: Pylance provides real-time type checking and helps catch type-related errors.
- Rich IntelliSense: Offers more accurate and context-aware code completions.
- Code Navigation: Allows you to easily navigate to definitions, references, and more.
This is how it should look once you have the extension installed in your VS Code;
3. Jupyter
Adds Jupyter Notebook support to VS Code, allowing you to work with notebooks directly within the editor. The main Features of the Jupyter extension include;
- Notebook Execution: Run Jupyter notebooks (.ipynb files) seamlessly.
- Interactive Data Visualisation: See plots and data visualisations inline.
- When running the code in a Jupyter Notebook within VS Code, the plot will be rendered directly in the notebook interface.
This is how it should look once you have the Jupyter extension installed in your VS Code.
4. GitLens
You can Git from within VSCode, which offers powerful features to visualise and manage Git repositories. GitLens offers many features. Some of these include;
- Git Blame: See who last modified a line and why.
- Commit History: View the history of a file or line of code.
- File Annotations: Provides inline annotations and tooltips with Git information
Hover over a line of code to see who last modified it and when. GitLens might show. This is how it should look once you have the extension installed in your VS Code;
5. autoDocstring - Python Docstring Generator
Automatically generates docstrings for your Python functions, methods, and classes according to PEP 257.
How it works:
- After you create your function definition, enter “”” and it will prompt you to auto-generate docstrings. It ensures that your code is well-documented, which is vital for code maintainability and collaboration. Refer to the image below that shows the code and how it should look once the extension is installed.
After you press enter, it should show something like this;
Non-Coding Extensions
Alongside coding, what a lot of developers like doing is tweaking, be it their tools, themes or just the desktop background for the sake of it. Know what I mean? The latter is fine, but what has a positive impact is having the right tools, in whichever way possible. VSCODE Extensions enable having the right tools (extensions) by your side ridiculously easy. It can supercharge productivity for real.
Other than the extensions already discussed above, here are some good-to-have Non-Coding VSCODE extensions;
1. PDF Viewer
Easily, a must-have extension to read technical papers, books, or any other document in PDF format while you just write your code on the tab next to it. Can’t get easier than this.
2. Excalidraw
This one was a gem of a find for me. It is known that a picture is easier to understand than text. PPTs were the go-to tool to draw technical architecture, data pipelines and flows, but excalidraw makes it FUN. The extension feels like drawing or writing on a board and makes the entire activity joyful.
3. WSL
This one’s for Windows users who also have WSL installed. Coding on a Bare-metal Unix machine has its PROs, and what better way to do it using an IDE instead of VIM Or EMACS.
4. markdownlint
This one is for the Writers - The technical documentation Writers.
Markdown files are very common, as we all know. This extension is a super add-on for those writers who heavily use markdown to write their documentation.
Markdownlint includes a library of rules to encourage standards and consistency for Markdown files. It is powered by the markdownlint library for Node.js. Linting is performed by the markdownlint-cli2 engine, which can be used in conjunction with this extension to provide command-line support for scripts and continuous integration scenarios.
I hope this post helps boost your productivity, creativity when you use VS Code.