Skip to main content

a utility module for lead time analysis in procurement & logistic division mineral alam abadi

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.1.tar.gz (3.9 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.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for leadtimeutils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cfdcdfb95d76a895954dcdde463c51ac41df2078a26a24483d239edd50e01b2f
MD5 3570c2836798674ab2edf378911837cb
BLAKE2b-256 84c80edd000d47d5ea979c788598166a154ed9bae7f637c31e55f6b79026766b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for leadtimeutils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8f3c26cdeb245c9a026398d808e8c3c83a60742508fe853d307685fa2c3e11a9
MD5 3f77d019cc5af0e83b77591e5bfc9239
BLAKE2b-256 1969c67be170fed0ce27a845cb913b5a4a2c50b222d074678efe1bad0a6720e9

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