Skip to main content

A simple per diem library

Project description

PerDiem

A library that allows a user to get the per diem rates for a location and calculate the per diem rates for a given period of time. It takes the data from GSA's per diem page and the computer handles the rest!

Usage

from perdiem import PerDiem

# Look up the rates for Washington, DC (accept the first result)
rates = PerDiem.get_rates("Washington, DC")[0]

# Alternatively, look up the rates by zip code!
# rates = PerDiem.get_rates("20002")[0]

start_date = "2024-01-01"
end_date = "2024-01-08"

# Calculate the total costs for a trip
trip = PerDiem.calculate_per_diem(rates, start_date, end_date)
print(trip["total"])
# 2136.5

Install

pip install perdiem

Features

  • Look up Per Diem rate by Zip Code
  • Compute the total (factoring first and last day travel reductions)

Future?

  • [] An API?
  • [] A CLI?
  • [] Export to Excel?

License

Apache 2.0

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

perdiem-0.1.2.tar.gz (580.7 kB view details)

Uploaded Source

Built Distribution

perdiem-0.1.2-py3-none-any.whl (595.0 kB view details)

Uploaded Python 3

File details

Details for the file perdiem-0.1.2.tar.gz.

File metadata

  • Download URL: perdiem-0.1.2.tar.gz
  • Upload date:
  • Size: 580.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.3.0

File hashes

Hashes for perdiem-0.1.2.tar.gz
Algorithm Hash digest
SHA256 03a51e4cd02ae53c690779f18cf9b5ee3a8df9e381ed3beda1c461f87becd915
MD5 aaa60c623118cfb74f56b6f1e576c5ba
BLAKE2b-256 9d64601f14db2843807cc54e2ef90dbd587860989b002ebfd1ee8ae54ac9ca69

See more details on using hashes here.

File details

Details for the file perdiem-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: perdiem-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 595.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.3.0

File hashes

Hashes for perdiem-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 58abb72f9301c4b2abdaef2594b55138fac82f7f2fba867930e04c5140b5d1e7
MD5 1fea196ee80c2b9140d9eb1d53b86f0b
BLAKE2b-256 d8571eb17738e2b9fd1c6d37f6a06cd7ca7b4d21da7ecd4a9537441b50819c59

See more details on using hashes here.

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