Giter Club home page Giter Club logo

helsinki-guide's Introduction

helsinki-guide

This repository contains the code for a Telegram bot designed to provide information about notable buildings in Helsinki. The bot is working at https://t.me/HelsinkiGuide_bot.

presentation

Motivation

Helsinki boasts many fascinating buildings, but finding information about them can be challenging. This project's primary goal is to make such information more easily accessible. The project relies on a dataset provided by the Helsinki City Museum.

Project Goals

  1. Translate the dataset into English and Russian. ✅
  2. Create a Telegram bot to deliver this dataset to bot users. ✅
  3. Allow a user to configurate his preferences. (pending)
  4. Allow a user to search buildings per location. ✅
  5. ...

Getting Started

make USER=<dockerhub_username> TAG=anynewtag build
  • Apply database migrations:
DATABASE_URL=<DATABASE_URL> make migrate
  • Run the bot:
BOT_TOKEN=<BOT_TOKEN> DATABASE_URL=<DATABASE_URL> make run

Development

Prerequisites

  • Go v.1.21 or higher should be already installed.
  • A bot API token BOT_TOKEN provided by @BotFather.
  • Docker should be already installed.
  • An empty Postgresql database with an installed earthdistance extension.
  • An environment variable DATABASE_URL to connect to the PostgreSQL database.
  • A subscription to the Google Translate API is required to automatically translate the source dataset into other languages.

Installation

Open a project root directory in a console and install project dependencies:

go mod tidy

Apply database migrations:

DATABASE_URL=<DATABASE_URL> make migrate

Start

Run the bot:

DATABASE_URL=<DATABASE_URL> go run main.go bot --token <BOT_TOKEN>

Get more information about available commands and options:

go run main.go --help

Prepare Data

This command will create a new file translated.xlsx where a Lauttasaari sheet will be partially translated into English.

go run main.go translate --api-key <your Google Translate API key> --sheet Lauttasaari input_dataset.xlsx translated.xlsx

Populate the database

Transfer the data from xlsx files to the database:

go run main.go populate --dburl ${DatabaseURL} --sheet Lauttasaari fi.xlsx en.xlsx ru.xlsx

Tests

Run the project tests:

make test

Acknowledgements

Source: History of buildings in Helsinki. The maintainer of the dataset is Helsingin kulttuurin ja vapaa-ajan toimiala / Kaupunginmuseo and the original author is Tmi Hilla Tarjanne. The dataset has been downloaded from Helsinki Region Infoshare service on 2023-10-22 18:00:08.977295 under the license Creative Commons Attribution 4.0.

License

This project is licensed under the MIT License - see the LICENSE file for details.

helsinki-guide's People

Contributors

andreyad1 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

aemrei

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.