Skip to main content

CQPy is lightweight CoolQ Python SDK for Python 3.7+

Project description

CQPy

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

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

requirements

首先你需要一个Visual Studio 2019CMake,然后我推荐使用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.dllapp.json酷Q Pro\dev\top.weak-ptr.cqpy下。
  2. 复制cqpy酷Q Pro\data\app\top.weak-ptr.cqpy\下。

TODO && Contribute

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

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

special thanks

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

LICENSE

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

Project details


Download files

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

Source Distribution

CQPy-0.1.2.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

CQPy-0.1.2-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file CQPy-0.1.2.tar.gz.

File metadata

  • Download URL: CQPy-0.1.2.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for CQPy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4e8a79d0ad8ef319e71b1369f32fcac4205305e8e743babab87a84207f64e5ef
MD5 4ca215b252c71ee45be98fe4e2f0abc7
BLAKE2b-256 ab138c4349bfab36767d466cdc4df9e12d997512597cd3655ed290937efd22bc

See more details on using hashes here.

File details

Details for the file CQPy-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: CQPy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for CQPy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e668ae7027768c50776314a7380eb30f2c5a1691e9c215f637725a12b909cd1f
MD5 3785564cbd110bdad8e6aa2c250272e4
BLAKE2b-256 b867728840a3a1fc17e99209feecc8379d4bd19bde6680b1bdf7a4aea70d045b

See more details on using hashes here.

Supported by

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