{"id":34048709,"url":"https://github.com/otter18/tg_logger","last_synced_at":"2026-03-17T20:13:21.346Z","repository":{"id":41495411,"uuid":"325969678","full_name":"otter18/tg_logger","owner":"otter18","description":"Python library that bridges logging and user files to telegram bot","archived":false,"fork":false,"pushed_at":"2023-06-22T17:20:48.000Z","size":506,"stargazers_count":39,"open_issues_count":2,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-16T08:44:35.993Z","etag":null,"topics":["filesharing","logging","logging-handler","telegram","telegram-bot","tg-logger"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/tg-logger/","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/otter18.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-01T11:53:01.000Z","updated_at":"2025-07-16T19:48:41.000Z","dependencies_parsed_at":"2024-06-20T23:22:10.972Z","dependency_job_id":null,"html_url":"https://github.com/otter18/tg_logger","commit_stats":{"total_commits":64,"total_committers":3,"mean_commits":"21.333333333333332","dds":0.171875,"last_synced_commit":"69c60badbf7217f6764e453be3d388216b392fe3"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/otter18/tg_logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otter18%2Ftg_logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otter18%2Ftg_logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otter18%2Ftg_logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otter18%2Ftg_logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otter18","download_url":"https://codeload.github.com/otter18/tg_logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otter18%2Ftg_logger/sbom","scorecard":{"id":714479,"data":{"date":"2025-08-11","repo":{"name":"github.com/otter18/tg_logger","commit":"69c60badbf7217f6764e453be3d388216b392fe3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T09:09:42.063Z","repository_id":41495411,"created_at":"2025-08-22T09:09:42.063Z","updated_at":"2025-08-22T09:09:42.063Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30630297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: 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":["filesharing","logging","logging-handler","telegram","telegram-bot","tg-logger"],"created_at":"2025-12-14T00:09:47.144Z","updated_at":"2026-03-17T20:13:21.337Z","avatar_url":"https://github.com/otter18.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![tg_logo](https://raw.githubusercontent.com/otter18/tg_logger/master/img/telegram-icon.png) Telegram logger [![GitHub Repo stars](https://img.shields.io/github/stars/otter18/tg_logger?style=social)](https://github.com/otter18/tg_logger/stargazers)\n[![Pypi version](https://img.shields.io/pypi/v/tg-logger.svg)](https://pypi.org/project/tg-logger/)\n[![Downloads](https://static.pepy.tech/personalized-badge/tg-logger?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=orange\u0026left_text=Downloads)](https://pepy.tech/project/tg-logger)\n[![GitHub](https://img.shields.io/github/license/otter18/tg_logger)](https://github.com/otter18/tg_logger/blob/main/LICENSE)\n[![Documentation Status](https://readthedocs.org/projects/tg-logger/badge/?version=latest)](https://tg-logger.readthedocs.io/en/latest/?badge=latest)\n\n\u003c!-- [![Pyversions](https://img.shields.io/pypi/pyversions/tg-logger.svg)](https://pypi.org/project/tg-logger/) --\u003e\n\nBridging python logging and files to tg bot\n\nDocumentation is available at [Read the Docs](https://tg-logger.readthedocs.io/)\n\nDemo is available [@tg_logger_demo_bot](https://t.me/tg_logger_demo_bot), [[repo](https://github.com/otter18/tg-logger-demo-bot)]\n\n![intro_img](https://raw.githubusercontent.com/otter18/tg_logger/main/img/intro.jpeg)\n\n## 🗂 Table of Contents\n- [Installation \u0026 Usage](#-installation--usage)\n- [Screenshot](#-screenshot)\n- [Examples](#-examples)\n    * [Simple logging](#simple-logging)\n    * [Flask logging](#flask-logging)\n    * [Setting extra parameters to handler](#setting-extra-parameters-to-handler)\n    * [TgFileLogger example](#tgfilelogger-example)\n- [FQA](#-fqa)\n    * [How to create a telegram bot?](#how-to-create-a-telegram-bot)\n    * [How to get **token** and **user_id**?](#how-to-get-token-and-user_id)\n\n## 🚀 Installation \u0026 Usage\n- Available by `pip install tg-logger`\n- Use with `import tg_logger`\n\n## 📱 Screenshot\n![example_scr](https://raw.githubusercontent.com/otter18/tg_logger/master/img/example_scr.png)\n\n## 📖 Examples\n### Simple logging\n```python\nimport logging\nimport tg_logger\n\n# Telegram data\ntoken = \"1234567890:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\nusers = [1111111111]\n\n# Base logger\nlogger = logging.getLogger('foo')\nlogger.setLevel(logging.INFO)\n\n# Logging bridge setup\ntg_logger.setup(logger, token=token, users=users)\n\n# Test\nlogger.info(\"Hello from tg_logger by otter18\")\n```\n\n### Flask logging\n```python\nfrom flask import Flask\nimport logging\nimport tg_logger\n\n# Telegram data\ntoken = \"1234567890:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\nusers = [1111111111]\n\n# Flask app setup\napp = Flask(__name__)\n\napp.logger.setLevel(logging.ERROR) # flask logger\ntg_logger.setup(app.logger, token=token, users=users) # bridge setup\n\n\n@app.route('/')\ndef hello_world():\n    return 'Hello, World!'\n\n\nif __name__ == '__main__':\n    app.run()\n\n```\n\n### Setting extra parameters to handler\n\n```python\nimport logging\nimport tg_logger\n\n# Telegram data\ntoken = \"1234567890:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\nusers = [1111111111]\n\n# Base logger\nlogger = logging.getLogger('foo')\nlogger.setLevel(logging.INFO)\n\n# Logging bridge setup\nhandler = tg_logger.setup(logger, token=token, users=users)\n\n# Setting extra params\nhandler.setLevel(logging.DEBUG)\n\n# Test\nlogger.info(\"Hello from tg_logger by otter18\")\n```\n\n### TgFileLogger example\n```python\nimport tg_logger\n\n# Telegram data\ntoken = \"1234567890:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\nusers = [1111111111]\n\n# TgFileLogger example\ntg_files_logger = tg_logger.TgFileLogger(\n    token=token,  # tg bot token\n    users=users,  # list of user_id\n    timeout=10  # 10 seconds by default\n)\n\nfile_name = \"test.txt\"\nwith open(file_name, 'w') as example_file:\n    example_file.write(\"Hello from tg_logger by otter18\")\n\ntg_files_logger.send(file_name, \"Test file\")\n```\n\n## 🔎 FQA\n### How to create a telegram bot? \n- To create bot use official [BotFather](https://t.me/BotFather) bot (descibed [here](https://core.telegram.org/bots#6-botfather))\n### How to get **token** and **user_id**?\n- Use [@tg_logger_demo_bot](https://t.me/tg_logger_demo_bot) with command `/id`\n- Bot's **token** is shown after new bot is made\n- To get **user_id** use special bots (e.g. [@userinfobot](https://t.me/userinfobot), [@JsonDumpBot](https://t.me/JsonDumpBot))\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotter18%2Ftg_logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotter18%2Ftg_logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotter18%2Ftg_logger/lists"}