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.2.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.2-py3-none-any.whl (75.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: czo-0.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 1aba61e0cfda2f5838c9c32fca3e0098e7cb5d555e8a37cb88dc61e3b603bb26
MD5 a0b535ac458dfb33eab9e51ec8c4b746
BLAKE2b-256 2a889ae26ed4d12db996e40e839759c945a255b9c96846050e4466caf03fc7d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: czo-0.3.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2bc2c0c91aa3aa838efa86db89b8e7fbf90bad5574c1d62d667f126e7aa41342
MD5 7dea0f72e3c2c25251076758f886969a
BLAKE2b-256 699f2a8c71e3e2e82ff819cbfc19acaee6901253ac164c120abbd3ad9885b01a

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