{ "info": { "author": "Divo Kaplan", "author_email": "divokaplan@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: System :: Archiving :: Mirroring", "Topic :: Text Editors", "Topic :: Utilities" ], "description": "# VSCOD\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/vscod.svg)](https://pypi.python.org/pypi/vscod/)\n[![PyPI version fury.io](https://badge.fury.io/py/vscod.svg)](https://pypi.python.org/pypi/vscod/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\n**_VSCOD_** is short for **V**isual **S**tudio **C**ode **O**ffline **D**ownloader. This tool will allow you to download batches of extensions as well as VSCode binaries so you can later on use them to install your favorite editor and it's extensions.\nThis tool could help greatly if you're a frustrated admin that needs to update a local artifact repository, if you don't have access to the official repositories from your station and need to pass things by hand or just if you're an automation freak and for some reason want to mess up with the Visual Studio Marketplace.\n\nI tried to find a tool that does that and when I failed I tried to at least find a convenient API to use but to my surprise the Marketplace doesn't have one at the time of writing these lines (and if you find one, feel free to send a PR!), and so I ended up writing **VSCOD**!\n\n## Installation\n\nUse the Python package manager [pip](https://pip.pypa.io/en/stable/) to install `vscod`.\n\n```bash\npip install vscod\n```\n\n## Usage\n\n### Shell\n\n```bash\n# Display the help\nvscod --help\n# Download the insider binaries for Linux (64bit deb), Windows (32bit) and Mac to the 'downloads' dir.\nvscod download editor --output 'downloads' --build insider linux-deb-x64 win32-archive darwin\n# Download the official Python extension and the Vim keymap to the 'extensions' dir.\nvscod download extensions --output 'extensions' ms-python.python vscodevim.vim\n# Download the requested config data (see below) to the current directory (the default path if none is specified btw).\nvscod download config --output '.' /path/to/config.json\n# List all the supported platform and build strings.\nvscod list-opts\n```\n\n### Python\n\n```python\nfrom vscod import extensions_downloader, vscode_downloader\nfrom vscod.vscode_downloader import BUILDS, PLATFORMS, LATEST_VERSION\nimport asyncio\nimport aiohttp\n\nasync def vscod_demo():\n async with aiohttp.ClientSession() as session: # It's all asynchronous!\n # Download the latest version of the official Python extension to the path.\n await extensions_downloader.download_extension_by_id(session, 'ms-python.python', 'latest', '/path/to/save')\n # Find what the latest version of the Vim keymap is.\n vim_version = await extensions_downloader.get_extension_version(session, 'vscodevim.vim')\n # Download the latest stable Linux deb version to the path.\n await vscode_downloader.download_vscode(session, PLATFORMS.LINUX64_DEB, '/path/to/save', build=BUILDS.STABLE, version=LATEST_VERSION)\n\nasyncio.run(vscod_demo())\n```\n\n### Config\n\nYou can also supply a JSON configuration that looks something like this:\n\n```json\n{\n \"vscode\": [\n {\n \"platform\": \"linux-deb-x64\"\n },\n {\n \"platform\": \"win32-x64-user\",\n \"version\": \"latest\",\n \"build\": \"stable\"\n }\n ],\n \"extensions\": {\n \"gitlens\": \"eamodio.gitlens\",\n \"languages\": {\n \"go\": \"ms-vscode.go\",\n \"python\": {\n \"python\": \"ms-python.python\",\n \"auto_docstring\": \"njpwerner.autodocstring\"\n }\n }\n }\n}\n```\n\nThe top level `\"vscode\"` and `\"extensions\"` signals that these are the editor and extensions download settings respectively (duh).\nThe parsing process then goes as follows:\n\n* For extensions:\n 1. Go through the loaded dictionary's items recursively:\n * If the value is a string, we got to the extension ID.\n * If the value is a dict, delve deeper.\n 1. Build a directory hierarchy using the keys as directories.\n 1. Download each extension ID to it's designated location.\n* For VSCode binaries:\n 1. Go through the loaded list of specification dicts. If the value of the top level `\"vscode\"` key is a dict, treat it like a list with a single dict.\n 1. For each of them download the binary according to the specification given in the dict into a designated directory.\n\nSo it will generate the following hierarchy:\n\n```text\n|-- root_path\n |-- gitlens\n | |-- eamodio.gitlens-9.9.3.vsix\n |-- languages\n | |-- go\n | | |-- ms-vscode.go-0.11.4.vsix\n | |-- python\n | |-- auto_docstring\n | | |-- njpwerner.autodocstring-0.3.0.vsix\n | |-- python\n | |-- ms-python.python-2019.8.30787.vsix\n |-- linux-deb-x64\n | |-- code_1.37.1-1565886362_amd64.deb\n |-- win32-x64-user\n |-- VSCodeUserSetup-x64-1.37.1.exe\n```\n\n## License\n\n[MIT](LICENSE.txt)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/DivoK/vscod", "keywords": "vscode offline cli downloader tool", "license": "", "maintainer": "", "maintainer_email": "", "name": "vscod", "package_url": "https://pypi.org/project/vscod/", "platform": "", "project_url": "https://pypi.org/project/vscod/", "project_urls": { "Homepage": "https://github.com/DivoK/vscod" }, "release_url": "https://pypi.org/project/vscod/0.1.0/", "requires_dist": [ "loguru", "aiohttp", "aiofiles", "cchardet", "aiodns", "click" ], "requires_python": ">=3.7", "summary": "Download VSCode binaries and extensions offline.", "version": "0.1.0" }, "last_serial": 5712435, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "58361fd06512a380c3ac2d7722d7db38", "sha256": "f7915aa7b211c28400ab9c9bcb9181671a1c076e187353a13f109e5ed78fb041" }, "downloads": -1, "filename": "vscod-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "58361fd06512a380c3ac2d7722d7db38", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 12263, "upload_time": "2019-08-22T00:11:34", "url": "https://files.pythonhosted.org/packages/66/6c/9775f2b2201a69bc2990a2957ef2bede912f2a4b222628d7fc69c9189849/vscod-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "83c7503df1626f567104dd608715ab22", "sha256": "bc9818caa2a399e3eb3fb14ca3be18d3d3aedbcf19082c3a1e4c8329a1fd9bb0" }, "downloads": -1, "filename": "vscod-0.1.0.tar.gz", "has_sig": false, "md5_digest": "83c7503df1626f567104dd608715ab22", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 11594, "upload_time": "2019-08-22T00:11:36", "url": "https://files.pythonhosted.org/packages/ce/82/6155a12882c352d98b3cec25d256feebb311e2ff3d8e76719abc26e492b0/vscod-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "58361fd06512a380c3ac2d7722d7db38", "sha256": "f7915aa7b211c28400ab9c9bcb9181671a1c076e187353a13f109e5ed78fb041" }, "downloads": -1, "filename": "vscod-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "58361fd06512a380c3ac2d7722d7db38", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 12263, "upload_time": "2019-08-22T00:11:34", "url": "https://files.pythonhosted.org/packages/66/6c/9775f2b2201a69bc2990a2957ef2bede912f2a4b222628d7fc69c9189849/vscod-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "83c7503df1626f567104dd608715ab22", "sha256": "bc9818caa2a399e3eb3fb14ca3be18d3d3aedbcf19082c3a1e4c8329a1fd9bb0" }, "downloads": -1, "filename": "vscod-0.1.0.tar.gz", "has_sig": false, "md5_digest": "83c7503df1626f567104dd608715ab22", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 11594, "upload_time": "2019-08-22T00:11:36", "url": "https://files.pythonhosted.org/packages/ce/82/6155a12882c352d98b3cec25d256feebb311e2ff3d8e76719abc26e492b0/vscod-0.1.0.tar.gz" } ] }