command_mk2


Namecommand_mk2 JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/AbstractiveNord/CommandMk2
SummaryCustom version of Command filter for aiogram 3
upload_time2024-07-20 16:27:43
maintainerNone
docs_urlNone
authorAleksandr Antonov
requires_python<4.0,>=3.10
licenseMIT
keywords aiogram filter command commandmk2 command_mk2
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### Filter CommandMk2 Aiogram 3

![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)

---

Improved command filter

```python
class RestrictModel(BaseModel):
    period: date
    reason: Optional[str]


@router.message(CommandMk2('ban {period} {reason}', response_model=RestrictModel, response_model_name='vars'))
async def ban_user(message: Message, period: date, reason: Optional[str]):
    ...
```
---

Diff:

- Command arguments parsing, not just leaving single string like built-in aiogram filter
- Command arguments separation and validation using Pydantic model.

---
Doc is [available here](https://commandmk2.readthedocs.io/en/latest/index.html)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/AbstractiveNord/CommandMk2",
    "name": "command_mk2",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "aiogram, filter, command, commandmk2, command_mk2",
    "author": "Aleksandr Antonov",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/b3/9c/7f13a4ef67d1608775782d631e8d13a933158f3d41faaba0aed3a86082d2/command_mk2-0.1.2.tar.gz",
    "platform": null,
    "description": "### Filter CommandMk2 Aiogram 3\n\n![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)\n\n---\n\nImproved command filter\n\n```python\nclass RestrictModel(BaseModel):\n    period: date\n    reason: Optional[str]\n\n\n@router.message(CommandMk2('ban {period} {reason}', response_model=RestrictModel, response_model_name='vars'))\nasync def ban_user(message: Message, period: date, reason: Optional[str]):\n    ...\n```\n---\n\nDiff:\n\n- Command arguments parsing, not just leaving single string like built-in aiogram filter\n- Command arguments separation and validation using Pydantic model.\n\n---\nDoc is [available here](https://commandmk2.readthedocs.io/en/latest/index.html)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Custom version of Command filter for aiogram 3",
    "version": "0.1.2",
    "project_urls": {
        "Documentation": "https://commandmk2.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/AbstractiveNord/CommandMk2",
        "Repository": "https://github.com/AbstractiveNord/CommandMk2"
    },
    "split_keywords": [
        "aiogram",
        " filter",
        " command",
        " commandmk2",
        " command_mk2"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9362365e8d3fed66ab9018ae7365ebaa35e3ac94f5d04ca1194931d94f5daf58",
                "md5": "c99f9c3b8cc825730860281cc537d205",
                "sha256": "c929efa8850784b3ff07df4143d2110d9144253482779f2194620278e3c8f6db"
            },
            "downloads": -1,
            "filename": "command_mk2-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c99f9c3b8cc825730860281cc537d205",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 3928,
            "upload_time": "2024-07-20T16:27:39",
            "upload_time_iso_8601": "2024-07-20T16:27:39.971201Z",
            "url": "https://files.pythonhosted.org/packages/93/62/365e8d3fed66ab9018ae7365ebaa35e3ac94f5d04ca1194931d94f5daf58/command_mk2-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b39c7f13a4ef67d1608775782d631e8d13a933158f3d41faaba0aed3a86082d2",
                "md5": "e3f84b392353f4ded6caca5163a90fe4",
                "sha256": "ce583751405b57b9c0ebf2914b9b040b9f0d44abecd1d6f8b2f552d4cfa42158"
            },
            "downloads": -1,
            "filename": "command_mk2-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e3f84b392353f4ded6caca5163a90fe4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 3296,
            "upload_time": "2024-07-20T16:27:43",
            "upload_time_iso_8601": "2024-07-20T16:27:43.689907Z",
            "url": "https://files.pythonhosted.org/packages/b3/9c/7f13a4ef67d1608775782d631e8d13a933158f3d41faaba0aed3a86082d2/command_mk2-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-20 16:27:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AbstractiveNord",
    "github_project": "CommandMk2",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "command_mk2"
}
        
Elapsed time: 0.50625s