跳转到主要内容

CEMS CPTCore web-API的公共Python SDK。

项目描述

py-cptcore

CEMS CPTCore web-API的公共Python SDK

Checked with mypy Code style: black Imports: isort

此存储库由 CEMS BV 创建,是CEMS CPTCore web-API 的公共Python包装器。

安装

要在此存储库中安装软件包,请运行

$ pip install py-cptcore

环境变量

要使用 py-cptcore,请将以下环境变量添加到您的环境中。或者在被询问时提供它们。

* NUCLEI_TOKEN
    - Your NUCLEI user token

您可以在 NUCLEI 上获得您的 NUCLEI_TOKEN。转到 personal-access-tokens 并创建一个新的用户令牌。

贡献

环境

我们建议使用Python3.9和干净的虚拟环境(使用 virtualenvconda)进行开发,从 requirements.txt 文件中安装要求。

在Linux上使用 virtualenvpip 在新环境 .env 中安装依赖项的示例

python -m venv .env
source .env/bin/activate
python -m pip install --upgrade pip setuptools
pip install -r requirements.txt
pip install -e .

文档

构建文档

python -m pip install --upgrade pip setuptools
pip install -r requirements.txt
pip install .

sphinx-build -b html docs public

格式

我们使用black和isort格式我们的代码。

black --config "pyproject.toml" src/pycptcore tests 
isort --settings-path "pyproject.toml" src/pycptcore tests

代码审查

为了保持代码质量,我们使用GitHub super-linter。

要本地运行代码审查器,请从根目录运行 run_super_linters.sh bash脚本。

单元测试

使用覆盖率测试软件

python -m pip install --upgrade pip setuptools
pip install -r requirements.txt
pip install .
coverage run -m pytest

要求

要求由python 3.9的 pip-compile 命令自动生成

使用以下内容安装pip-tools

pip install pip-tools

使用以下内容生成 requirements.txt 文件

pip-compile --extra=test --extra=lint --extra=docs --output-file=requirements.txt pyproject.toml

使用以下内容更新定义范围内的要求

pip-compile --upgrade --extra=test --extra=lint --extra=docs --output-file=requirements.txt pyproject.toml

项目详情


下载文件

下载适用于您平台文件。如果您不确定选择哪一个,请了解更多关于 安装包 的信息。

源分发

py-cptcore-0.0.3.tar.gz (7.7 kB 查看哈希)

上传时间

构建分发

py_cptcore-0.0.3-py3-none-any.whl (7.8 kB 查看哈希)

上传时间 Python 3

支持