Skip to main content

Fetch VSCode Marketplace extension download & rating stats

Project description

vsce-downloads

English

获取 VSCode Marketplace 扩展的下载量、安装量、评分等统计数据。

vsce-downloads 可以作为 Python 功能包使用,也可以作为命令行工具使用。

安装

从 PyPI 安装:

pip install vsce-downloads

安装后可以在 Python 中导入:

import vsce_downloads

也可以使用命令行工具 vsced

Python 用法

格式化打印扩展统计信息:

from vsce_downloads import print_stats

print_stats("knighthood2001.ros2-quick-runner")

输出示例:

==== VSCode 插件统计信息 ====
插件名称:knighthood2001.ros2-quick-runner
总安装量:182
VSCode 编辑器内下载量:45
VSIX 离线包网页下载量:137
总更新次数:33
平均评分:暂无评分
评分人数:暂无评分
当日新增安装:0.0
周日均新增:0.00
月日均新增:0.00

如果你想在代码里继续处理数据,可以使用 get_extension_stats()

from vsce_downloads import get_extension_stats

stats = get_extension_stats("knighthood2001.ros2-quick-runner")
print(stats["total_install"])
print(stats["vscode_download"])
print(stats["vsix_download"])

返回值是一个字典:

{
    "vscode_download": 45,
    "vsix_download": 137,
    "total_install": 182,
    "update_count": 33,
    "trending_daily": 0.0,
    "trending_weekly": 0.0,
    "trending_monthly": 0.0,
    "average_rating": None,
    "rating_count": None,
}

命令行用法

通过 VSCode 扩展 ID 查询统计数据:

vsced knighthood2001.ros2-quick-runner

输出 JSON,便于脚本处理:

vsced knighthood2001.ros2-quick-runner --json

查看已安装的 CLI 版本:

vsced --version

输出示例:

==== VSCode 插件统计信息 ====
插件名称:knighthood2001.ros2-quick-runner
总安装量:182
VSCode 编辑器内下载量:45
VSIX 离线包网页下载量:137
总更新次数:33
平均评分:暂无评分
评分人数:暂无评分
当日新增安装:0.0
周日均新增:0.00
月日均新增:0.00

开发与打包

如果你是这个项目的维护者,可以从源码安装:

pip install .

构建源码包和 wheel 包:

python3 -m build

如果本地 Python 环境缺少 venv,或者 setuptools 版本不够新,也可以使用下面的旧式命令构建:

python3 setup.py sdist bdist_wheel

构建产物会生成到 dist/ 目录。

项目信息

  • 包名:vsce-downloads
  • 导入名:vsce_downloads
  • CLI 命令:vsced
  • Python: >=3.7
  • 运行时依赖:requests>=2.25.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vsce_downloads-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file vsce_downloads-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: vsce_downloads-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for vsce_downloads-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a618c635e3fe42fdaedf448db4a42032ba2ceb0f32982263bc99d0ee5952861
MD5 002101ff061a04f062352a1b6e7e09d0
BLAKE2b-256 f7a4ca795587c10536bf5277599693954eb21097fe78f233e92e58673bc26139

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page