{"id":21812597,"url":"https://github.com/skelly37/pyfram-telegram-bot","last_synced_at":"2026-02-14T21:02:16.691Z","repository":{"id":44601685,"uuid":"455851898","full_name":"skelly37/pyfram-telegram-bot","owner":"skelly37","description":"Open-source WolframAlpha Telegram bot","archived":false,"fork":false,"pushed_at":"2022-04-28T09:57:14.000Z","size":9188,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T01:35:24.706Z","etag":null,"topics":["bot","mathematics","maths","python-bot","telebot","telegram","telegram-bot","telegram-bot-api","wolfram-alpha"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skelly37.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-05T11:32:56.000Z","updated_at":"2025-06-24T01:28:14.000Z","dependencies_parsed_at":"2022-07-22T05:32:01.449Z","dependency_job_id":null,"html_url":"https://github.com/skelly37/pyfram-telegram-bot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/skelly37/pyfram-telegram-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skelly37%2Fpyfram-telegram-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skelly37%2Fpyfram-telegram-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skelly37%2Fpyfram-telegram-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skelly37%2Fpyfram-telegram-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skelly37","download_url":"https://codeload.github.com/skelly37/pyfram-telegram-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skelly37%2Fpyfram-telegram-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29455601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","mathematics","maths","python-bot","telebot","telegram","telegram-bot","telegram-bot-api","wolfram-alpha"],"created_at":"2024-11-27T14:18:40.357Z","updated_at":"2026-02-14T21:02:16.662Z","avatar_url":"https://github.com/skelly37.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyfram-telegram-bot\nOpen-source [WolframAlpha](https://wolframalpha.com) Telegram bot\n\n- Telegram API wrapper: [telebot](https://github.com/eternnoir/pyTelegramBotAPI)\n- Deployed on: [Heroku](https://heorku.com)\n- Static type checking: [mypy](https://mypy.readthedocs.io/en/stable/getting_started.html)\n  - `mypy pyfram_bot.py api_calls.py` -\u003e  **Success: no issues found in 2 source files**\n- Unit tests: [test_bot.py](test_bot.py)\n  - Sometimes you'll have to run tests twice (or even thrice). It's rather a problem with the API and time needed to process the request for step-by-step image.\n\n## Current status:\nThe bot works pretty fine for the end-user, all the functionality I wanted to introduce is already there. Only the code [needs some polishing](#todo)\n\n## What can the end-user achieve with bot? How to use it?\n- `/s` or `/steps` command before actual query — get step-by-step solution (if possible).\n  - **NOTE** This may take quite a long time but it's not a problem with my code, it's WolframAlpha API issue. \n- `/i` or `/image` command before actual query — force get result as an image.\n- `/start` or `/help` commands — provide basic help.\n- If no commands are provided, the bot has these defaults:\n  - Try getting and sending short text answer\n  - If the short answer is not available, return image (as in `/image`)\n- Inline mode works only for simple answers:\n  - If available, prompt will display your question, the result will be the answer\n  - If unavailable, both prompt and result will be \"No short answer available\"\n\n## Video preview:\n![Bot functionality preview](preview/wolframbot.gif \"Bot functionality preview\")\n\n## How the code works?\nWell, it's no dark magic. I simply query WolframAlpha API and send text answer or image:\n  - get user input via telebot\n  - `requests.get()`\n  - then send the result via telebot\n\nThe short import lists are also self-explanatory. As you can see in [TODO](#todo), in free time I'll also introduce type checking. Bot is ready to go to Heroku, code is clear and understandable (at least I hope so).\n\n## Why won't we develop a public bot?\nWolfram API for a non-personal use is quite expensive and we cannot afford being *Santa Claus*. That's why we provide only the code and left the `appID` empty. Feel free to set up such a bot for personal use with your own API key or to gain funds for a fully public one.\n\nBut if you want to see the bot in action: @wolaph_bot\n\n## [api_calls.py](https://github.com/skelly37/pyfram-telegram-bot/blob/main/api_calls.py) simple documentation\nThe whole API wrapper is developed in `WolframBot` class. \n\n- Attributes:\n  - `__app_ids` (list) — list of app_ids to use with the `WolframBot`  \n  - `__num_of_appids` (int) — how many app IDs are provided?\n\n- Methods:\n  - `__init__`\n    - Arguments:\n      - `app_ids` (list) — list of app_ids to use with the `WolframBot`\n    - Returns:\n      - None    \n  - `__get_random_id`\n    - Arguments:\n      - None\n    - Returns:\n      - Randomly chosen app ID from `self.__app_ids` (str)\n  - `__short_answer`\n    - Arguments:\n      - `query` (str) — question to ask WolframAlpha\n    - Returns:\n      - Result of querying WolframAlpha. May return \"No short answer available\" (str)\n  - `__get_image`\n    - Arguments:\n      - `query` (str) — question to ask WolframAlpha\n    - Returns:\n      - Name of the file where result is stored. May return \"Error processing your request.\" (str)\n  - `__get_url_of_steps_image`\n    - Arguments:\n      - `img_xml` (str) — raw query result.\n    - Returns:\n      - Desired url from XML. May return \"No step by step solution available.\" (str)\n  - `get_step_by_step`\n    - Arguments:\n      - `query` (str) — question to ask WolframAlpha\n    - Returns:\n      - Name of the file where result is stored. May return \"Error processing your request.\" or \"No step by step solution available.\" (str)\n  - `query_wolfram`\n    - Arguments:\n      - `query` (str) — question to ask WolframAlpha\n      - `is_image` (bool, optional) — if True, the method will skip trying to get short answer and proceed to fetching image in the first place\n      - `inline_mode` (bool, optional) — if True, the method will skip trying to get image answer and will send any result of fetching simple answer. \n    - Returns:\n      - Short answer, filename, may also return \"Error processing your request.\" or \"No step by step solution available.\" (str)\n\n## Contribution\nFeel free to create issues, to make PRs, every kind of help is welcome here\n\nYou can reach me and talk about this project on:\n- Telegram (preferred): @skelly37\n- Discord: skelly#3578\n\n## License\nThe code is and will be distributed under the permissive [MIT License](https://github.com/skelly37/pyfram-telegram-bot/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskelly37%2Fpyfram-telegram-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskelly37%2Fpyfram-telegram-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskelly37%2Fpyfram-telegram-bot/lists"}