Skip to main content

General TBG Utilities

Project description

The Brookhaven Group, LLC (TBG) Utilities

Date and string utilities

These are utilities commonoly used at The Brookhaven Group, LLC

Installation

PyPI Page

$ pip install tbgutils 

or

GitHub

$ pip install  git+https://github.com/TheBrookhavenGroup/tbgutils.git

Examples

Print the beginning of the next day in local time.

>>> from tbgutils.dt import to_date, day_start_next_day
>>> d = to_date('20230320')
>>> print(day_start_next_day(d))
"2023-03-21 04:00:00+00:00

Is holiday observed?

>>> from src.tbgutils.dt import to_date, is_holiday_observed
>>> d = to_date('20230704')
>>> is_holiday_observed(d)
True

Is it a weekend?

>>> from src.tbgutils.dt import is_week_end
>>> d = to_date('20230704')
>>> is_week_end(d)
False
>>> d = to_date('20230319')
>>> is_week_end(d)
True

THE END

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

tbgutils-1.1.4.tar.gz (8.5 kB view hashes)

Uploaded Source

Built Distribution

tbgutils-1.1.4-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

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