https://github.com/omkality/domofomka
Getting intercom codes at the given address
https://github.com/omkality/domofomka
fastapi redis sqlite3 vk-api
Last synced: 5 months ago
JSON representation
Getting intercom codes at the given address
- Host: GitHub
- URL: https://github.com/omkality/domofomka
- Owner: omka0708
- Created: 2023-09-08T16:56:48.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-24T18:53:25.000Z (over 2 years ago)
- Last Synced: 2025-02-12T02:47:30.545Z (over 1 year ago)
- Topics: fastapi, redis, sqlite3, vk-api
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# domofomka
Application for getting the intercom code at the given address.
Used stack: *FastAPI*, *SQLite*, *Redis*.
## Install
Build `domofomka` from source:
git clone https://github.com/omka0708/domofomka
cd domofomka
docker compose up -d
You should have `.env` file at the */domofomka* folder and SQLite3 database with `DB_NAME` name (configured in environment file) at */domofomka/api* folder.
Environment file `.env` should contain:
DB_NAME=
DADATA_TOKEN=
VK_GROUP_TOKEN=
VK_GROUP_ID=
Your SQLite3 database should contain table `codes`, that has the structure:
"id" INTEGER,
"city" TEXT,
"street_type" TEXT,
"street" TEXT,
"house" TEXT,
"entrance" TEXT,
"code_type" TEXT,
"code" TEXT
## Run
Run this command at the working directory */domofomka*:
docker compose up --build
## API
### Get codes by message
#### Request
`GET /codes_msg/`
GET localhost:80/codes_msg?message=трофимова 3
#### Response
{
"address":"Москва, улица Трофимова, дом 3",
"data":
{
"1":[["#7546","yaeda"],["#4230","yaeda"],["*#7546","delivery"]],
"2":[["#4230","yaeda"],["#4230","delivery"],["К4230","oldcodes"]]
}
}
### Get codes by latitude and longitude
`GET /codes_geo/`
GET localhost:80/codes_geo?lat=55.617586&lon=37.495482
#### Response
{
"address":"Москва, улица Профсоюзная, дом 156к5",
"data":
{
"1":[["255К2580","yaeda"],["12К2889","yaeda"],["28К3185","yaeda"]],
"2":[["72К3108","yaeda"]],
"3":[["110*4082","yaeda"],["97*4840","yaeda"],["75*6818","yaeda"]],
"4":[["133К2489","yaeda"],["135К3001","yaeda"]],
"5":[["170*3304","yaeda"],["151*6631","yaeda"],["173*9572","yaeda"]],
"6":[["200К4578","yaeda"],["200К4578","delivery"]]
}
}
## VK Bot
### Get codes by message

### Get codes by latitude and longitude

## Telegram Bot
*soon*