Skip to main content

Business days in Poland

Project description

plbdays

plbdays is a Python library designed to determine business days in Poland. This library provides functions to check if a date is a business day, find the last or next business day, and generate a list of business days between two dates. It is useful for handling date calculations in business applications that adhere to Polish holidays and weekends.

Features

  • Check if a date is a business day
  • Find the most recent business day before or on a given date
  • Find the next business day after or on a given date
  • Generate a list of business days between two dates

Installation

pip install plbdays

or

git clone https://github.com/yourusername/plbdays.git

Usage

isBusinessDay(date='today')

Checks if a given date is a business day in Poland.

  • Parameters:
    • date (str, optional): The date to check in 'YYYY-MM-DD' format or as a datetime object. Defaults to 'today'.
  • Returns:
    • bool: True if the date is a business day, False otherwise.

Example:

from plbdays import isBusinessDay

print(isBusinessDay('2024-07-23'))  # Output: True or False

lastBD(date='today')

Finds the most recent business day before or on the given date.

  • Parameters:
    • date (str, optional): The date to check in 'YYYY-MM-DD' format or as a datetime object. Defaults to 'today'.
  • Returns:
    • str: The most recent business day in 'YYYY-MM-DD' format.

Example:

from plbdays import lastBD

# Find the last business day before or on a specific date
print(lastBD('2024-07-24'))  # Output: '2024-07-23'

# Find the last business day before or on today
print(lastBD())  # Output: 'YYYY-MM-DD' of the most recent business day

nextBD(date='today')

Finds the next business day after or on the given date.

  • Parameters:
    • date (str, optional): The date to start from in 'YYYY-MM-DD' format or as a datetime object. Defaults to 'today'.
  • Returns:
    • str: The next business day in 'YYYY-MM-DD' format.

Example:

from plbdays import lastBD

# Find the next business day after or on a specific date
print(nextBD('2024-07-24'))  # Output: '2024-07-25'

# Find the next business day after or on today
print(nextBD())  # Output: 'YYYY-MM-DD' of the next business day

BDays_list(start_date, end_date)

Generates a list of business days between two dates.

  • Parameters:

    • start_date (str, optional): The start date in 'YYYY-MM-DD' format.
    • end_date (str, optional): The end date in 'YYYY-MM-DD' format.
  • Returns:

    • list of lists: Each sublist contains a date in 'YYYY-MM-DD' format and a boolean indicating if it's a business day.

Example:

from plbdays import BDays_list

# Generate a list of business days between two dates
print(BDays_list('2024-07-20', '2024-07-25'))
# Output: [['2024-07-20', False], ['2024-07-21', False], ['2024-07-22', True], ['2024-07-23', True], ['2024-07-24', True], ['2024-07-25', True]]

Usage

  • Python 3.x

License

This project is licensed under the MIT License.

Change Log

1.2.2 (31/10/2025)

-Fix bad build

1.2.0 (31/10/2025)

-Including December 24th as a public holiday starting from 2025

1.1.1 (25/07/2024)

-Add nextBD() function

0.0.1 (27/11/2021)

-First Release

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

plbdays-1.2.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

plbdays-1.2.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file plbdays-1.2.1.tar.gz.

File metadata

  • Download URL: plbdays-1.2.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for plbdays-1.2.1.tar.gz
Algorithm Hash digest
SHA256 bc1d15f6f8fa27b9a1b32d22359a3b1663ea4c786de17873381f087dc110c7ee
MD5 d78cff4700ab5bd8980b8e0bff25c6e7
BLAKE2b-256 fae50860528c9311aac01da4a3e2e200c08cd90dc3b779564addcbcf8e94fd6b

See more details on using hashes here.

File details

Details for the file plbdays-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: plbdays-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for plbdays-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf2a5c76219391f198e2adba95a3062d18f36cc7564fed7b598d09156d5ccca5
MD5 d057ece844b04bd84a54ebbf43f2ce61
BLAKE2b-256 e81f743f81bdaef1ea2923a84435f7c7d778cdc0002e99599943b12b6bc317ff

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