Mulugruntz / gh-automation-funda

Funda automation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gh-automation-funda

GH_Automation_:: version

License MIT Python 3.11 Poetry Checked with mypy Code style: black Linting: Ruff

Funda.nl automation using GitHub Actions and Aiven for PostgreSQL.

See gh-automation-base for more information.

Usage

1. Create a new Google Sheet

This Google Sheet is used to control the dynamic settings of the automation. This way, you can change the settings at any time without having to change the code.

It should contain a sheet with the following content (for example):

area object_type price_min price_max days_old
["Amsterdam"] ["apartment"] 500000 1000000 3
["Almere", "Utrecht"] ["house", "apartment"] 300000 500000 3

Do not include the backticks in the actual sheet.

In the above example, the automation will search for apartments in Amsterdam that are between 500,000 and 1,000,000 euros and are no older than 3 days, as well as houses or apartments in Almere and Utrecht that are between 300,000 and 500,000 euros and are no older than 3 days.

To be noted that the days_old is only important for the first iteration of the automation. If the automation runs every N minutes, then most of the properties will be redundant, as they will have been found in the previous iteration. A small value is recommended, to avoid parsing a lot of useless properties.

2. Add your Google Sheet to the automation

If the URL of your Google Sheet is

https://docs.google.com/spreadsheets/d/12345678901-abcdefghijklmnopqrstuv1234_56789/edit#gid=9876543210

then the SHEET_ID is 12345678901-abcdefghijklmnopqrstuv1234_56789 and the GID is 9876543210.

In .env, add the following:

GH_AUTO_GOOGLE_SHEETS_1_SHEET_ID=12345678901-abcdefghijklmnopqrstuv1234_56789
GH_AUTO_GOOGLE_SHEETS_1_GID=9876543210
GH_AUTO_GOOGLE_SHEETS_1_MODEL=gh_automation_funda.persistence.settings.FundaSetting

Database structure

Entity-relationship diagram

erDiagram
    PROPERTY ||--|| PROPERTY_FUNDA_DATA : "has"
    PROPERTY_FUNDA_DATA ||--o{ PROPERTY_FUNDA_IMAGE : "has"
    PROPERTY ||--o| PROPERTY_CADASTRAL_DATA : "has"
    PROPERTY ||--|| PROPERTY_CADASTRAL_WOZ : "has"
    PROPERTY_CADASTRAL_WOZ ||--o{ PROPERTY_CADASTRAL_WOZ_ITEM : "has"

Full diagram in er_diagram.md (here).

About

Funda automation

License:MIT License


Languages

Language:Python 99.8%Language:Makefile 0.2%