Skip to main content

A python module that will calculate the sla time based on working hours and holidays.

Project description

SLA Calculator

Installation

pip install sla-calculator

Usage

To use this calculator, you must provide a starting time, the open time for business, the closing time for business, the country whose holidays you observe, and the sla time in hours. The function will then take into account all holidays and weekends as none working hours, and return a pendulum object of the time the sla needs to be met by. The following example will provide you with an SLA time 4 working hours from 12/10/2019 1:02:03 UTC

from sla_calculator import SLA_Calculator

sla_calc = SLA_Calculator()

sla_time = sla_calc.calculate(start_time="2019-12-10T01:02:03Z",
                              open_hour=9,
                              close_hour=17,
                              country_name="US",
                              sla_in_hours=4)
print(sla_time.to_iso8601_format())

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

sla-calculator-0.2.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

sla_calculator-0.2.0-py2.py3-none-any.whl (2.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sla-calculator-0.2.0.tar.gz.

File metadata

  • Download URL: sla-calculator-0.2.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/2.7.15 Windows/10

File hashes

Hashes for sla-calculator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a5443c1bda77b6c1d569c4d7bb5a39b2734821cce366e063b472ff9101680c05
MD5 d7492f69d0430e02eb9ddabf1cc3b518
BLAKE2b-256 f8a8bf8e9055f8166b7d93f17528ac6112d0f942b55ec1d5682bea2f6730dd40

See more details on using hashes here.

File details

Details for the file sla_calculator-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sla_calculator-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3db25018a2095a92b408a0e2ad66181301333c54aee9a06d9d598bb413d47574
MD5 d3c9d1d026d402025c7a9e139275beb0
BLAKE2b-256 8b6437db626893e0fff7469294bffe489c971e233ed95b75fb5336d56bf151ef

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