a complex pattern, support typing
Project description
NEPattern
NEPattern
(Not-Enough-Pattern
) 是一个高效的负责类型验证与类型转换的库,独立自 Alconna
简单实例
from nepattern import Pattern
pat = Pattern(str).accept(int).convert(lambda _, x: str(x))
assert pat.execute(13).success
assert pat.execute(42).value() == '42'
assert not pat << 13.0
特点
- 高效的类型转化功能
- 多种预置的实例
- 良好的 typing 支持
- 自由的环境控制
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nepattern-1.0.0.tar.gz
(15.4 kB
view hashes)
Built Distribution
nepattern-1.0.0-py3-none-any.whl
(19.4 kB
view hashes)
Close
Hashes for nepattern-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb070f4b4f606c46119a6a2698fba3bfc4054f80006ba3321a502632a04c13bc |
|
MD5 | a36510c5f0ebc8016f233fdffd8bfe87 |
|
BLAKE2b-256 | 8d48669ca9b273c6fd8f3dc29a10c890753263161e49be71f5e6fd52d6b34b4d |