plbdays


Nameplbdays JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/ZawadzkiR/plbays/
SummaryBusiness days in Poland
upload_time2024-07-24 22:55:28
maintainerNone
docs_urlNone
authorRobert Zawadzki
requires_pythonNone
licenseNone
keywords business days
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```bash
pip install plbdays
```
or
```bash
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:**

```python
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:**

```python
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:**

```python
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:**

```python
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.1.1 (25/07/2024)
-------------------
-Add nextBD() function
-Fixed bug

0.0.1 (27/11/2021)
-------------------
-First Release

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ZawadzkiR/plbays/",
    "name": "plbdays",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "business days",
    "author": "Robert Zawadzki",
    "author_email": "r.zawadzki96@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a9/bb/fe74cbcf3738431c78ecf4bfbc105e377593e8c26a9d39ed8af16113d85d/plbdays-1.1.1.tar.gz",
    "platform": null,
    "description": "# plbdays\r\n\r\n`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.\r\n\r\n## Features\r\n\r\n- **Check if a date is a business day**\r\n- **Find the most recent business day before or on a given date**\r\n- **Find the next business day after or on a given date**\r\n- **Generate a list of business days between two dates**\r\n\r\n## Installation\r\n\r\n```bash\r\npip install plbdays\r\n```\r\nor\r\n```bash\r\ngit clone https://github.com/yourusername/plbdays.git\r\n```\r\n## Usage\r\n\r\n### `isBusinessDay(date='today')`\r\n\r\nChecks if a given date is a business day in Poland.\r\n\r\n- **Parameters:**\r\n  - `date` (str, optional): The date to check in 'YYYY-MM-DD' format or as a datetime object. Defaults to 'today'.\r\n- **Returns:**\r\n  - `bool`: True if the date is a business day, False otherwise.\r\n\r\n**Example:**\r\n\r\n```python\r\nfrom plbdays import isBusinessDay\r\n\r\nprint(isBusinessDay('2024-07-23'))  # Output: True or False\r\n```\r\n\r\n### `lastBD(date='today')`\r\n\r\nFinds the most recent business day before or on the given date.\r\n\r\n\r\n- **Parameters:**\r\n  - `date` (str, optional): The date to check in 'YYYY-MM-DD' format or as a datetime object. Defaults to 'today'.\r\n- **Returns:**\r\n  - `str`: The most recent business day in 'YYYY-MM-DD' format.\r\n\r\n**Example:**\r\n\r\n```python\r\nfrom plbdays import lastBD\r\n\r\n# Find the last business day before or on a specific date\r\nprint(lastBD('2024-07-24'))  # Output: '2024-07-23'\r\n\r\n# Find the last business day before or on today\r\nprint(lastBD())  # Output: 'YYYY-MM-DD' of the most recent business day\r\n```\r\n\r\n### `nextBD(date='today')`\r\n\r\nFinds the next business day after or on the given date.\r\n\r\n\r\n- **Parameters:**\r\n  - `date` (str, optional): The date to start from in 'YYYY-MM-DD' format or as a datetime object. Defaults to 'today'.\r\n- **Returns:**\r\n  - `str`: The next business day in 'YYYY-MM-DD' format.\r\n\r\n**Example:**\r\n\r\n```python\r\nfrom plbdays import lastBD\r\n\r\n# Find the next business day after or on a specific date\r\nprint(nextBD('2024-07-24'))  # Output: '2024-07-25'\r\n\r\n# Find the next business day after or on today\r\nprint(nextBD())  # Output: 'YYYY-MM-DD' of the next business day\r\n```\r\n\r\n### `BDays_list(start_date, end_date)`\r\n\r\nGenerates a list of business days between two dates.\r\n\r\n- **Parameters:**\r\n  - `start_date` (str, optional): The start date in 'YYYY-MM-DD' format.\r\n  - `end_date` (str, optional): The end date in 'YYYY-MM-DD' format.\r\n\r\n- **Returns:**\r\n  - `list of lists`: Each sublist contains a date in 'YYYY-MM-DD' format and a boolean indicating if it's a business day.\r\n\r\n**Example:**\r\n\r\n```python\r\nfrom plbdays import BDays_list\r\n\r\n# Generate a list of business days between two dates\r\nprint(BDays_list('2024-07-20', '2024-07-25'))\r\n# 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]]\r\n```\r\n\r\n## Usage\r\n - Python 3.x\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License.\r\n\r\nChange Log\r\n==========\r\n\r\n1.1.1 (25/07/2024)\r\n-------------------\r\n-Add nextBD() function\r\n-Fixed bug\r\n\r\n0.0.1 (27/11/2021)\r\n-------------------\r\n-First Release\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Business days in Poland",
    "version": "1.1.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/ZawadzkiR/plbays/issues",
        "Homepage": "https://github.com/ZawadzkiR/plbays/"
    },
    "split_keywords": [
        "business",
        "days"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4059193938ab6d524745fa2810e071a72292aeb4f9226f42dc416666481251a2",
                "md5": "cfb3796bc204664f6592ab2f49241033",
                "sha256": "1c003bb150ced9937f20e3db07b724a6c9cdd3e6d04c4de2230e993f75d1fa05"
            },
            "downloads": -1,
            "filename": "plbdays-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cfb3796bc204664f6592ab2f49241033",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4210,
            "upload_time": "2024-07-24T22:55:26",
            "upload_time_iso_8601": "2024-07-24T22:55:26.413015Z",
            "url": "https://files.pythonhosted.org/packages/40/59/193938ab6d524745fa2810e071a72292aeb4f9226f42dc416666481251a2/plbdays-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a9bbfe74cbcf3738431c78ecf4bfbc105e377593e8c26a9d39ed8af16113d85d",
                "md5": "c8e3c8973a2b24880adf4dfc6967c9e8",
                "sha256": "5e2f4e5abc2e4bd374702731310a395334400816c9e8dea4b0cb901e14a38a31"
            },
            "downloads": -1,
            "filename": "plbdays-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c8e3c8973a2b24880adf4dfc6967c9e8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4055,
            "upload_time": "2024-07-24T22:55:28",
            "upload_time_iso_8601": "2024-07-24T22:55:28.397966Z",
            "url": "https://files.pythonhosted.org/packages/a9/bb/fe74cbcf3738431c78ecf4bfbc105e377593e8c26a9d39ed8af16113d85d/plbdays-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-24 22:55:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ZawadzkiR",
    "github_project": "plbays",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "plbdays"
}
        
Elapsed time: 0.25760s