API Reference
fetch_meditation
Fetch Meditation Package.
This package provides functionality to fetch daily meditations from various sources in multiple languages. It supports Just For Today (JFT) and Spiritual Principle A Day (SPAD) meditation formats.
Available modules: - jft: JFT meditation fetcher factory - jft_language: Language enumeration for JFT meditations - jft_settings: Settings for JFT meditation fetchers - jft_entry: Data structure for JFT meditation entries - spad: SPAD meditation fetcher factory - spad_language: Language enumeration for SPAD meditations - spad_settings: Settings for SPAD meditation fetchers - spad_entry: Data structure for SPAD meditation entries
fetch_meditation.jft
JFT (Just For Today) meditation fetcher module.
This module provides functionality to fetch Just For Today meditations in different languages.
- class fetch_meditation.jft.Jft(settings: Any)[source]
Bases:
object
Main JFT meditation fetcher class.
This class serves as a factory for creating language-specific JFT meditation fetchers based on the provided settings.
- Attributes:
settings: Configuration settings for the JFT fetcher
- static get_instance(settings: Any) EnglishJft | FrenchJft | GermanJft | ItalianJft | JapaneseJft | PortugueseJft | RussianJft | SpanishJft | SwedishJft [source]
Factory method to create a language-specific JFT fetcher.
- Args:
settings: Configuration settings for the JFT fetcher
- Returns:
A language-specific JFT fetcher instance
- property language: JftLanguage
Get the language setting for this JFT fetcher.
- Returns:
JftLanguage: The language enum value
- settings: Any
fetch_meditation.jft_language
JFT Language enumeration module.
This module defines the available languages for JFT (Just For Today) meditations.
- class fetch_meditation.jft_language.JftLanguage(*values)[source]
Bases:
Enum
Enumeration of supported languages for JFT meditations.
Each enum value represents a language for which JFT meditations can be fetched.
- English = 1
- French = 2
- German = 3
- Italian = 4
- Japanese = 5
- Portuguese = 6
- Russian = 7
- Spanish = 8
- Swedish = 9
fetch_meditation.jft_settings
JFT Settings module.
This module defines the settings class for configuring JFT meditation fetchers.
- class fetch_meditation.jft_settings.JftSettings(language: JftLanguage, time_zone: str | None = None)[source]
Bases:
object
Settings for JFT meditation fetchers.
This class contains configuration parameters for fetching JFT meditations.
- Attributes:
language (JftLanguage): The language to fetch meditations in time_zone (Optional[str]): The time zone to use for date calculations, or None for system default
- language: JftLanguage
- time_zone: str | None = None
fetch_meditation.jft_entry
JFT Entry module.
This module defines the data structure for JFT meditation entries.
- class fetch_meditation.jft_entry.JftEntry(date: str, title: str, page: str, quote: str, source: str, content: List[str], thought: str, copyright: str)[source]
Bases:
object
Data class representing a JFT (Just For Today) meditation entry.
This class holds all the components of a JFT meditation and provides methods for conversion to different formats.
- Attributes:
date (str): The date of the meditation title (str): The title of the meditation page (str): The page reference quote (str): The quote text source (str): The source of the quote content (List[str]): The main content paragraphs thought (str): The closing thought copyright (str): Copyright information
- content: List[str]
- copyright: str
- date: str
- page: str
- quote: str
- source: str
- thought: str
- title: str
- to_json() str [source]
Convert the entry to a JSON string.
- Returns:
str: JSON string representation of the entry
- without_tags() Dict[str, Any] [source]
Create a version of the entry with HTML tags stripped.
- Returns:
Dict[str, Any]: Dictionary with HTML tags removed from all values
fetch_meditation.spad
SPAD (Spiritual Principle A Day) meditation fetcher module.
This module provides functionality to fetch SPAD meditations in different languages.
- class fetch_meditation.spad.Spad(settings: Any)[source]
Bases:
object
Main SPAD meditation fetcher class.
This class serves as a factory for creating language-specific SPAD meditation fetchers based on the provided settings.
- Attributes:
settings: Configuration settings for the SPAD fetcher
- fetch() None [source]
Base fetch method, overridden in language-specific implementations.
- static get_instance(settings: Any) EnglishSpad [source]
Factory method to create a language-specific SPAD fetcher.
- Args:
settings: Configuration settings for the SPAD fetcher
- Returns:
A language-specific SPAD fetcher instance
- property language: SpadLanguage
Get the language setting for this SPAD fetcher.
- Returns:
SpadLanguage: The language enum value
- settings: Any
fetch_meditation.spad_language
SPAD Language enumeration module.
This module defines the available languages for SPAD (Spiritual Principle A Day) meditations.
- class fetch_meditation.spad_language.SpadLanguage(*values)[source]
Bases:
Enum
Enumeration of supported languages for SPAD meditations.
Each enum value represents a language for which SPAD meditations can be fetched.
- English = 1
fetch_meditation.spad_settings
SPAD Settings module.
This module defines the settings class for configuring SPAD meditation fetchers.
- class fetch_meditation.spad_settings.SpadSettings(language: SpadLanguage, time_zone: str | None = None)[source]
Bases:
object
Settings for SPAD meditation fetchers.
This class contains configuration parameters for fetching SPAD meditations.
- Attributes:
language (SpadLanguage): The language to fetch meditations in time_zone (Optional[str]): The time zone to use for date calculations, or None for system default
- language: SpadLanguage
- time_zone: str | None = None
fetch_meditation.spad_entry
SPAD Entry module.
This module defines the data structure for SPAD meditation entries.
- class fetch_meditation.spad_entry.SpadEntry(date: str, title: str, page: str, quote: str, source: str, content: List[str], thought: str, copyright: str)[source]
Bases:
object
Data class representing a SPAD (Spiritual Principle A Day) meditation entry.
This class holds all the components of a SPAD meditation and provides methods for conversion to different formats.
- Attributes:
date (str): The date of the meditation title (str): The title of the meditation page (str): The page reference quote (str): The quote text source (str): The source of the quote content (List[str]): The main content paragraphs thought (str): The closing thought copyright (str): Copyright information
- content: List[str]
- copyright: str
- date: str
- page: str
- quote: str
- source: str
- thought: str
- title: str
- to_json() str [source]
Convert the entry to a JSON string.
- Returns:
str: JSON string representation of the entry
- without_tags() Dict[str, Any] [source]
Create a version of the entry with HTML tags stripped.
- Returns:
Dict[str, Any]: Dictionary with HTML tags removed from all values