Skip to content

wllzhang/BirthdayRS

Repository files navigation

Birthday Reminder System

Docker Image Python Version Code Style

License GitHub last commit CI Daily Check

GitHub stars GitHub forks GitHub issues

A powerful birthday reminder system that supports both lunar and solar calendar birthdays, providing rich Chinese traditional culture information.

[中文文档] [English Doc]

Features

  • Dual Calendar Support

    • Support for solar (Gregorian) birthday reminders
    • Support for lunar (Chinese) birthday reminders
    • Smart handling of leap months
  • Rich Date Information

    • Display GanZhi (Heavenly Stems and Earthly Branches) for year, month, day, hour
    • Display Chinese Zodiac
    • Display lunar festivals
    • Display solar festivals
    • Display 24 solar terms
    • Display weekday information
    • Display constellation
  • Flexible Reminder Settings

    • Customizable advance reminder days
    • Multiple recipient support
    • Email notifications
    • Email preview functionality
    • Preview email
    • Default settings
    • GitHub Actions support
    • Docker deployment
    • Multiple notification sources (email, ServerChan)

Configuration

Create a config.yml file in the project root directory (refer to config.example.yml)

Usage

1. Local Run

Run

git clone https://github.com/wllzhang/BirthdayRS.git
cd BirthdayRS
# Install dependencies
pip install -r requirements.txt
# Local run
python -m src.main run
python -m src.main preview

View Help Information:

python -m src.main --help
python -m src.main preview --help
python -m src.main run
python -m src.main validate --config config.yml
python -m src.main info --config config.yml

2. GitHub Action

  1. Fork the repository, set the variable BIRTHDAY_YAML in Settings with the content of your config.yaml
  2. Go to Actions and run the action: Daily Birthday Check

3. Docker Run

Available Tags

  • latest: Latest stable version
  • vX.Y.Z: Specific version (e.g., v1.0.0)
  • sha-XXXXXX: Build for a specific commit

Run Examples

# Run birthday reminder
docker run -v ${PWD}/config.yml:/app/config.yml ghcr.io/wllzhang/birthdayrs:latest run
docker run -v ${PWD}/config.yml:/app/config.yml -v ${PWD}/previews:/app/previews  ghcr.io/wllzhang/birthdayrs:latest preview

Email Templates

The system uses the Jinja2 template engine to render email content and supports custom email templates. The default template is located at templates/birthday.html and includes:

  • Basic birthday information
  • Lunar date information
  • GanZhi (Heavenly Stems and Earthly Branches) for year, month, day, hour
  • Zodiac and constellation
  • Festival and solar term information
  • Weekday information

Testing

Run tests:

pytest

License

MIT License

Logging

System logs are saved in the birthday_reminder.log file, including:

  • Configuration loading status
  • Birthday check results
  • Email sending status
  • Error messages (if any)

CI/CD Pipeline

This project uses GitHub Actions for a complete CI/CD pipeline:

Continuous Integration (CI)

Each push or Pull Request will automatically run the following checks:

  1. Code Testing

    • Run unit tests
    • Generate test coverage report
    • Save test results as artifacts
  2. Code Quality

    • Code style check with flake8
    • Ensure code follows PEP 8 standards
  3. Docker Image Build

    • Automatically build Docker image
    • Push to GitHub Container Registry

Continuous Deployment (CD)

  1. Daily Check

    • Automatically run birthday checks every day
    • Send reminder emails
    • Support for development and production environments
  2. Docker Deployment

    • Quick deployment via Docker
    • Latest version image available

Automation

  • README Auto-update
    • Automatically update repository links in documentation
    • Keep documentation in sync with code

About

Birthday Reminder System

Resources

License

Stars

Watchers

Forks

Packages