Skip to main content

A utility module for lead time analysis

Project description

Lead Time Utils

PyPI Version Python Versions License Status

a utility module for lead time analysis, specifically designed for handling business logic related to date calculations and constraints internally in procurement & logistic division mineral alam abadi.

Installation

pip install leadtimeutils

Usage

import pandas as pd
import numpy as np
import leadtimeutils as ltu

Available Functions

has_thursday_after_5_days(start_date, end_date)

checks if thursday exists at least 5 days after the start date and before the end date.

has_thursday_after_5_days_vectorized(df, start_col, end_col)

fast vectorized version for entire DataFrames.

get_days_between(df, start_col, end_col)

returns the list of day names between two dates for each row.

Scalar check

start = pd.Timestamp("2023-10-01")
end = pd.Timestamp("2023-10-15")
result = ltu.has_thursday_after_5_days(start, end)
print(result)

Vectorized check

df = pd.DataFrame({
    'start': [pd.Timestamp("2023-10-01")],
    'end': [pd.Timestamp("2023-10-15")]
})
results = ltu.has_thursday_after_5_days_vectorized(df, 'start', 'end')
print(results)

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

leadtimeutils-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

leadtimeutils-0.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file leadtimeutils-0.1.0.tar.gz.

File metadata

  • Download URL: leadtimeutils-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for leadtimeutils-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4d86e96247904e123e73d6b6daa9a96cf8661bf3d387e5bfd57612dad51296e9
MD5 970c2cb3f78ba6afa0620745806d0cd6
BLAKE2b-256 273c5fcf7fed4e2e990f8ec0283b37336d79b5dfdab19e3df3a8b98420b94161

See more details on using hashes here.

File details

Details for the file leadtimeutils-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: leadtimeutils-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for leadtimeutils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9520879a604c024dbde25f65a9fb70689ef8be6702868a2774154a9cd71f18b1
MD5 7211e3327bd077a973f981c4efa81b96
BLAKE2b-256 c0e3da58f984432e41568e49997b5c397cc09c2cf9fea9b41ffda9a73916c69b

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