nepattern


Namenepattern JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
Summarya complex pattern, support typing
upload_time2024-11-21 11:08:13
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords typing pattern converter validator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # NEPattern

[![Licence](https://img.shields.io/github/license/ArcletProject/NEPattern)](https://github.com/ArcletProject/NEPattern/blob/master/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/nepattern)](https://pypi.org/project/nepattern)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nepattern)](https://www.python.org/)
[![codecov](https://codecov.io/gh/ArcletProject/NEPattern/branch/master/graph/badge.svg?token=DOMUPLN5XO)](https://codecov.io/gh/ArcletProject/NEPattern)

`NEPattern` (`Not-Enough-Pattern`) 是一个高效的负责类型验证与类型转换的库,独立自 [Alconna](https://github.com/ArcletProject/Alconna)

## 简单实例

```python
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 支持
- 自由的环境控制
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nepattern",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "typing, pattern, converter, validator",
    "author": null,
    "author_email": "RF-Tar-Railt <rf_tar_railt@qq.com>",
    "download_url": "https://files.pythonhosted.org/packages/71/61/c980d9dd8ff4b69115a1b376d1735bccb937aa36dff8b1d749b4615cd517/nepattern-1.0.1.tar.gz",
    "platform": null,
    "description": "# NEPattern\n\n[![Licence](https://img.shields.io/github/license/ArcletProject/NEPattern)](https://github.com/ArcletProject/NEPattern/blob/master/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/nepattern)](https://pypi.org/project/nepattern)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nepattern)](https://www.python.org/)\n[![codecov](https://codecov.io/gh/ArcletProject/NEPattern/branch/master/graph/badge.svg?token=DOMUPLN5XO)](https://codecov.io/gh/ArcletProject/NEPattern)\n\n`NEPattern` (`Not-Enough-Pattern`) \u662f\u4e00\u4e2a\u9ad8\u6548\u7684\u8d1f\u8d23\u7c7b\u578b\u9a8c\u8bc1\u4e0e\u7c7b\u578b\u8f6c\u6362\u7684\u5e93\uff0c\u72ec\u7acb\u81ea [Alconna](https://github.com/ArcletProject/Alconna)\n\n## \u7b80\u5355\u5b9e\u4f8b\n\n```python\nfrom nepattern import Pattern\n\n\npat = Pattern(str).accept(int).convert(lambda _, x: str(x))\nassert pat.execute(13).success\nassert pat.execute(42).value() == '42'\nassert not pat << 13.0\n```\n\n## \u7279\u70b9\n\n- \u9ad8\u6548\u7684\u7c7b\u578b\u8f6c\u5316\u529f\u80fd\n- \u591a\u79cd\u9884\u7f6e\u7684\u5b9e\u4f8b\n- \u826f\u597d\u7684 typing \u652f\u6301\n- \u81ea\u7531\u7684\u73af\u5883\u63a7\u5236",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "a complex pattern, support typing",
    "version": "1.0.1",
    "project_urls": {
        "repository": "https://github.com/ArcletProject/NEPattern"
    },
    "split_keywords": [
        "typing",
        " pattern",
        " converter",
        " validator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73cfb4a3f0cc60ad95ef3a47822e500e886354a64f4a4602d0d9bf0ddef45207",
                "md5": "353d0c9a6025752132bc41052968be3f",
                "sha256": "744c8619a63401bd0816dca6c2b835aa46ab179bbd133c6737bbdcf852a2cacb"
            },
            "downloads": -1,
            "filename": "nepattern-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "353d0c9a6025752132bc41052968be3f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 19298,
            "upload_time": "2024-11-21T11:08:11",
            "upload_time_iso_8601": "2024-11-21T11:08:11.209862Z",
            "url": "https://files.pythonhosted.org/packages/73/cf/b4a3f0cc60ad95ef3a47822e500e886354a64f4a4602d0d9bf0ddef45207/nepattern-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7161c980d9dd8ff4b69115a1b376d1735bccb937aa36dff8b1d749b4615cd517",
                "md5": "8da5e0b60ef77939525d927b956c3e1b",
                "sha256": "2f735b5f4a250954e3d27d85f75edd61f5bd724f29d21aed10a2e29b55407957"
            },
            "downloads": -1,
            "filename": "nepattern-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8da5e0b60ef77939525d927b956c3e1b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 15348,
            "upload_time": "2024-11-21T11:08:13",
            "upload_time_iso_8601": "2024-11-21T11:08:13.169620Z",
            "url": "https://files.pythonhosted.org/packages/71/61/c980d9dd8ff4b69115a1b376d1735bccb937aa36dff8b1d749b4615cd517/nepattern-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-21 11:08:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ArcletProject",
    "github_project": "NEPattern",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "nepattern"
}
        
Elapsed time: 0.48595s