A simple, powerful, free, and easily extensible earthquake early warning notification system!
This project uses the API provided by ExpTech. Please adhere to their Terms of Service.
Note: This project is currently in beta.
Python 3.8 or higher is required
First, download the source code of the project. You can obtain the project's source code by:
git clone https://github.com/watermelon1024/EEW.git
cd EEW
Before installing the project, it's recommended to use a virtual environment to isolate the project's dependencies and prevent conflicts with dependencies of other projects.
python -m venv venv
pip install virtualenv
virtualenv venv
Then, activate the virtual environment:
# Windows
venv\Scripts\activate
# Linux/macOS
source venv/bin/activate
Edit the .env
file according to the format in .env.example
and fill in the required environment variables.
For example:
DISCORD_BOT_TOKEN= # Discord bot token
LINEBOT_ACCESS_TOKEN= # Line bot access token
LINEBOT_CHANNEL_SECRET= # Line bot channel secret
Edit the config.toml
file according to the format in config.toml.example
and fill in the required values based on your needs.
For example:
# configuration
debug-mode = false # debug mode
[discord-bot]
channels = [
{ id = 123456789, mention = "everyone" }, # mention everyone (@everyone)
{ id = 456789123, mention = 6543219870 }, # mention the role with ID `6543219870`
{ id = 987654321 }, # no mention
]
[line-bot]
channels = [
"abcdefgh...",
"ijklmnop...",
] # user or group IDs
[log]
retention = 30 # days of logs to keep
format = "<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level: <8}</level> | <level>{message}</level>" # log output format
Install the required dependencies for the project.
pip install -r requirements.txt
After installing the dependencies and setting the environment variables, you can run the project!
python main.py
If you haven't found an existing client that suits your needs, you can create a custom notification client for yourself!
See the development documentation.