Skip to main content

构建测试数据的工具包

Project description

测试工具库 czo

用于快速构造测试数据与常用辅助函数(时间、随机、网络、路径、假数据)。

安装

pip install czo

快速上手

from czo import Rand, Faker, DateTime, Net, Paths

Rand.random_str(12)              # 随机字符串
Rand.random_email()              # 随机邮箱
Rand.random_url()                # 随机 URL

DateTime.parse_iso8601("2024-01-01T00:00:00Z")  # 解析 ISO8601
DateTime.to_timezone("2024-01-01T00:00:00Z", 8) # 转换时区

Net.generate_ip_list(3)          # 生成 IPv4 列表
Net.ip_in_range("192.168.1.1", "192.168.1.0/24")

faker = Faker()
faker.profile(zh=True)           # 随机中文个人档案

开发与测试

python -m venv .venv && .\.venv\Scripts\activate  # Windows
pip install -r requirements.txt
python -m pytest

目录结构

  • src/czo/utils/ 核心工具(时间、随机、网络、路径、假数据等)
  • src/czo/data/ 内置数据集(地址、学校、车牌等)
  • tests/ pytest 用例

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

czo-0.3.3.tar.gz (73.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

czo-0.3.3-py3-none-any.whl (75.5 kB view details)

Uploaded Python 3

File details

Details for the file czo-0.3.3.tar.gz.

File metadata

  • Download URL: czo-0.3.3.tar.gz
  • Upload date:
  • Size: 73.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for czo-0.3.3.tar.gz
Algorithm Hash digest
SHA256 4bd702378a7db39fef57b16df0ddf6d27fb8685df7b65775f2ad5c63f53a62c3
MD5 336de50882866686284f671f2cb91340
BLAKE2b-256 2f0c54d3d138011a24eb9b2e113f4bfa2ea12175f8e97bd7cd981ce0ca081617

See more details on using hashes here.

File details

Details for the file czo-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: czo-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 75.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for czo-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c486b33c09e61f68b8ae3344b7351dfb47f81f12ba94f3635c1ea5728412979d
MD5 d9de9e01e1e3aa10a94d79f81b20199a
BLAKE2b-256 0d9c073e434883b9bf49c48487c239e7380ee5de60dacf3e74968570452e0cd5

See more details on using hashes here.

Supported by

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