Git Product home page Git Product logo

organization_parser_bot's Introduction

Organization Parser

Description

Utilities and Telegram bot for parsing data from Places API by Yandex.

This can help you to search for companies and collect data about them on request to the Yandex database of organizations.

For using cli utils and bot you need to get API key from here.

(Remember that the free key allows you to make up to 500 calls to the Yandex API per day.)

Python Docker SQLite GitHub GitHub Actions

Main technologies:

Demo

You can try to using that bot here.

Installation

For running and building app you need to get source code of this repo:

git clone https://github.com/andy-takker/organization_parser

or you can get public docker image from Docker hub for ARM64 (here).

Configuration

An example of the settings is in the file .env.dev.

cp .env.dev .env
TELEGRAM_BOT_TOKEN  # Your telegram bot token. Required
SQLITE_DB_PATH      # Path to file sqlite db. Optional, default: ./bot.sqlite3

Running

You can run bot in two ways: with docker or natively as is

Docker

docker build . --tag organization_parser_bot:latest
docker run --env-file .env -it organization_parser_bot:latest

Local

For local running I recommend use venv and you need to install poetry.

python -m venv .venv
source .venv/bin/activate  # for unix systems
pip install -U pip poetry 
poetry install --no-root
alembic -c ./src/alembic.ini upgrade head # create db and all tables
TELEGRAM_BOT_TOKEN=XXX PYTHONPATH=. python ./src/bot/main.py

Database

Project database is SQLite with async driver - aiosqlite.

alembic is used to manage the database version. To automatically create a new migration, run

alembic -c ./src/alembic.ini revision --autogenerate -m "New migration"

To update database to last actual version use

alembic -c ./src/alembic.ini upgrade head

Using

  1. At first, send /start

  2. For registration in bot you need set Yandex API Key to use the API. The key looks in the UUID format. You can get key here

  3. After that you can make requests:

    • set place where need search
    • set query (what you looking for)
    • set radius of searching
  4. Click next to get parsed CSV file.

  5. Finish!

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.