Name | ezptn JSON |
Version |
0.0.1
JSON |
| download |
home_page | https://github.co.jp/ |
Summary | String pattern matching with placeholders. |
upload_time | 2023-10-21 09:54:33 |
maintainer | |
docs_url | None |
author | le_lattelle |
requires_python | |
license | CC0 v1.0 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ezptn
## Overview
- String pattern matching with placeholders.
- プレースホルダーを使った文字列パターンマッチ
## Usage
```python
import ezptn
res = ezptn.match("lambda %s: %s", "lambda a: a ** 2")
print(res) # -> [('a', 'a ** 2')]
res = ezptn.match("%s:%s", "13:12:24")
print(res) # -> [('13', '12:24'), ('13:12', '24')]
res = ezptn.match("%s--%s", "hoge-fuga")
print(res) # -> []
res = ezptn.match("%squid", "equid")
print(res) # -> [('e',)]
res = ezptn.match("%s(%s)", "hoge(22)")
print(res) # -> [('hoge', '22')]
res = ezptn.match("%s(%s)", "hoge()")
print(res) # -> [('hoge', '')]
res = ezptn.match("%s(%s)", "hoge()", allow_empty = False)
print(res) # -> []
res = ezptn.match("(%s,((%s,%s),%s))", '(23,(("s",44),44))')
print(res) # -> [('23', '"s"', '44', '44')]
```
Raw data
{
"_id": null,
"home_page": "https://github.co.jp/",
"name": "ezptn",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "le_lattelle",
"author_email": "g.tiger.ml@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f2/cb/a5792179c6fdf3b442260d516bd3ef0e3621c20507fae3a6e4e3f734dee0/ezptn-0.0.1.tar.gz",
"platform": null,
"description": "# ezptn\n\n## Overview\n- String pattern matching with placeholders.\n- \u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u3092\u4f7f\u3063\u305f\u6587\u5b57\u5217\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\n\n## Usage\n```python\nimport ezptn\n\nres = ezptn.match(\"lambda %s: %s\", \"lambda a: a ** 2\")\nprint(res)\t# -> [('a', 'a ** 2')]\nres = ezptn.match(\"%s:%s\", \"13:12:24\")\nprint(res)\t# -> [('13', '12:24'), ('13:12', '24')]\nres = ezptn.match(\"%s--%s\", \"hoge-fuga\")\nprint(res)\t# -> []\nres = ezptn.match(\"%squid\", \"equid\")\nprint(res)\t# -> [('e',)]\nres = ezptn.match(\"%s(%s)\", \"hoge(22)\")\nprint(res)\t# -> [('hoge', '22')]\nres = ezptn.match(\"%s(%s)\", \"hoge()\")\nprint(res)\t# -> [('hoge', '')]\nres = ezptn.match(\"%s(%s)\", \"hoge()\", allow_empty = False)\nprint(res)\t# -> []\nres = ezptn.match(\"(%s,((%s,%s),%s))\", '(23,((\"s\",44),44))')\nprint(res)\t# -> [('23', '\"s\"', '44', '44')]\n```\n\n\n",
"bugtrack_url": null,
"license": "CC0 v1.0",
"summary": "String pattern matching with placeholders.",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.co.jp/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "23f5cc6f639e3581fbf3a02f1bf85fc95639e37366b5f782ed88978be210fb6c",
"md5": "73b9b33a6610376ab083b03dbb5ff309",
"sha256": "59756ea38cfbbaa3cbdad3999043a1c2d41bf86ef8cce4402571d21676d28d1a"
},
"downloads": -1,
"filename": "ezptn-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "73b9b33a6610376ab083b03dbb5ff309",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3159,
"upload_time": "2023-10-21T09:54:31",
"upload_time_iso_8601": "2023-10-21T09:54:31.500736Z",
"url": "https://files.pythonhosted.org/packages/23/f5/cc6f639e3581fbf3a02f1bf85fc95639e37366b5f782ed88978be210fb6c/ezptn-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f2cba5792179c6fdf3b442260d516bd3ef0e3621c20507fae3a6e4e3f734dee0",
"md5": "2b3b4fad6ebb54e6a46786f595aca754",
"sha256": "24a5a9f8de44f500008d8cff138a8f71f9559f2240345cf65b3215ec89e16685"
},
"downloads": -1,
"filename": "ezptn-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "2b3b4fad6ebb54e6a46786f595aca754",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2835,
"upload_time": "2023-10-21T09:54:33",
"upload_time_iso_8601": "2023-10-21T09:54:33.870351Z",
"url": "https://files.pythonhosted.org/packages/f2/cb/a5792179c6fdf3b442260d516bd3ef0e3621c20507fae3a6e4e3f734dee0/ezptn-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-21 09:54:33",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "ezptn"
}