# Teable Watcher A Python script that uses Teable's API to detect changes to tables and sends a notification using ntfy when a new record is added.\ The script runs in a loop, checking for changes at a set interval. When a change is detected, a notification is sent to the configured ntfy topic. ## Running the script You can run this script standalone or with Docker. ### Standalone usage Clone the repository and create a folder in the same folder as the script called `data`.\ This will hold the configuration as well as the records cache. Copy the `example-config.yaml` file to the data folder and rename to `config.yaml`. Create another folder in the data folder called `records-cache` to hold the records cache. The records cache contains JSON files of the records in the tables that have been checked as a reference to compare to the current tables. If using the script standalone, make sure to have Python installed on your machine and run `pip install -r requirements.txt` to install the required packages, as not all packages required are default in Python. On newer versions of some Linux distros, it may be necessary to create a virtual environment, which will be indicated by an "externally managed environment" error. Your code editor may be able to assist you in creating virtual environments (I use [Visual Studio Code](https://code.visualstudio.com/)). It is recommended to use `screen` or `tmux` to run the script in the background. To use `screen`: ```sh screen -dmS teable-watcher python3 teablewatcher.py ``` If `screen` is not installed, follow instructions for your OS to install it. ### Docker usage Create a folder somewhere on your machine to hold the container's data. In this folder, create another folder called `data`. This will hold the configuration as well as the records cache. Copy the `example-compose.yaml` file to the top-level folder and rename to `compose.yaml`. Copy the `example-config.yaml` file to the data folder and rename to `config.yaml`. Create another folder in the data folder called `records-cache` to hold the records cache. To start the container for the first time, run the `docker compose up -d` command. All Compose commands must be run in the same folder as the `compose.yaml` file. To stop the container, run the `docker compose down` command. When restarting the container, it is recommended to pull the latest image to ensure you have the most recent updates. You can do this by running: ```sh docker compose pull && docker compose up -d ``` This command will pull the latest images and then start the container in the background. ## Configuration See `example-config.yaml`. ## About ntfy ntfy (https://ntfy.sh, [binwiederhier/ntfy](https://github.com/binwiederhier/ntfy)) is an open-source push notification server with clients for iOS and Android, and desktop access in a web browser. ## Credits This project was designed to provide notifications for [Teable](https://teable.io), an open-source GUI database. Find its GitHub repository: [teableio/teable](https://github.com/teableio/teable). Teable is licensed under a combination of MIT and AGPL-3.0 licenses. See their repository for more information. ntfy is dual-licensed with Apache-2.0 and GPL-2.0. See its repository for details. This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for the full license text.