Skip to main content

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 the typing 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


Download files

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

Source Distribution

midsummer-0.1.1.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

midsummer-0.1.1-py3-none-any.whl (2.3 kB view hashes)

Uploaded Python 3

Supported by

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