Skip to main content

oxy-py-sdk

Python 通用工具库,提供 HTTP 请求、配置管理、加解密、日志和数据处理工具。 发行包名为 oxy-py-sdk,Python 导入包名为 oxy。支持 Python 3.15 及以上版本。

按需安装

基础包包含日志、集合、通用语言工具及 MD5/SHA256,无第三方运行时依赖。 未安装 colorama 时日志使用无颜色输出;安装 [all] 会同时安装 colorama,启用彩色日志。 其他功能按需安装:

pip install oxy-py-sdk
pip install "oxy-py-sdk[codec]"        # DES、RSA、签名等加解密
pip install "oxy-py-sdk[data]"         # DataFrame、Excel 读写及缓存
pip install "oxy-py-sdk[http]"         # HTTP 请求
pip install "oxy-py-sdk[setting]"      # YAML 配置读写
pip install "oxy-py-sdk[http,setting]" # 自由组合
pip install "oxy-py-sdk[setting,codec]" # 配置文件加解密
pip install "oxy-py-sdk[all]"          # 全部功能依赖,含彩色日志
分组 依赖 模块
codec pycryptodome、cryptography oxy.utils.codec
data pandas、openpyxl oxy.utils.data、oxy.utils.data.cache
http httpx(含 HTTP/2)、pydantic oxy.utils.http
setting pyyaml oxy.utils.setting

setting 的字典读取和转换不需要 YAML 依赖;配置文件加解密需要同时安装 setting 和 codec。 MD5/SHA256 使用标准库,无需安装 codec。DES 和 MD5 主要用于兼容现有协议。

使用示例

基础工具:

from oxy.utils.lang import gen_uuid_str
from oxy.utils.lang.collection import distinct

print(gen_uuid_str())
print(distinct([1, 1, 2]))  # [1, 2]

安装 oxy-py-sdk[http] 后:

import asyncio
from oxy.utils.http import api

@api.get("https://httpbin.org/get")
async def fetch():
    return {"q": "python"}

result = asyncio.run(fetch())

安装 oxy-py-sdk[setting] 后:

from pathlib import Path
from oxy.utils.setting import dump_yaml, load_yaml

dump_yaml({"project": {"name": "demo"}}, Path("settings.yaml"))
settings = load_yaml(Path("settings.yaml"))

开发与验证

uv sync --locked --all-extras
uv run --locked --all-extras pytest -q
uv build
uvx twine check --strict dist/*

测试不需要真实外部服务,HTTP 请求使用模拟传输。

只安装指定功能:

uv sync --locked --extra http --extra setting

修改依赖后运行 uv lock 并提交 pyproject.toml 与 uv.lock。

发布

完整配置及操作步骤见 发布说明,版本记录见 CHANGELOG。 发布 GitHub Release 后自动构建并发布到 PyPI。 版本来源为 pyproject.toml,Release 标签必须是 v 加版本号,例如 v1.0.0。

许可证

MIT,Copyright (c) 2026 wangjz。

Metadata

Release files for oxy-py-sdk 1.0.1

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

Source distribution (sdist)

Source distribution for oxy-py-sdk 1.0.1
File Size Uploaded Provenance Actions
oxy_py_sdk-1.0.1.tar.gz 57.3 kB Without provenance Details for oxy_py_sdk-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for oxy-py-sdk 1.0.1
File Interpreter ABI Platform Actions
oxy_py_sdk-1.0.1-py3-none-any.whl Python 3 none any Details for oxy_py_sdk-1.0.1-py3-none-any.whl

Total release size: 84.2 kB

Release files / oxy_py_sdk-1.0.1.tar.gz

Download URL oxy_py_sdk-1.0.1.tar.gz
Size 57.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9b9ae43b0de468139cad07cbd79fcc50d4502b3620fe6970be1161dad37bdc93
BLAKE2b-256 checksum
How to use checksums
9744e427925086c6dd003b5939781f089d3624921ca45a516ba2cfda4ae7b08d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / oxy_py_sdk-1.0.1-py3-none-any.whl

Download URL oxy_py_sdk-1.0.1-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1096b48763dd25d40ddd318159d96bf8f307ed997f63c9b2468cbd8e7a2817cb
BLAKE2b-256 checksum
How to use checksums
5e18fb13b34c9f0a147155f60ff254ed7c63fd527b3a1c7b8381b76e49526469
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for oxy-py-sdk 1.0.1

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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