nepattern


Namenepattern JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
Summarya complex pattern, support typing
upload_time2024-10-26 21:27:10
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/cd/af/b4d014ee429c3c095b3506c09e07b47c975e0f5fb21087ef1508d141deb1/nepattern-1.0.0.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.0",
    "project_urls": {
        "repository": "https://github.com/ArcletProject/NEPattern"
    },
    "split_keywords": [
        "typing",
        " pattern",
        " converter",
        " validator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8d48669ca9b273c6fd8f3dc29a10c890753263161e49be71f5e6fd52d6b34b4d",
                "md5": "a36510c5f0ebc8016f233fdffd8bfe87",
                "sha256": "bb070f4b4f606c46119a6a2698fba3bfc4054f80006ba3321a502632a04c13bc"
            },
            "downloads": -1,
            "filename": "nepattern-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a36510c5f0ebc8016f233fdffd8bfe87",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 19369,
            "upload_time": "2024-10-26T21:27:09",
            "upload_time_iso_8601": "2024-10-26T21:27:09.476573Z",
            "url": "https://files.pythonhosted.org/packages/8d/48/669ca9b273c6fd8f3dc29a10c890753263161e49be71f5e6fd52d6b34b4d/nepattern-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cdafb4d014ee429c3c095b3506c09e07b47c975e0f5fb21087ef1508d141deb1",
                "md5": "68ed9fa882c0fa73a2596189a1d1f39f",
                "sha256": "221772130e6925b12ec8434e25e9405c7f0e2479fb3c5a131e68c4c5dac0b30e"
            },
            "downloads": -1,
            "filename": "nepattern-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "68ed9fa882c0fa73a2596189a1d1f39f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 15449,
            "upload_time": "2024-10-26T21:27:10",
            "upload_time_iso_8601": "2024-10-26T21:27:10.632212Z",
            "url": "https://files.pythonhosted.org/packages/cd/af/b4d014ee429c3c095b3506c09e07b47c975e0f5fb21087ef1508d141deb1/nepattern-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-26 21:27:10",
    "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: 1.43540s