vscode.py


Namevscode.py JSON
Version 2.0.0b2 PyPI version JSON
download
home_pagehttps://github.com/CodeWithSwastik/vscode.py
SummaryCreate VSCode Extensions with python
upload_time2023-12-27 14:21:49
maintainer
docs_urlNone
authorSwas.py
requires_python>=3.8
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img alt="vscode.py logo" src="https://github.com/CodeWithSwastik/vscode.py/blob/main/images/vscode-py.png?raw=true" width='500px'/>
</p>

<p align="center"><a href="https://GitHub.com/CodeWithSwastik/vscode.py/graphs/commit-activity"><img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" alt="Maintenance"></a>
<a href="https://pepy.tech/project/vscode.py"><img src="https://static.pepy.tech/personalized-badge/vscode.py?period=total&amp;units=international_system&amp;left_color=orange&amp;right_color=brightgreen&amp;left_text=Downloads" alt="Downloads"></a>
<a href="https://pypi.python.org/pypi/vscode.py/"><img src="https://badge.fury.io/py/vscode.py.svg" alt="PyPI version"></a>
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>

## About

Create vscode extensions with python.

## Installation

Stable version:

```sh-session
pip install vscode.py
```

## Why use vscode.py?

Why should you use this for building VScode extensions when you can use typescript? Here are some reasons:

- vscode.py builds the package.json for you! No need to switch between your extension.py and package.json in order to add commands. It also handles adding Activity Bars, Keybinds and Views.
- vscode.py provides a pythonic way of creating the extension. Python has some powerful modules that Javascript doesn't and you can include these with vscode.py
- vscode.py extensions work perfectly with vsce and you can publish your extensions just like you would publish any other extension.

## Example Extension

```python
import vscode
from vscode import InfoMessage

ext = vscode.Extension(name="Test Extension")

@ext.event
async def on_activate():
    vscode.log(f"The Extension '{ext.name}' has started")


@ext.command()
async def hello_world(ctx):
    return await ctx.show(InfoMessage(f"Hello World from {ext.name}"))

ext.run()
```

## Tutorial

### Step 1

Create a python file inside a folder.

![image](https://user-images.githubusercontent.com/61446939/126891766-8e408f35-ce63-48b1-8739-1361e979d351.png)

### Step 2

Write the code for your extension. For this tutorial we have used the [Example Extension](#example-extension)

### Step 3

Run the python file. It will build the required extension files.

![image](https://user-images.githubusercontent.com/61446939/126891865-fe235598-9267-47c6-971f-43e4da456ebb.png)
![image](https://user-images.githubusercontent.com/61446939/126891875-62c2057e-e504-4e01-bfd6-9a20c7f660d9.png)

### Step 4

Press F5. This will run the extension and open a new vscode window in development mode.

### Step 5

Finally, test your command.

- Open the command palette with Ctrl+P in the development window.

![image](https://user-images.githubusercontent.com/61446939/126892044-f3b5f4d3-37de-4db5-acef-c6ddd841f1a5.png)

- Type `>Hello World`

![image](https://user-images.githubusercontent.com/61446939/126892096-9fc1cb2f-9b76-4d53-8099-e74d9f22e6e7.png)

- It should show a popup like this in the bottom right corner

![image](https://user-images.githubusercontent.com/61446939/126892110-f8d4bcf2-9ec0-43c2-a7d6-40288d91f000.png)

## Extensions built using vscode.py

Here's a list of some extensions built using vscode.py. If you'd like to include your extension here feel free to create a PR.

- [Youtube](https://github.com/CodeWithSwastik/youtube-ext)
- [Wikipedia](https://github.com/SkullCrusher0003/wikipedia-ext)
- [Internet Search](https://github.com/Dorukyum/internet-search)
- [Virtual Assistant](https://github.com/SohamGhugare/vscode-virtual-assistant)
- [YoExtension](https://github.com/yo56789/YoExtension)

## Documentation

The docs are coming soon! In the meantime you can look at the [examples](https://github.com/CodeWithSwastik/vscode.py/tree/main/examples) in order to learn how vscode.py works and what it offers!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/CodeWithSwastik/vscode.py",
    "name": "vscode.py",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Swas.py",
    "author_email": "cwswas.py@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/36/6a/306cc1f3aa8207ab1c4ed8f339b3dedb841339f69b7e0665436e931396ca/vscode.py-2.0.0b2.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\r\n  <img alt=\"vscode.py logo\" src=\"https://github.com/CodeWithSwastik/vscode.py/blob/main/images/vscode-py.png?raw=true\" width='500px'/>\r\n</p>\r\n\r\n<p align=\"center\"><a href=\"https://GitHub.com/CodeWithSwastik/vscode.py/graphs/commit-activity\"><img src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" alt=\"Maintenance\"></a>\r\n<a href=\"https://pepy.tech/project/vscode.py\"><img src=\"https://static.pepy.tech/personalized-badge/vscode.py?period=total&amp;units=international_system&amp;left_color=orange&amp;right_color=brightgreen&amp;left_text=Downloads\" alt=\"Downloads\"></a>\r\n<a href=\"https://pypi.python.org/pypi/vscode.py/\"><img src=\"https://badge.fury.io/py/vscode.py.svg\" alt=\"PyPI version\"></a>\r\n<a href=\"https://github.com/psf/black\"><img alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"></a>\r\n\r\n## About\r\n\r\nCreate vscode extensions with python.\r\n\r\n## Installation\r\n\r\nStable version:\r\n\r\n```sh-session\r\npip install vscode.py\r\n```\r\n\r\n## Why use vscode.py?\r\n\r\nWhy should you use this for building VScode extensions when you can use typescript? Here are some reasons:\r\n\r\n- vscode.py builds the package.json for you! No need to switch between your extension.py and package.json in order to add commands. It also handles adding Activity Bars, Keybinds and Views.\r\n- vscode.py provides a pythonic way of creating the extension. Python has some powerful modules that Javascript doesn't and you can include these with vscode.py\r\n- vscode.py extensions work perfectly with vsce and you can publish your extensions just like you would publish any other extension.\r\n\r\n## Example Extension\r\n\r\n```python\r\nimport vscode\r\nfrom vscode import InfoMessage\r\n\r\next = vscode.Extension(name=\"Test Extension\")\r\n\r\n@ext.event\r\nasync def on_activate():\r\n    vscode.log(f\"The Extension '{ext.name}' has started\")\r\n\r\n\r\n@ext.command()\r\nasync def hello_world(ctx):\r\n    return await ctx.show(InfoMessage(f\"Hello World from {ext.name}\"))\r\n\r\next.run()\r\n```\r\n\r\n## Tutorial\r\n\r\n### Step 1\r\n\r\nCreate a python file inside a folder.\r\n\r\n![image](https://user-images.githubusercontent.com/61446939/126891766-8e408f35-ce63-48b1-8739-1361e979d351.png)\r\n\r\n### Step 2\r\n\r\nWrite the code for your extension. For this tutorial we have used the [Example Extension](#example-extension)\r\n\r\n### Step 3\r\n\r\nRun the python file. It will build the required extension files.\r\n\r\n![image](https://user-images.githubusercontent.com/61446939/126891865-fe235598-9267-47c6-971f-43e4da456ebb.png)\r\n![image](https://user-images.githubusercontent.com/61446939/126891875-62c2057e-e504-4e01-bfd6-9a20c7f660d9.png)\r\n\r\n### Step 4\r\n\r\nPress F5. This will run the extension and open a new vscode window in development mode.\r\n\r\n### Step 5\r\n\r\nFinally, test your command.\r\n\r\n- Open the command palette with Ctrl+P in the development window.\r\n\r\n![image](https://user-images.githubusercontent.com/61446939/126892044-f3b5f4d3-37de-4db5-acef-c6ddd841f1a5.png)\r\n\r\n- Type `>Hello World`\r\n\r\n![image](https://user-images.githubusercontent.com/61446939/126892096-9fc1cb2f-9b76-4d53-8099-e74d9f22e6e7.png)\r\n\r\n- It should show a popup like this in the bottom right corner\r\n\r\n![image](https://user-images.githubusercontent.com/61446939/126892110-f8d4bcf2-9ec0-43c2-a7d6-40288d91f000.png)\r\n\r\n## Extensions built using vscode.py\r\n\r\nHere's a list of some extensions built using vscode.py. If you'd like to include your extension here feel free to create a PR.\r\n\r\n- [Youtube](https://github.com/CodeWithSwastik/youtube-ext)\r\n- [Wikipedia](https://github.com/SkullCrusher0003/wikipedia-ext)\r\n- [Internet Search](https://github.com/Dorukyum/internet-search)\r\n- [Virtual Assistant](https://github.com/SohamGhugare/vscode-virtual-assistant)\r\n- [YoExtension](https://github.com/yo56789/YoExtension)\r\n\r\n## Documentation\r\n\r\nThe docs are coming soon! In the meantime you can look at the [examples](https://github.com/CodeWithSwastik/vscode.py/tree/main/examples) in order to learn how vscode.py works and what it offers!\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Create VSCode Extensions with python",
    "version": "2.0.0b2",
    "project_urls": {
        "Homepage": "https://github.com/CodeWithSwastik/vscode.py",
        "Issue tracker": "https://github.com/CodeWithSwastik/vscode.py/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "366a306cc1f3aa8207ab1c4ed8f339b3dedb841339f69b7e0665436e931396ca",
                "md5": "72b6fb9bfdfe5e6de26f6550c03567d5",
                "sha256": "a4dc690ecd66c0abaa0c5f10d1943c233bc80a3257211490754267fd0dc041b0"
            },
            "downloads": -1,
            "filename": "vscode.py-2.0.0b2.tar.gz",
            "has_sig": false,
            "md5_digest": "72b6fb9bfdfe5e6de26f6550c03567d5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 18786,
            "upload_time": "2023-12-27T14:21:49",
            "upload_time_iso_8601": "2023-12-27T14:21:49.435096Z",
            "url": "https://files.pythonhosted.org/packages/36/6a/306cc1f3aa8207ab1c4ed8f339b3dedb841339f69b7e0665436e931396ca/vscode.py-2.0.0b2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-27 14:21:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "CodeWithSwastik",
    "github_project": "vscode.py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "vscode.py"
}
        
Elapsed time: 0.16519s