soc-python


Namesoc-python JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummarySOC工具执行器 - 执行本地Python文件并通过HTTP API提交
upload_time2025-08-28 07:52:31
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT
keywords soc security automation http-client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SOC Executor

SOC工具执行器 - 执行本地Python文件并通过HTTP API提交到SOC平台

## 功能特性

- 读取本地Python脚本文件
- 通过HTTP API提交代码到SOC平台执行
- 支持环境变量配置
- 命令行工具,使用简单
- 支持传递JSON格式参数

## 安装

```bash
pip install soc-executor
```

## 使用方法

### 基本用法

```bash
# 执行Python文件
soc-executor script.py

# 使用 --file 参数
soc-executor --file /path/to/script.py

# 传递参数
soc-executor script.py --params '{"key": "value"}'
```

### 环境变量配置

```bash
export HTTP_BASE_URL="http://your-soc-server:port"
export HTTP_TOKEN="your-api-token"
```

## 示例

创建一个测试脚本 `test_script.py`:

```python
def test_function():
    print("Hello from SOC executor!")
    return {"status": "success", "message": "Test completed"}

if __name__ == "__main__":
    result = test_function()
    print(result)
```

执行脚本:

```bash
soc-executor test_script.py
```

## 开发

使用 uv 进行开发环境管理:

```bash
# 安装开发依赖
uv sync --dev

# 运行测试
uv run pytest

# 构建包
uv run python -m build
```

## 许可证

MIT License

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "soc-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "soc, security, automation, http-client",
    "author": null,
    "author_email": "liuzhuo <liuzhuo@example.com>",
    "download_url": "https://files.pythonhosted.org/packages/0a/4b/b12f86f3e962f0dd71c02ab886096fc83721ebc0984cf03351f613ae0dbf/soc_python-0.1.1.tar.gz",
    "platform": null,
    "description": "# SOC Executor\n\nSOC\u5de5\u5177\u6267\u884c\u5668 - \u6267\u884c\u672c\u5730Python\u6587\u4ef6\u5e76\u901a\u8fc7HTTP API\u63d0\u4ea4\u5230SOC\u5e73\u53f0\n\n## \u529f\u80fd\u7279\u6027\n\n- \u8bfb\u53d6\u672c\u5730Python\u811a\u672c\u6587\u4ef6\n- \u901a\u8fc7HTTP API\u63d0\u4ea4\u4ee3\u7801\u5230SOC\u5e73\u53f0\u6267\u884c\n- \u652f\u6301\u73af\u5883\u53d8\u91cf\u914d\u7f6e\n- \u547d\u4ee4\u884c\u5de5\u5177\uff0c\u4f7f\u7528\u7b80\u5355\n- \u652f\u6301\u4f20\u9012JSON\u683c\u5f0f\u53c2\u6570\n\n## \u5b89\u88c5\n\n```bash\npip install soc-executor\n```\n\n## \u4f7f\u7528\u65b9\u6cd5\n\n### \u57fa\u672c\u7528\u6cd5\n\n```bash\n# \u6267\u884cPython\u6587\u4ef6\nsoc-executor script.py\n\n# \u4f7f\u7528 --file \u53c2\u6570\nsoc-executor --file /path/to/script.py\n\n# \u4f20\u9012\u53c2\u6570\nsoc-executor script.py --params '{\"key\": \"value\"}'\n```\n\n### \u73af\u5883\u53d8\u91cf\u914d\u7f6e\n\n```bash\nexport HTTP_BASE_URL=\"http://your-soc-server:port\"\nexport HTTP_TOKEN=\"your-api-token\"\n```\n\n## \u793a\u4f8b\n\n\u521b\u5efa\u4e00\u4e2a\u6d4b\u8bd5\u811a\u672c `test_script.py`:\n\n```python\ndef test_function():\n    print(\"Hello from SOC executor!\")\n    return {\"status\": \"success\", \"message\": \"Test completed\"}\n\nif __name__ == \"__main__\":\n    result = test_function()\n    print(result)\n```\n\n\u6267\u884c\u811a\u672c:\n\n```bash\nsoc-executor test_script.py\n```\n\n## \u5f00\u53d1\n\n\u4f7f\u7528 uv \u8fdb\u884c\u5f00\u53d1\u73af\u5883\u7ba1\u7406:\n\n```bash\n# \u5b89\u88c5\u5f00\u53d1\u4f9d\u8d56\nuv sync --dev\n\n# \u8fd0\u884c\u6d4b\u8bd5\nuv run pytest\n\n# \u6784\u5efa\u5305\nuv run python -m build\n```\n\n## \u8bb8\u53ef\u8bc1\n\nMIT License\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "SOC\u5de5\u5177\u6267\u884c\u5668 - \u6267\u884c\u672c\u5730Python\u6587\u4ef6\u5e76\u901a\u8fc7HTTP API\u63d0\u4ea4",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/liuzhuogood/soc-python",
        "Issues": "https://github.com/liuzhuogood/soc-python/issues",
        "Repository": "https://github.com/liuzhuogood/soc-python.git"
    },
    "split_keywords": [
        "soc",
        " security",
        " automation",
        " http-client"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "42b756bd2c33afa0a15adad3ed96ad1db5afefe1de95a22f773b53d350ccb3f1",
                "md5": "5350ad0576be3d0fa5c020fac8eb0991",
                "sha256": "1f0a14b355daa1a4294ecf898437efb9af2bc8a63b58332764aa846030878ecb"
            },
            "downloads": -1,
            "filename": "soc_python-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5350ad0576be3d0fa5c020fac8eb0991",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7901,
            "upload_time": "2025-08-28T07:52:30",
            "upload_time_iso_8601": "2025-08-28T07:52:30.897713Z",
            "url": "https://files.pythonhosted.org/packages/42/b7/56bd2c33afa0a15adad3ed96ad1db5afefe1de95a22f773b53d350ccb3f1/soc_python-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0a4bb12f86f3e962f0dd71c02ab886096fc83721ebc0984cf03351f613ae0dbf",
                "md5": "00d9f8be2f175494db8ba4f81cbf0073",
                "sha256": "addaae682194c667546d23156f745d253ac25459f124e16b48ce08ed19b33b90"
            },
            "downloads": -1,
            "filename": "soc_python-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "00d9f8be2f175494db8ba4f81cbf0073",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7485,
            "upload_time": "2025-08-28T07:52:31",
            "upload_time_iso_8601": "2025-08-28T07:52:31.914588Z",
            "url": "https://files.pythonhosted.org/packages/0a/4b/b12f86f3e962f0dd71c02ab886096fc83721ebc0984cf03351f613ae0dbf/soc_python-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-28 07:52:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "liuzhuogood",
    "github_project": "soc-python",
    "github_not_found": true,
    "lcname": "soc-python"
}
        
Elapsed time: 0.86390s