Skip to main content

A Reservation Calendar System

Project description

Reservation Calendar

This module allows you to create a week based calendar for your reservations.

For seasonal resorts, this module calculates week numbers and reservation dates based on a reference day (Memorial Day by default). The calendar is lightweight and uses pure Python with no external dependencies.

Inspired by Fun Valley Family Resort in South Fork, Colorado, USA.

How it works

At Fun Valley guests are allowed to book "their" dates for the following year at checkout. Since the resort is seasonal, opening on Memorial Day each year, the calendar slides forward and backward every 7th year. Every 7th year there are 6 weeks in May.

If you stay in a cabin on June 9th, 2023 (Friday) thru June 11th, 2023 (Monday), you can book the same DAYS for the following year. The calendar will show you the dates for the following year, June 7th, 2024 (Friday) thru June 10th, 2024 (Monday).

Since reservations are based on the day of the week in the given week of the season, the dates are calculated based on the day of the week of the current reservation.

How to use it

from reservation_calendar import ReservationCalendar

calendar = ReservationCalendar()

# Get week number and weekday number for a given date
date = datetime(2023, 6, 9)
week_number, weekday_number = calendar.get_week_info(date)
print("Week number:", week_number)
print("Weekday number:", weekday_number)

# Get day name for a given date
day_name = calendar.get_day_name(date)
print("Day name:", day_name)


print(f"Future Reservation Dates for {date}:")
for year in range(2024, 2035):
  print(f"{calendar.get_reservation_start_date(date, year)}")

Output

Week number: 2
Weekday number: 5
Day name: Friday
Future Reservation Dates for 2023-06-09:
2024-06-07
2025-06-06
2026-06-05
2027-06-11
2028-06-09
2029-06-08
2030-06-07
2031-06-06
2032-06-11
2033-06-10
2034-06-09

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

reservation_calendar-1.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

reservation_calendar-1.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file reservation_calendar-1.0.tar.gz.

File metadata

  • Download URL: reservation_calendar-1.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for reservation_calendar-1.0.tar.gz
Algorithm Hash digest
SHA256 f4350be80cedf38098268194d0735d70fbf95b8cc1e06a389c1b1fd709222be7
MD5 1104ff2b6779d8fa49e1bda6d35d3572
BLAKE2b-256 985d136592a5031c70481c1d0670fb7935c4f44ffc0dab2872243dd8cce3802d

See more details on using hashes here.

File details

Details for the file reservation_calendar-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for reservation_calendar-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74e2e754b4f86ff6d87a66a2bb69d309856d45f7517df3fbaa26b33795c0e26d
MD5 0e8ad6ae04e21832f63d26a296048830
BLAKE2b-256 8a677d1bb39bdc46652727756e94d5d7240f2f9e018ccfd8deeb2d07433dea91

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