Skip to main content

a complex pattern, support typing

Project description

NEPattern

Licence PyPI PyPI - Python Version codecov

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


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.1.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

nepattern-1.0.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file nepattern-1.0.1.tar.gz.

File metadata

  • Download URL: nepattern-1.0.1.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.19.1 CPython/3.9.13 Windows/10

File hashes

Hashes for nepattern-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2f735b5f4a250954e3d27d85f75edd61f5bd724f29d21aed10a2e29b55407957
MD5 8da5e0b60ef77939525d927b956c3e1b
BLAKE2b-256 7161c980d9dd8ff4b69115a1b376d1735bccb937aa36dff8b1d749b4615cd517

See more details on using hashes here.

File details

Details for the file nepattern-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: nepattern-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.19.1 CPython/3.9.13 Windows/10

File hashes

Hashes for nepattern-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 744c8619a63401bd0816dca6c2b835aa46ab179bbd133c6737bbdcf852a2cacb
MD5 353d0c9a6025752132bc41052968be3f
BLAKE2b-256 73cfb4a3f0cc60ad95ef3a47822e500e886354a64f4a4602d0d9bf0ddef45207

See more details on using hashes here.

Supported by

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