Python library for getting payroll dates
Project description
payrolldates
Install Locally
pip install -e .
Install from github
pip install "payrolldates @ git+https://<github_token>@github.com/Davenport-Iowa/cod-py-payroll-dates.git"
Testing
Install Test Dependancies
pip install .[test]
Run Tests
pytest
Usage
Description
Use the library to determine start and end dates of payroll
You can pass a date to the functions to get the start and end payroll dates for a specific date.
Import
# import functions from the package
from payrolldates.calc import get_pay_period, is_date_in_first_week, print_pay_period
# Use full std lib for dates
from datetime import datetime
Usage
Get payperiod from date
# Get the start and end dates for the current payperiod
start_date, end_date = get_pay_period(datetime.now())
Get a historical payperiod from date
start_date, end_date = get_pay_period(datetime(2024, 4, 27))
You can also check if it is the first week of the payroll
[!TIP] is_date_in_first_week(date) is helpful if determining when to run an automated job
if is_date_in_first_week(datetime.now()):
print("First Week!")
else:
print("Not First Week")
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
File details
Details for the file codi_payrolldates-0.3.0.tar.gz
.
File metadata
- Download URL: codi_payrolldates-0.3.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 935ad5a3eed7a2d61e4815210d72c133ef3cece7fd32f37fc8d58cc459d50d85 |
|
MD5 | 1a32553b9148a37400b357e53ac55807 |
|
BLAKE2b-256 | 50319ef5f34d027b1a67288fd5b54e56503e4602224e18a1f7decb05eb6fc415 |
File details
Details for the file codi_payrolldates-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: codi_payrolldates-0.3.0-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28559b19851b0249feca4312e12da55051776a72d5c969647917847107dcaf60 |
|
MD5 | 9f09ccb3a17231b23265768e434f8b9e |
|
BLAKE2b-256 | 3d40c9783bd2451ddcee012798d4024fc050c83429b9b6c1df7a37276b8c73ec |