syncio


Namesyncio JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/guangrei/syncio
Summarytype safety for synchronous concurrent task
upload_time2025-02-24 10:04:48
maintainerNone
docs_urlNone
authorguangrei
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) 
[![mypy](https://github.com/guangrei/syncio/actions/workflows/mypy_check.yml/badge.svg)](https://github.com/guangrei/syncio/actions) 

[![Downloads](https://static.pepy.tech/badge/syncio)](https://pepy.tech/project/syncio)
[![Downloads](https://static.pepy.tech/badge/syncio/month)](https://pepy.tech/project/syncio)
[![Downloads](https://static.pepy.tech/badge/syncio/week)](https://pepy.tech/project/syncio)

Syncio is inspired by `asyncio`. you can easy to create task and gather with `syncio.gather()` (multiprocessing) or `syncio.thread_gather()` (threading).

## Example
```python
from syncio import create_task, gather


def hello(n: int) -> str:
    return f"hello {n + 1}"


tasks = [create_task(hello)(i) for i in range(3)]
results = gather(*tasks)
print("output task_1:", results["task_1"])
print("output task_2:", results["task_2"])
print("output task_3:", results["task_3"])

# or using iterator

for result in results:
    print(result)

```
author: guangrei.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/guangrei/syncio",
    "name": "syncio",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "guangrei",
    "author_email": "myawn@pm.me",
    "download_url": "https://files.pythonhosted.org/packages/0b/65/bc8362372f8d951d076c8d8839a5da32be51dd15fbf0ce68f7151049a54c/syncio-0.0.2.tar.gz",
    "platform": "any",
    "description": "[![ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) \n[![mypy](https://github.com/guangrei/syncio/actions/workflows/mypy_check.yml/badge.svg)](https://github.com/guangrei/syncio/actions) \n\n[![Downloads](https://static.pepy.tech/badge/syncio)](https://pepy.tech/project/syncio)\n[![Downloads](https://static.pepy.tech/badge/syncio/month)](https://pepy.tech/project/syncio)\n[![Downloads](https://static.pepy.tech/badge/syncio/week)](https://pepy.tech/project/syncio)\n\nSyncio is inspired by `asyncio`. you can easy to create task and gather with `syncio.gather()` (multiprocessing) or `syncio.thread_gather()` (threading).\n\n## Example\n```python\nfrom syncio import create_task, gather\n\n\ndef hello(n: int) -> str:\n    return f\"hello {n + 1}\"\n\n\ntasks = [create_task(hello)(i) for i in range(3)]\nresults = gather(*tasks)\nprint(\"output task_1:\", results[\"task_1\"])\nprint(\"output task_2:\", results[\"task_2\"])\nprint(\"output task_3:\", results[\"task_3\"])\n\n# or using iterator\n\nfor result in results:\n    print(result)\n\n```\nauthor: guangrei.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "type safety for synchronous concurrent task",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/guangrei/syncio"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "99f8e62bbab5583837f7c913fec610114491983c66edc158c2d8adc4bd49095b",
                "md5": "53157a20c85aff839e3d95c664877a85",
                "sha256": "f6432a5c70cf9908670f5c425aaf95de9c7f6c3a0bd3075d4e9cb9bdf24f2abe"
            },
            "downloads": -1,
            "filename": "syncio-0.0.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "53157a20c85aff839e3d95c664877a85",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 3551,
            "upload_time": "2025-02-24T10:04:46",
            "upload_time_iso_8601": "2025-02-24T10:04:46.585905Z",
            "url": "https://files.pythonhosted.org/packages/99/f8/e62bbab5583837f7c913fec610114491983c66edc158c2d8adc4bd49095b/syncio-0.0.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0b65bc8362372f8d951d076c8d8839a5da32be51dd15fbf0ce68f7151049a54c",
                "md5": "3c390e40f16a91c58d51f41959fca7c5",
                "sha256": "c44c487aec63f7f59d60dbb7133f50c0f1b8ee693b8d131778cc3a3e1a3d63d5"
            },
            "downloads": -1,
            "filename": "syncio-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "3c390e40f16a91c58d51f41959fca7c5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2624,
            "upload_time": "2025-02-24T10:04:48",
            "upload_time_iso_8601": "2025-02-24T10:04:48.606063Z",
            "url": "https://files.pythonhosted.org/packages/0b/65/bc8362372f8d951d076c8d8839a5da32be51dd15fbf0ce68f7151049a54c/syncio-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-24 10:04:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "guangrei",
    "github_project": "syncio",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "syncio"
}
        
Elapsed time: 2.79621s