Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dineshkarthik/osm-translate-telegrambot
TelegramBot Handcrafted for Translation of places in OpenStreetMap
https://github.com/dineshkarthik/osm-translate-telegrambot
openstreetmap openstreetmap-translator python telegram-bot
Last synced: about 1 month ago
JSON representation
TelegramBot Handcrafted for Translation of places in OpenStreetMap
- Host: GitHub
- URL: https://github.com/dineshkarthik/osm-translate-telegrambot
- Owner: Dineshkarthik
- License: gpl-3.0
- Created: 2017-10-05T12:54:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-25T22:23:43.000Z (over 3 years ago)
- Last Synced: 2024-05-01T20:35:38.562Z (8 months ago)
- Topics: openstreetmap, openstreetmap-translator, python, telegram-bot
- Language: Python
- Size: 47.9 KB
- Stars: 12
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# **OSM-Translate-TelegramBot**
This bot it designed to help translation of [OpenStreetMap](https://www.openstreetmap.org) location from English to any Regional Language.
## Tech
OSM-Translate-TelegramBot uses various python packages / open source projects to work properly:
* [Pandas] - pandas is an open source, library providing high-performance, easy-to-use data structures and data analysis tools for the Python.
* [SQLAlchemy] - Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.
* [pyTelegramBotAPI] - A simple, but extensible Python implementation for the [Telegram Bot API](https://core.telegram.org/bots/api).
* [PyYAML] - YAML parser and emitter for Python.
* [MySQL] - Database being used.## Installation
Tested on python 3.*
```sh
$ git clone https://github.com/Dineshkarthik/OSM-Translate-TelegramBot.git
$ cd OSM-Translate-TelegramBot
$ pip install -r requirements.txt
```## Configuration
token: 'YOUR_BOT_TOKEN'
input_csv: '/PATH/TO/YOUR/INPUT/INPUT.CSV'
db_name: 'NAME_FOR_DB_TO_BE_GENERATED'
db_username: 'MYSQL_USER_NAME'
db_password: 'MYSQL_PASSWORD'
db_host: 'localhost'
db_port: 3306
export_type: 'batch'
bot_admin: ['admin1_telegram_username', admin2_telegram_username']
- token - Your Telegram Bot API Token, to get the token follow the instructions available [here](https://core.telegram.org/bots#6-botfather)
- input_csv - Path to the input csv file, which contains the Locations to be translated.
- The Input csv file should consists of the following `3 mandatory columns`
- osm_id - OSM Node ID of the Location
- name - Name of the Location to be translated
- translation - Suggested Google or any other translation if available (But the column is mandatory)
- db_name - Name of the MySQL db, will be generated if not exists.
- db_username - User name to connect to MySQL database.
- db_password - Password to connect to DB.
- db_host - Hostname of the DB, if using local database use `localhost`
- db_port - Port to connect to db, MySQL default port is 3306
- export_type - For exporting data from DB
- batch - To export data which is not exported already.
- all - To export all available data which are wither verified or translated.
- bot_admin - Telegram username of the user to be given Admin access.## Execution
```sh
$ python populated_db.py
$ python translate_bot.py
$ python export_db.py
```
* Running `populated_db.py` will generate a MySQL DB if not already created and will seed it with data from the input csv file and to update admin roles to existing users.
* Run `python -c 'from populate_db import add_admin; add_admin()'`to update admin roles alone without importing data to DB.
* Running `translate_bot.py` will start the Telegram Bot.
* Runnign `export_db.py` will export translated data available in DB to a CSV file.[Pandas]:
[SQLAlchemy]:
[pyTelegramBotAPI]:
[PyYAML]:
[MySQL]: