Skip to main content

Download and process Sabbath School lessons from GitHub

Project description

Sabbath School Lessons Reproducer

A tool to download, format, and reproduce Sabbath School lessons from historical archives for modern use.

Documentation Status PyPI version License: MIT

Features

  • YAML-based configuration for easy customization
  • Automatic downloading of lesson content from GitHub
  • Reproduction mode for adapting historical lessons to current dates
  • Professionally formatted PDF generation with customizable styling
  • Support for custom cover designs

Requirements

  • Python 3.6+
  • Dependencies: pyyaml, requests, markdown, weasyprint, beautifulsoup4

Installation

From PyPI

pip install sabbath-school-reproducer

From Source

  1. Clone the repository:
git clone https://github.com/sabbathschool/sabbath-school-reproducer.git
cd sabbath-school-reproducer
  1. Install the package:
pip install -e .

Quick Start

  1. Generate a configuration file:
sabbath-school-reproducer --generate-config
  1. Edit the generated config.yaml file with your desired settings

  2. Run the downloader:

sabbath-school-reproducer config.yaml

Configuration Options

Create a YAML configuration file with the following options:

# Target output options
year: 2025              # Year for generated lessons
quarter: q2             # Quarter (q1, q2, q3, q4)
language: en            # Language code

# File paths
input_file: ./combined_lessons_2025_q2.md   # Path for intermediate markdown file
output_file: ./output/sabbath_school_lesson_2025_q2.pdf  # Final PDF path

# Optional cover SVG files
front_cover_svg: ./assets/front_cover.svg   # Custom front cover
back_cover_svg: ./assets/back_cover.svg     # Custom back cover

# Reproduction options
reproduce:
  # Original content to adapt
  year: 1905            # Historical year to source from
  quarter: q2           # Historical quarter to source from
  
  # Lesson selection
  start_lesson: 1       # First lesson to include (starting from 1)
  stop_lesson: 13       # Last lesson to include (or null for all)
  
  # New date assignment
  quarter_start_date: 2025-04-01  # First lesson date (YYYY-MM-DD)

# PDF metadata
title: Sabbath School Lessons      # Title for the lesson quarterly
subtitle: Quarter 2, 2025          # Subtitle
publisher: Gospel Sounders         # Publisher name

Reproduction Mode

The reproduction feature allows you to adapt historical Sabbath School lessons for modern use:

  1. Source lessons from a specific historical year and quarter
  2. Start from any lesson number (e.g., lesson 5)
  3. Set a limit for the number of lessons to include
  4. Apply modern dates starting from a specified date
  5. Generate a PDF that uses current dates while attributing the source material

Example reproduction configuration:

reproduce:
  year: 1888            # Source from 1888
  quarter: q3           # Third quarter
  start_lesson: 3       # Start from lesson 3
  stop_lesson: 10       # Include up to lesson 10
  quarter_start_date: 2025-04-01  # Use dates starting April 1, 2025

Advanced Usage

Debug Mode

Run with debug output for more detailed information:

sabbath-school-reproducer config.yaml --debug

Debug HTML Only

Generate only the debug HTML without PDF generation:

sabbath-school-reproducer config.yaml --debug-html-only

Custom CSS

You can customize the PDF styling by modifying the CSS in your project:

# In css_styles.py
CSS_TEMPLATE = """
/* Your custom CSS here */
"""

Documentation

The project documentation is available at https://sabbathschool.github.io/sabbath-school-reproducer/.

To build the documentation locally:

# Navigate to docs directory
cd docs

# Build the documentation
make html

# View the documentation
# Open docs/_build/html/index.html in your browser

Development

Version Control

The project includes an automated version checker that increments the version number when building:

./build.sh

Testing

Run tests with:

pytest tests/

Building and Publishing

To build the package:

# Clean and build
./build.sh

To upload to PyPI:

# Upload to PyPI
./upload.sh

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Steps to contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sabbath_school_reproducer-0.1.0.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sabbath_school_reproducer-0.1.0-py3-none-any.whl (37.4 kB view details)

Uploaded Python 3

File details

Details for the file sabbath_school_reproducer-0.1.0.tar.gz.

File metadata

File hashes

Hashes for sabbath_school_reproducer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0a6c983de764d6dbb8dd63edfe908205172485aa3f7774745b0b75eb830108e8
MD5 e4c21ce961563cf57e1acd5c57c50301
BLAKE2b-256 6ad462003b46cc9dafb61896f59f55d48bde767f19088fca84cb7fc0bca3b4bb

See more details on using hashes here.

File details

Details for the file sabbath_school_reproducer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sabbath_school_reproducer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f69f672bd97c9bfeff16ce878e8455e81afa719ed9252edbc1b347924d11c634
MD5 467ed5e19460e44954d8ce25dfdeab05
BLAKE2b-256 3948f0490e06269575f43cf707640d73d4842b9d06f2a873256405f70d032f6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page