Name | ascall JSON |
Version |
0.1.1
JSON |
| download |
home_page | None |
Summary | ascall用于自动识别同步或异步的可调用对象,然后进行转换并执行异步调用返回结果。 |
upload_time | 2022-09-20 15:15:11 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | None |
keywords |
async
asyncio
func
function
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ascall
> ascall用于自动识别同步或异步的可调用对象,
> 然后进行转换并执行异步调用返回结果。
>
> ascall可作为函数运行,也可作为装饰器。
## 装饰器用法
```python
import asyncio
from ascall import ascall
@ascall()
def sync_func():
print("sync func run.")
asyncio.run(sync_func())
```
## 函数用法
```python
import asyncio
from ascall import ascall
def sync_func(msg: str):
print("sync func run.", msg)
async def main():
print("async func run.")
await ascall(sync_func, "some msg")
asyncio.run(main())
```
Raw data
{
"_id": null,
"home_page": null,
"name": "ascall",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "async,asyncio,func,function",
"author": null,
"author_email": "vastxiao <vastxiao@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c1/d9/2b2cde51dae6bdb327865d62b89a9305b038a95697e1994ea5828d13d372/ascall-0.1.1.tar.gz",
"platform": null,
"description": "# ascall\n\n> ascall\u7528\u4e8e\u81ea\u52a8\u8bc6\u522b\u540c\u6b65\u6216\u5f02\u6b65\u7684\u53ef\u8c03\u7528\u5bf9\u8c61\uff0c\n> \u7136\u540e\u8fdb\u884c\u8f6c\u6362\u5e76\u6267\u884c\u5f02\u6b65\u8c03\u7528\u8fd4\u56de\u7ed3\u679c\u3002\n> \n> ascall\u53ef\u4f5c\u4e3a\u51fd\u6570\u8fd0\u884c\uff0c\u4e5f\u53ef\u4f5c\u4e3a\u88c5\u9970\u5668\u3002\n\n## \u88c5\u9970\u5668\u7528\u6cd5\n\n```python\nimport asyncio\nfrom ascall import ascall\n\n\n@ascall()\ndef sync_func():\n print(\"sync func run.\")\n\n\nasyncio.run(sync_func())\n```\n\n## \u51fd\u6570\u7528\u6cd5\n\n```python\nimport asyncio\nfrom ascall import ascall\n\n\ndef sync_func(msg: str):\n print(\"sync func run.\", msg)\n\n\nasync def main():\n print(\"async func run.\")\n await ascall(sync_func, \"some msg\")\n\n\nasyncio.run(main())\n```",
"bugtrack_url": null,
"license": null,
"summary": "ascall\u7528\u4e8e\u81ea\u52a8\u8bc6\u522b\u540c\u6b65\u6216\u5f02\u6b65\u7684\u53ef\u8c03\u7528\u5bf9\u8c61\uff0c\u7136\u540e\u8fdb\u884c\u8f6c\u6362\u5e76\u6267\u884c\u5f02\u6b65\u8c03\u7528\u8fd4\u56de\u7ed3\u679c\u3002",
"version": "0.1.1",
"project_urls": {
"Home": "https://vastxiao.github.io/"
},
"split_keywords": [
"async",
"asyncio",
"func",
"function"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1345ca9e3c983ae1a9f2bd8172921b5e50f3dd6b51a68083b47a9b7ed2032eae",
"md5": "a9f5f99d17fd9c23151f12cf49792c64",
"sha256": "855827d4ee2c7e6218a993abe50e4cfb09148a593fca5162861962a2542ae810"
},
"downloads": -1,
"filename": "ascall-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a9f5f99d17fd9c23151f12cf49792c64",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 2947,
"upload_time": "2022-09-20T15:15:08",
"upload_time_iso_8601": "2022-09-20T15:15:08.647453Z",
"url": "https://files.pythonhosted.org/packages/13/45/ca9e3c983ae1a9f2bd8172921b5e50f3dd6b51a68083b47a9b7ed2032eae/ascall-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c1d92b2cde51dae6bdb327865d62b89a9305b038a95697e1994ea5828d13d372",
"md5": "9cc77856d48f9ad98fe5f57cb073b98b",
"sha256": "0feb7dda0d609d17764235bdf24fb7eeea299d10e1beba0a150668df6a905358"
},
"downloads": -1,
"filename": "ascall-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "9cc77856d48f9ad98fe5f57cb073b98b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 2556,
"upload_time": "2022-09-20T15:15:11",
"upload_time_iso_8601": "2022-09-20T15:15:11.204033Z",
"url": "https://files.pythonhosted.org/packages/c1/d9/2b2cde51dae6bdb327865d62b89a9305b038a95697e1994ea5828d13d372/ascall-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-09-20 15:15:11",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "ascall"
}