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 支持
- 自由的环境控制
Metadata
Release files for nepattern 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nepattern-1.1.0.tar.gz | 15.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nepattern-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.0 kB
Release files / nepattern-1.1.0.tar.gz
| Download URL | nepattern-1.1.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8809fc82a9c230672117f625b804c9e60891ddeec9481caaa0ebf12ed66e7b8
|
|
BLAKE2b-256 checksum How to use checksums |
d7265bf7c48c75483b5976a101ff729c0eec3a087014c2d7e6277d006591170a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.25.6 CPython/3.11.7 Windows/10
|
Release files / nepattern-1.1.0-py3-none-any.whl
| Download URL | nepattern-1.1.0-py3-none-any.whl |
|---|---|
| Size | 19.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7acac32210fae682574d9d9a12717d7dccddbaf7cc76b4a668f36435c0a39a87
|
|
BLAKE2b-256 checksum How to use checksums |
2e34b110a4723a3bd4c9875b4ee4b428afd0660a7eafe890d755a384ffa80087
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.25.6 CPython/3.11.7 Windows/10
|