Midsummer Date
Project description
Midsummer Date Calculator
This Python module calculates the date of Midsummer's Day for a given year. Midsummer's Day typically falls on a Friday between June 20th and June 26th.
Features
- Custom Exception: Includes a
MidsummerException
for handling errors specific to the Midsummer date calculation. - Type Checking: Utilizes type hints for better code clarity and type checking.
- Final Constants: Employs
Final
from thetyping
module to declare constants.
Usage
To use this module, simply import the midsummer_date
function and pass the year for which you want to find the Midsummer's Day:
from midsummer import midsummer_date
year = 2024
print(midsummer_date(year))
Functionality
The midsummer_date function calculates the date of Midsummer’s Day for the specified year. If the calculated date does not fall on a Friday, a ValueError is raised.
Exceptions
MidsummerException: Raised if the input year is not an integer or if the date falls outside the expected range. ValueError: Raised if the calculated Midsummer’s Day does not fall on a Friday, as per tradition.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for midsummer-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2732e35d577ae32b3c7c39411d9d1a563d280cb3904c74fb0819764b44fd8bb6 |
|
MD5 | a31e13e17b80010ba794e74063249efb |
|
BLAKE2b-256 | 7d3b5aee16c51b80dc1a32b548f6bfa95c3e25ae4fa30390e5a6d668dfecc1cf |