Skip to main content

CQPy

非常早期的开发状态,不要用。欢迎参与开发。

轻量级的酷Q Python插件,支持运行指定的 Python 模块。

requirements

首先你需要一个Visual Studio 2019和CMake,然后我推荐使用vcpkg来安装相关依赖。

依赖项:

  • pybind11

安装方式:

vcpkg install pybind11:x86-windows

Usage

SDK 还在 WIP 的状态,需要做基础的 Python 封装才比较方便使用(字符串解码、base64解码、json解码、回调注册),欢迎提 PR。

食用方法参考cqpy.tutorial。

设置例子:

{
    "master": 12345,  // 你的 qq 号
    "virtualenv": "C:/Users/weakptr/.virtualenvs/frejya",  // 如果有使用 virtualenv ,也需要填写 virtualenv 路径
    "extras": [
        "C:/Users/weakptr/Documents/GitHub/frejya" // 额外的python包搜索路径,会添加到 sys.path中
    ],
    "plugins": [
        ""  // 你的python包名或模块名
    ]
}

Build

准备工作:启用酷Q的开发模式。

cd /path/to/CQPy
mkdir build
cd build
cmake .. \
    "-GVisual Studio 16 2019" \
    -AWin32 \
    -DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake \
    -DCMAKE_INSTALL_PREFIX=酷Q安装路径
cmake --build .
cmake install

cmake install会做下面两件事:

  1. 复制app.dll和app.json到酷Q Pro\dev\top.weak-ptr.cqpy下。
  2. 复制cqpy到酷Q Pro\data\app\top.weak-ptr.cqpy\下。

TODO && Contribute

目前还有下面的工作没有做

  1. 在我的电脑上还有比较频繁的崩溃发生,需要更多测试和调试
  2. Python 接口(cqpy.cqp和cqpy.events)要进一步封装简化(主要是以base64返回、传递参数的部分)

special thanks

特别感谢 @richardchien 大佬的 cqcppsdk,因为没找到 酷Q 的 C++ api 文档,所以很大程度上借(ctrl+c)鉴(ctrl+v)了 richardchien 的代码,稍加我自己喜好的风格润色。

LICENSE

以 GPL-v3 协议开放源代码。

Metadata

Release files for CQPy 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CQPy 0.1.2
File Size Uploaded Provenance
CQPy-0.1.2.tar.gz 21.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for CQPy 0.1.2
File Interpreter ABI Platform
CQPy-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 42.7 kB

Release files / CQPy-0.1.2.tar.gz

Download URL CQPy-0.1.2.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4e8a79d0ad8ef319e71b1369f32fcac4205305e8e743babab87a84207f64e5ef
BLAKE2b-256 checksum
How to use checksums
ab138c4349bfab36767d466cdc4df9e12d997512597cd3655ed290937efd22bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release files / CQPy-0.1.2-py3-none-any.whl

Download URL CQPy-0.1.2-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e668ae7027768c50776314a7380eb30f2c5a1691e9c215f637725a12b909cd1f
BLAKE2b-256 checksum
How to use checksums
b867728840a3a1fc17e99209feecc8379d4bd19bde6680b1bdf7a4aea70d045b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Security for CQPy 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page