flyerapi


Nameflyerapi JSON
Version 1.2.0 PyPI version JSON
download
home_pagehttps://github.com/EliCreator/flyerapi
SummaryAsynchronous api of the Flyer service
upload_time2024-11-02 16:23:41
maintainerNone
docs_urlNone
authorEli
requires_pythonNone
licenseNone
keywords python flyer async asyncio cache
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="left">
    <h1>FlyerAPI<img src="https://telegra.ph/file/e2a2f0526d2937973a70b.png" width=50 height=50></h1>
    <p align="left" >
        <a href="https://pypi.org/project/flyerapi/">
            <img src="https://img.shields.io/pypi/v/flyerapi?style=flat-square" alt="PyPI">
        </a>
        <a href="https://pypi.org/project/flyerapi/">
            <img src="https://img.shields.io/pypi/dm/flyerapi?style=flat-square" alt="PyPI">
        </a>
    </p>
</div>


## Usage

With ``flyerapi`` you can use <a href="https://api.flyerservice.io/redoc">FlyerAPI</a> together with Telegram<br/>
Documentation: https://api.flyerservice.io/redoc

## Installation

```bash
pip install flyerapi
```

## Requirements

 - ``Python 3.7+``
 - ``aiohttp``

## Features

 - ``Asynchronous``
 - ``Exception handling``


## Basic example for a mandatory subscription with aiogram

```python
from flyerapi import Flyer

from aiogram import types


flyer = Flyer(KEY)

async def message_handler(message: types.Message):
    # Use it wherever verification is necessary
    if not await flyer.check(message.from_user.id, language_code=message.from_user.language_code):
        return

async def callback_handler(call: types.CallbackQuery):
    # Use it wherever verification is necessary
    if not await flyer.check(call.from_user.id, language_code=call.from_user.language_code):
        return
```

### Using custom message

```python
message = {
    'text': '<b>Custom text</b> for $name',  # HTML

    'button_bot': 'Start',
    'button_channel': 'Subscribe',
    'button_url': 'Follow',
}
await flyer.check(user_id, language_code=language_code, message=message)
```

## Example for tasks

```python
# Getting tasks for the user
tasks = await flyer.get_tasks(
    user_id=user_id,
    language_code=language_code,  # used only for new pinning
    limit=5,  # used only for new pinning
)

...

# Checking for completed task
status = await flyer.check_task(
    user_id=user_id,
    signature=tasks[0]['signature'],
)


```


Developed by Eli (c) 2023-2024

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/EliCreator/flyerapi",
    "name": "flyerapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, flyer, async, asyncio, cache",
    "author": "Eli",
    "author_email": "<eli.dev.tg@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a6/1f/deaa794b0db915835dc1ad41af8d8c86d10fa7031b1c856b6eebfec93f14/flyerapi-1.2.0.tar.gz",
    "platform": null,
    "description": "<div align=\"left\">\r\n    <h1>FlyerAPI<img src=\"https://telegra.ph/file/e2a2f0526d2937973a70b.png\" width=50 height=50></h1>\r\n    <p align=\"left\" >\r\n        <a href=\"https://pypi.org/project/flyerapi/\">\r\n            <img src=\"https://img.shields.io/pypi/v/flyerapi?style=flat-square\" alt=\"PyPI\">\r\n        </a>\r\n        <a href=\"https://pypi.org/project/flyerapi/\">\r\n            <img src=\"https://img.shields.io/pypi/dm/flyerapi?style=flat-square\" alt=\"PyPI\">\r\n        </a>\r\n    </p>\r\n</div>\r\n\r\n\r\n## Usage\r\n\r\nWith ``flyerapi`` you can use <a href=\"https://api.flyerservice.io/redoc\">FlyerAPI</a> together with Telegram<br/>\r\nDocumentation: https://api.flyerservice.io/redoc\r\n\r\n## Installation\r\n\r\n```bash\r\npip install flyerapi\r\n```\r\n\r\n## Requirements\r\n\r\n - ``Python 3.7+``\r\n - ``aiohttp``\r\n\r\n## Features\r\n\r\n - ``Asynchronous``\r\n - ``Exception handling``\r\n\r\n\r\n## Basic example for a mandatory subscription with aiogram\r\n\r\n```python\r\nfrom flyerapi import Flyer\r\n\r\nfrom aiogram import types\r\n\r\n\r\nflyer = Flyer(KEY)\r\n\r\nasync def message_handler(message: types.Message):\r\n    # Use it wherever verification is necessary\r\n    if not await flyer.check(message.from_user.id, language_code=message.from_user.language_code):\r\n        return\r\n\r\nasync def callback_handler(call: types.CallbackQuery):\r\n    # Use it wherever verification is necessary\r\n    if not await flyer.check(call.from_user.id, language_code=call.from_user.language_code):\r\n        return\r\n```\r\n\r\n### Using custom message\r\n\r\n```python\r\nmessage = {\r\n    'text': '<b>Custom text</b> for $name',  # HTML\r\n\r\n    'button_bot': 'Start',\r\n    'button_channel': 'Subscribe',\r\n    'button_url': 'Follow',\r\n}\r\nawait flyer.check(user_id, language_code=language_code, message=message)\r\n```\r\n\r\n## Example for tasks\r\n\r\n```python\r\n# Getting tasks for the user\r\ntasks = await flyer.get_tasks(\r\n    user_id=user_id,\r\n    language_code=language_code,  # used only for new pinning\r\n    limit=5,  # used only for new pinning\r\n)\r\n\r\n...\r\n\r\n# Checking for completed task\r\nstatus = await flyer.check_task(\r\n    user_id=user_id,\r\n    signature=tasks[0]['signature'],\r\n)\r\n\r\n\r\n```\r\n\r\n\r\nDeveloped by Eli (c) 2023-2024\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Asynchronous api of the Flyer service",
    "version": "1.2.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/EliCreator/flyerapi/issues",
        "Homepage": "https://github.com/EliCreator/flyerapi"
    },
    "split_keywords": [
        "python",
        " flyer",
        " async",
        " asyncio",
        " cache"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a61fdeaa794b0db915835dc1ad41af8d8c86d10fa7031b1c856b6eebfec93f14",
                "md5": "791daa23ca8b8e4ec9d50d3884d1b92c",
                "sha256": "c5f4545db6b269f6bd97d0612dc2d5a22b99e38d966d031558cab94b329c11ac"
            },
            "downloads": -1,
            "filename": "flyerapi-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "791daa23ca8b8e4ec9d50d3884d1b92c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4867,
            "upload_time": "2024-11-02T16:23:41",
            "upload_time_iso_8601": "2024-11-02T16:23:41.698075Z",
            "url": "https://files.pythonhosted.org/packages/a6/1f/deaa794b0db915835dc1ad41af8d8c86d10fa7031b1c856b6eebfec93f14/flyerapi-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-02 16:23:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "EliCreator",
    "github_project": "flyerapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flyerapi"
}
        
Eli
Elapsed time: 1.72973s