{ "info": { "author": "Alex C.P. (alxnull)", "author_email": "bluegrams@e.mail.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: BSD License", "Operating System :: POSIX", "Programming Language :: Python :: 3", "Topic :: Communications :: Chat", "Topic :: Utilities" ], "description": "# tgsend - Telegram Messaging Tool\n\n[![PyPI](https://img.shields.io/pypi/v/tgsend.svg)](https://pypi.org/project/tgsend/)\n[![GitHub](https://img.shields.io/github/license/alxnull/tgsend.svg)](https://github.com/alxnull/tgsend/blob/master/LICENSE.txt)\n\ntgsend is a little Python module to send messages, photos and documents to Telegram chats via a Telegram bot. tgsend can be used either as a command line tool or as a module for Python 3.\n\n## Quick Start (Command Line)\n\n1. Create a Telegram Bot with the help of [@BotFather](https://t.me/BotFather) and take note of the bot token.\n2. Start a new chat with your bot or add it to a group where the messages should be sent to.\nFind out your personal chat ID or the chat ID of the group chat, e.g. by using [@Echo_ID_Bot](https://t.me/Echo_ID_Bot).\n3. Install tgsend with pip:\n```bash\nsudo pip3 install tgsend\n```\n4. Quickly configure tgsend with environment variables (see [Configuration](#configuration) for other options). In bash:\n```bash\nTGSEND_TOKEN=abcdefg # your bot token\nTGSEND_CHATID=1234567 # the chat ID of the private/ group chat\n```\n5. Test it:\n```bash\ntgsend \"Hello World\"\n```\n\n## Usage\n\n### In Python\nExample:\n```python\nfrom tgsend import Telegram, ParseMode\n# token and chat ID will be searched in config files if not specified here\ntelegram = Telegram(\"your-bot-token\", \"your-chat-id\")\n# send a text message\ntelegram.send_message(\"This is a text with *bold* and _italic_ words.\", title=\"The Title\",\n parse_mode=ParseMode.MARKDOWN)\n```\n\n### From Command Line\n\nSend a text message with formatting:\n```bash\ntgsend --format markdown \"This is a text with *bold* and _italic_ words.\"\n```\n\nAdd a title and an icon:\n```bash\ntgsend -t \"Title\" --icon $'\\u2705' \"Some text.\"\n```\n\nSend a picture:\n```bash\ntgsend --photo image.png \"Image description.\"\n```\n\nSend a file:\n```bash\ntgsend --doc log.txt \"Log file\"\n```\n\nRead from stdin:\n```bash\ncat greeting.txt | tgsend -\n```\n\nType `tgsend --help` to see all options.\n\n## Configuration\n\nA configuration for tgsend always consists of a bot token and a chat ID.\nThese values can be either set through environment variables (as shown above) or through a configuration file.\n\n### Global configuration\n\nYou can place a global configuration file at `/etc/tgsend.conf`. If no environment variables are specified,\ntgsend will look for the required values in this file. The format of this configuration file should look like this:\n```\n[Default]\nBotToken = your_bot_token\nChatID = your_chat_id\n```\n\n### More configuration options\n\nYou can add additional bot token/ chat ID profiles by adding a config section to the configuration file, e.g.:\n```\n[AltConfig]\nBotToken = different_bot_token\nChatID = another_chat_id\n```\nYou can then simply switch to this configuration with the `-c` option:\n```bash\ntgsend -c AltConfig \"Hello World\"\n```\n\nIt is also possible to specify a different location for the configuration file by using the `-l` option. E.g.:\n```bash\ntgsend -l ~/tgsend/botconfig.conf \"Some text\"\n```\ntgsend will now look for the `[Default]` section in the given configuration file.\n\n## License\n\nThis software is pusblished under [BSD-3-Clause license](https://github.com/alxnull/tgsend/blob/master/LICENSE.txt).", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alxnull/tgsend", "keywords": "telegram message", "license": "BSD-3-Clause", "maintainer": "", "maintainer_email": "", "name": "tgsend", "package_url": "https://pypi.org/project/tgsend/", "platform": "", "project_url": "https://pypi.org/project/tgsend/", "project_urls": { "Homepage": "https://github.com/alxnull/tgsend" }, "release_url": "https://pypi.org/project/tgsend/0.2/", "requires_dist": null, "requires_python": "", "summary": "Send messages to Telegram chats from Python and the command line", "version": "0.2" }, "last_serial": 4931844, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "cb965cfd157acdfd07099e02f3a12752", "sha256": "42be2458a8a6ea3560c9b6a19fef6746f028b9860c1080f4c6b7ae39b80cc4ce" }, "downloads": -1, "filename": "tgsend-0.1.tar.gz", "has_sig": false, "md5_digest": "cb965cfd157acdfd07099e02f3a12752", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5553, "upload_time": "2018-10-28T13:50:02", "url": "https://files.pythonhosted.org/packages/5e/3c/1474b3d627bad2b1edf3c7f8c8a45d72135caaaa2666c392ec611869ab55/tgsend-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "19ce97d7a4610e3c08a11be450377cb3", "sha256": "acaf6a17c95aad2c73b62a47c7ef54f31c05291c58b41e2c809e118c248611e9" }, "downloads": -1, "filename": "tgsend-0.2.tar.gz", "has_sig": false, "md5_digest": "19ce97d7a4610e3c08a11be450377cb3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5468, "upload_time": "2019-03-12T20:44:22", "url": "https://files.pythonhosted.org/packages/17/49/362f9f32cf6ee558e55d75e62a7f4c0e5e7ad57916f3bf32c7967fd817a8/tgsend-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "19ce97d7a4610e3c08a11be450377cb3", "sha256": "acaf6a17c95aad2c73b62a47c7ef54f31c05291c58b41e2c809e118c248611e9" }, "downloads": -1, "filename": "tgsend-0.2.tar.gz", "has_sig": false, "md5_digest": "19ce97d7a4610e3c08a11be450377cb3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5468, "upload_time": "2019-03-12T20:44:22", "url": "https://files.pythonhosted.org/packages/17/49/362f9f32cf6ee558e55d75e62a7f4c0e5e7ad57916f3bf32c7967fd817a8/tgsend-0.2.tar.gz" } ] }