diff --git a/README.md b/README.md index f6fb8ee..ed83174 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,39 @@ # ![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) -[![](https://img.shields.io/pypi/v/tg-logger.svg)](https://pypi.org/project/tg-logger/) -[![](https://img.shields.io/pypi/pyversions/tg-logger.svg)](https://pypi.org/project/tg-logger/) +[![Pypi version](https://img.shields.io/pypi/v/tg-logger.svg)](https://pypi.org/project/tg-logger/) +[![Downloads](https://static.pepy.tech/personalized-badge/tg-logger?period=total&units=international_system&left_color=grey&right_color=orange&left_text=Downloads)](https://pepy.tech/project/tg-logger) [![GitHub](https://img.shields.io/github/license/otter18/tg_logger)](https://github.com/otter18/tg_logger/blob/main/LICENSE) [![Documentation Status](https://readthedocs.org/projects/tg-logger/badge/?version=latest)](https://tg-logger.readthedocs.io/en/latest/?badge=latest) + + Bridging python logging and files to tg bot Documentation is available at [Read the Docs](https://tg-logger.readthedocs.io/) -## Table of Contents -- [Installation & Usage](#installation--usage) -- [Screenshot](#screenshot) -- [Examples](#examples) +Demo is available [@tg_logger_demo_bot](https://t.me/tg_logger_demo_bot), [[repo](https://github.com/otter18/tg-logger-demo-bot)] + +![intro_img](https://raw.githubusercontent.com/otter18/tg_logger/main/img/intro.jpeg) + +## 🗂 Table of Contents +- [Installation & Usage](#-installation--usage) +- [Screenshot](#-screenshot) +- [Examples](#-examples) * [Simple logging](#simple-logging) * [Flask logging](#flask-logging) * [Setting extra parameters to handler](#setting-extra-parameters-to-handler) * [TgFileLogger example](#tgfilelogger-example) -- [FQA](#fqa) +- [FQA](#-fqa) * [How to create a telegram bot?](#how-to-create-a-telegram-bot) * [How to get **token** and **user_id**?](#how-to-get-token-and-user_id) -## Installation & Usage +## 🚀 Installation & Usage - Available by `pip install tg-logger` - Use with `import tg_logger` -## Screenshot +## 📱 Screenshot ![example_scr](https://raw.githubusercontent.com/otter18/tg_logger/master/img/example_scr.png) -## Examples +## 📖 Examples ### Simple logging ```python import logging @@ -51,6 +57,7 @@ logger.info("Hello from tg_logger by otter18") ### Flask logging ```python from flask import Flask +import logging import tg_logger # Telegram data @@ -120,9 +127,11 @@ with open(file_name, 'w') as example_file: tg_files_logger.send(file_name, "Test file") ``` -## FQA -### How to create a telegram bot? +## 🔎 FQA +### How to create a telegram bot? - To create bot use official [BotFather](https://t.me/BotFather) bot (descibed [here](https://core.telegram.org/bots#6-botfather)) ### How to get **token** and **user_id**? +- Use [@tg_logger_demo_bot](https://t.me/tg_logger_demo_bot) with command `/id` - Bot's **token** is shown after new bot is made - To get **user_id** use special bots (e.g. [@userinfobot](https://t.me/userinfobot), [@JsonDumpBot](https://t.me/JsonDumpBot)) +