{ "info": { "author": "Scarlehoff", "author_email": "juacrumar@lairen.eu", "bugtrack_url": null, "classifiers": [], "description": "[![PyPI version](https://badge.fury.io/py/pybliotecario.svg)](https://badge.fury.io/py/pybliotecario)\n\n# pybliotecario\n\npybliotecario is a simple Telegram bot written en python.\nThe goal of the program is to mantain an active connection between the computer in which the pybliotecario runs\nand your Telegram account.\n\n# Installing the pybliotecario\n\nThe pybliotecario can be installed as other python projects, using pip\n\n`pip install pybliotecario`\n\no setuptools:\n\n`python3 setup.py install`\n\nWhen it is installed in this way, the name of the executable will be Hostname (i.e., the name of the computer in which it is running with the first letter capitalized). If you want to use a different name just modify the variable `pybliotecario_name` inside `setup.py`.\n\nIn order to link the program with a Telegram bot it is necessary to create a bot talking with Telegram's BotFather. The `--init` option will guide you through the process.\n\n`pybliotecario --init`\n\nA small `systemd_install.sh` script is shipped alongside the github version of the pybliotecario in order to daemonize it easily.\n\n# Configuration of the pybliotecario\n\nAll configuration options of the pybliotecario can be found in the file\n\n`$HOME/.pybliotecario.ini`\n\nThis file will be automatically created (And most of the options filled) automatically by running `--init`.\n\n# Extending the pybliotecario \n\nThe program aims to be 100% extensible, running any kind of action in two different modes:\n\n- Command line: just call the command with the proper arguments. For instance, send a msg to your phone.\n- Message command: write a command to the bot from telegram, so the bot can act on said command.\n\nAdding new actions to each of the different modes is trivial, there are a small example for each case in the relevant files.\n\nIn order to add a new command to the bot you need to modify the file `on_cmdline.py` (for command line arguments) or `on_cmd_message.py` for commands sent from Telegram. The easiest course of action is to copy one of the components (in the `components` folder you can see the different modules) and add your own actions. The simplest of them is probably `components/ip_lookup.py` so have a look at it!\n\n## Command line:\n\nIn the file `on_cmdline.py` add a new if condition. You can add your action there as python code. If you want to do something more complicated I suggest you create a new component (pull requests are welcome!)\n\nNote: if you need new command line arguments (you surely do!) don't forget to add them to the end of `argument_parser.py`!\n\nExample: -i test.jpg, this will send the image named test.img to your defined Telegram chat\n\n## Message command:\n\nThese are command received by the bot in the form `/command Do whatever`. In the file `on_cmd_message.py` just add a new command to the if condition. The command definition will be defined in the variable `tg_command`.\n\nThere you can just write the python code to perform the command or add a new component. All the information from the msg the bot just received will be included in the `message_obj` variable. In particular the text will be `message_obj.text`.\n\nExample: if you send the command /ip, the bot will respond with the current ip of the machine it is running in.\n\n## Available cmd_line options:\n- msg: sends msg to Telegram\n- -i: sends a image to Telegram\n- -f: sends a file to Telegram\n- --arxiv_new: sends a msg to Telegram with the latest submissions to arxiv, filtered as you see fit (uses https://github.com/lukasschwab/arxiv.py as API)\n- --weather: sends a msg to Telegram with the current weather and some information about the forecast (uses https://github.com/csparpa/pyowm as OpenWeatherMap API, which needs an API key)\n- --check_repository: sends a msg to Telegram with the incoming changes to the repository\n- --my_ip: send the ip of the bot to the defined telegram user\n- --pid: Monitor a process by PID, run all other options after the process has finished.\n\n## Available commands\n- /ip : tells you the IP where the bot is currently running\n- /arxiv-query arxiv_id: returns information on the queried paper\n- /arxiv-get arxiv_id: downloads the paper ands sends it to telegram\n- /is_pid_alive pid_number/process_name: checks whether a given process is alive \n- /kill_pid: kills the given process in the computer in which the bot is running\n\n## Some examples and ideas:\nFor instance, you can run the pybliotecario every morning at 7:15 a.m. to tell you what are the news in the arxiv today adding a cronjob:\n\n 15 07 * * mon-fri /home/pi/Telegram/pybliotecario/pybliotecario.py --arxiv_new\n\n\n", "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/scarlehoff/pybliotecario", "keywords": "", "license": "GNU GPLv3", "maintainer": "", "maintainer_email": "", "name": "pybliotecario", "package_url": "https://pypi.org/project/pybliotecario/", "platform": "", "project_url": "https://pypi.org/project/pybliotecario/", "project_urls": { "Homepage": "https://github.com/scarlehoff/pybliotecario" }, "release_url": "https://pypi.org/project/pybliotecario/1.1/", "requires_dist": [ "arxiv", "pyowm", "psutil" ], "requires_python": "", "summary": "Personal telegram bot to interact between your Telegram account and your computer", "version": "1.1" }, "last_serial": 5717504, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "6eb24c2dc48845d018f938e5bbc8f97f", "sha256": "63257ce285a702a7d7d434d4f944e937df57bcf40ae410fe6d808eead0e2bf84" }, "downloads": -1, "filename": "pybliotecario-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6eb24c2dc48845d018f938e5bbc8f97f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27742, "upload_time": "2019-08-16T21:28:09", "url": "https://files.pythonhosted.org/packages/c8/41/2c0928744f9d27b47bb31c8e4d529442412ee68c4b149eb46d190acfc67e/pybliotecario-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "edf4a4ae1b8b7550f491a09af277a59c", "sha256": "3d033b425900d2caa3b5ea4efe947170e980a9b9468469f0ad7549eb671975da" }, "downloads": -1, "filename": "pybliotecario-1.0.tar.gz", "has_sig": false, "md5_digest": "edf4a4ae1b8b7550f491a09af277a59c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22487, "upload_time": "2019-08-16T21:28:11", "url": "https://files.pythonhosted.org/packages/bd/21/3fd0b4ab38095292f7a31c51d355821935ee27bb0d471311608eec9773a8/pybliotecario-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "1f24c6fb37fd37e7c313f8dd777413d6", "sha256": "c247e9468d21e11f12685e3813a126f712c83b7d60e9fab729fd4544468f0ebb" }, "downloads": -1, "filename": "pybliotecario-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1f24c6fb37fd37e7c313f8dd777413d6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27789, "upload_time": "2019-08-22T21:35:57", "url": "https://files.pythonhosted.org/packages/45/7a/d9518f11a657cfc93593d0849b9629cd6d200425604c588f930bdcf4f3de/pybliotecario-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b2296e49c3ca83776f7bddb65bcb4899", "sha256": "ea38507aaa7756aa67ad1fa5ded4903f6df5f4d5b92ec1e3f99a59dd399f335f" }, "downloads": -1, "filename": "pybliotecario-1.1.tar.gz", "has_sig": false, "md5_digest": "b2296e49c3ca83776f7bddb65bcb4899", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22564, "upload_time": "2019-08-22T21:36:00", "url": "https://files.pythonhosted.org/packages/d1/d8/f7fb1462ec93d7fdde649a2bfbf7cfc608acf29142abb27d9233b117f562/pybliotecario-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1f24c6fb37fd37e7c313f8dd777413d6", "sha256": "c247e9468d21e11f12685e3813a126f712c83b7d60e9fab729fd4544468f0ebb" }, "downloads": -1, "filename": "pybliotecario-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1f24c6fb37fd37e7c313f8dd777413d6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27789, "upload_time": "2019-08-22T21:35:57", "url": "https://files.pythonhosted.org/packages/45/7a/d9518f11a657cfc93593d0849b9629cd6d200425604c588f930bdcf4f3de/pybliotecario-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b2296e49c3ca83776f7bddb65bcb4899", "sha256": "ea38507aaa7756aa67ad1fa5ded4903f6df5f4d5b92ec1e3f99a59dd399f335f" }, "downloads": -1, "filename": "pybliotecario-1.1.tar.gz", "has_sig": false, "md5_digest": "b2296e49c3ca83776f7bddb65bcb4899", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22564, "upload_time": "2019-08-22T21:36:00", "url": "https://files.pythonhosted.org/packages/d1/d8/f7fb1462ec93d7fdde649a2bfbf7cfc608acf29142abb27d9233b117f562/pybliotecario-1.1.tar.gz" } ] }