autogram


Nameautogram JSON
Version 3.4.4 PyPI version JSON
download
home_page
SummaryAn easily extensible telegram API wrapper
upload_time2023-10-30 14:46:30
maintainer
docs_urlNone
author
requires_python>=3.6
licenseMIT License Copyright (c) 2022 sp3rtah Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords telegram api wrapper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p style="text-align: center;">
    <img src="https://raw.githubusercontent.com/sp3rtah/autogram/main/autogram.png" align="middle" alt="Autogram">
<p>

## Installation :: Python3
`pip install autogram`

## Sample usage
```python
from autogram import Autogram
from autogram import Start
from loguru import logger

def handle_update(update):
    logger.info(update)

@Start()
def main(config):
    bot = Autogram(config)
    bot.settings('AUTOGRAM_ENDPOINT', 'https://3c23-105-161-113-44.ngrok.io') # ngrok addr webhook injection
    bot.addHandler(handle_update)
    bot.start()
```

## `0x00 An efficient asyncronous Telegram bot API wrapper!`
Autogram is a telegram BOT API wrapper with focus on simplicity and performance.

## `0x01 Why AutoGram?`
I need a bot framework that makes it easy to administer control remotely.

Autogram has a built-in webhook endpoint written using Bottle. Therefore, if you have a public IP, or can get an external service to comminicate with `localhost` through a service like ngrok (I use it too!), then set that endpoint as AUTOGRAM_ENDPOINT in your environment variable, or inject its value in the bot config during startup, pointing to `lport` defined in configuration file. If the public address provided is not accessible, the program will use polling to fetch updates.
You add functionality to Autogram bot py implementing and adding callback functions. The bot will therefore work with available callbacks, and will continue to work even if none is specified! This allows the bot to work with available features, despite missing user-implemented handlers for specific updates.

## `0x02 Currently implemented API methods`
- Approx. 1/4 (essentials only)

## `0x03 Project TODOs`
- Plans to cover the entire telegram API methods.

### `footnotes`
- Running `pip install autogram` installs SQLAlchemy too incase you need to add database storage functionality.
- If the `telegram token` is missing in `config file`, or is INVALID, the bot will terminate.
- `Polling` can be implemented by the user, while feeding data to the bot through `bot.parseUpdate(...)`
- Autogram searches for bot `token` in the specified `config file` before resolving to env variable value.
- Don't run multiple bots with the same `TOKEN` as this will cause update problems
- Sending unescaped special characters when using MarkdownV2 will return HTTP400
- Have `fun` with whatever you're building `;)`

## `unlock sublime text 4 license`
This guide also works for linux. The file that needs to be replaced is located in: /opt/sublime_text/sublime_text in case of debian based systems. (Ubuntu, Debian etc.)

Here are the instructions that I followed:

- Go to https://hexed.it/
- Click Open File in the top left corner and select /opt/sublime_text/sublime_text
- Press CTRL + F or on the Search for bar in the left panel and look for: 80 78 05 00 0f 94 C1
- Now in the editor, click on the first byte (80) and start replacing each byte by: C6 40 05 01 48 85 C9
- Finally, in the top left corner again, click on Export Button. This will download the file in your Downloads Folder.
- Execute sudo cp ~/Downloads/sublime_text /opt/sublime_text/sublime_text to replace the original file.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "autogram",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "telegram,API,wrapper",
    "author": "",
    "author_email": "sp3rtah <ngaira14nelson@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/73/28/d3e5b013f07d772979f594e819441438c42f5fc699dfa3ebfc6b1ab9fdcf/autogram-3.4.4.tar.gz",
    "platform": null,
    "description": "<p style=\"text-align: center;\">\n    <img src=\"https://raw.githubusercontent.com/sp3rtah/autogram/main/autogram.png\" align=\"middle\" alt=\"Autogram\">\n<p>\n\n## Installation :: Python3\n`pip install autogram`\n\n## Sample usage\n```python\nfrom autogram import Autogram\nfrom autogram import Start\nfrom loguru import logger\n\ndef handle_update(update):\n    logger.info(update)\n\n@Start()\ndef main(config):\n    bot = Autogram(config)\n    bot.settings('AUTOGRAM_ENDPOINT', 'https://3c23-105-161-113-44.ngrok.io') # ngrok addr webhook injection\n    bot.addHandler(handle_update)\n    bot.start()\n```\n\n## `0x00 An efficient asyncronous Telegram bot API wrapper!`\nAutogram is a telegram BOT API wrapper with focus on simplicity and performance.\n\n## `0x01 Why AutoGram?`\nI need a bot framework that makes it easy to administer control remotely.\n\nAutogram has a built-in webhook endpoint written using Bottle. Therefore, if you have a public IP, or can get an external service to comminicate with `localhost` through a service like ngrok (I use it too!), then set that endpoint as AUTOGRAM_ENDPOINT in your environment variable, or inject its value in the bot config during startup, pointing to `lport` defined in configuration file. If the public address provided is not accessible, the program will use polling to fetch updates.\nYou add functionality to Autogram bot py implementing and adding callback functions. The bot will therefore work with available callbacks, and will continue to work even if none is specified! This allows the bot to work with available features, despite missing user-implemented handlers for specific updates.\n\n## `0x02 Currently implemented API methods`\n- Approx. 1/4 (essentials only)\n\n## `0x03 Project TODOs`\n- Plans to cover the entire telegram API methods.\n\n### `footnotes`\n- Running `pip install autogram` installs SQLAlchemy too incase you need to add database storage functionality.\n- If the `telegram token` is missing in `config file`, or is INVALID, the bot will terminate.\n- `Polling` can be implemented by the user, while feeding data to the bot through `bot.parseUpdate(...)`\n- Autogram searches for bot `token` in the specified `config file` before resolving to env variable value.\n- Don't run multiple bots with the same `TOKEN` as this will cause update problems\n- Sending unescaped special characters when using MarkdownV2 will return HTTP400\n- Have `fun` with whatever you're building `;)`\n\n## `unlock sublime text 4 license`\nThis guide also works for linux. The file that needs to be replaced is located in: /opt/sublime_text/sublime_text in case of debian based systems. (Ubuntu, Debian etc.)\n\nHere are the instructions that I followed:\n\n- Go to https://hexed.it/\n- Click Open File in the top left corner and select /opt/sublime_text/sublime_text\n- Press CTRL + F or on the Search for bar in the left panel and look for: 80 78 05 00 0f 94 C1\n- Now in the editor, click on the first byte (80) and start replacing each byte by: C6 40 05 01 48 85 C9\n- Finally, in the top left corner again, click on Export Button. This will download the file in your Downloads Folder.\n- Execute sudo cp ~/Downloads/sublime_text /opt/sublime_text/sublime_text to replace the original file.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2022 sp3rtah  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "An easily extensible telegram API wrapper",
    "version": "3.4.4",
    "project_urls": {
        "Homepage": "https://github.com/sp3rtah/autogram"
    },
    "split_keywords": [
        "telegram",
        "api",
        "wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1243ab5f5a4a40d958c3498d44dc560e79ce2fe913c3a160753e63332e3d4dba",
                "md5": "f476b9b9dacd5ef0115d3d5e16e90237",
                "sha256": "6a7cbda3e1e913984327fff2162b53bcde47bfab6648a50d8b2f30a9b14b79ff"
            },
            "downloads": -1,
            "filename": "autogram-3.4.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f476b9b9dacd5ef0115d3d5e16e90237",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 10067,
            "upload_time": "2023-10-30T14:46:28",
            "upload_time_iso_8601": "2023-10-30T14:46:28.254617Z",
            "url": "https://files.pythonhosted.org/packages/12/43/ab5f5a4a40d958c3498d44dc560e79ce2fe913c3a160753e63332e3d4dba/autogram-3.4.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7328d3e5b013f07d772979f594e819441438c42f5fc699dfa3ebfc6b1ab9fdcf",
                "md5": "1437241d3e6b0236ba8bb4c7f6cb4098",
                "sha256": "914da12c7e13147d3a7d12278f886c5f784e6ff189a03745f2f67aec770e6316"
            },
            "downloads": -1,
            "filename": "autogram-3.4.4.tar.gz",
            "has_sig": false,
            "md5_digest": "1437241d3e6b0236ba8bb4c7f6cb4098",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 10757,
            "upload_time": "2023-10-30T14:46:30",
            "upload_time_iso_8601": "2023-10-30T14:46:30.264962Z",
            "url": "https://files.pythonhosted.org/packages/73/28/d3e5b013f07d772979f594e819441438c42f5fc699dfa3ebfc6b1ab9fdcf/autogram-3.4.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-30 14:46:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sp3rtah",
    "github_project": "autogram",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "autogram"
}
        
Elapsed time: 0.14618s