Skip to main content

Useful business date ranges

Project description

What is DateRanger?

A package for getting common date ranges.

Installation

pip install git+https://github.com/spitfire-sidra/DateRanger

Usage

dr = DateRanger()

dr.set_base_date(date)
dr.get_base_day()
dr.base_week()
dr.base_month()
dr.base_quarter()
dr.base_year()

dr.prev_week(2)
dr.next_week(2)

dr.prev_month(2)
dr.next_month(2)

dr.prev_quarter(2)
dr.next_quarter(2)

dr.prev_year(2)
dr.next_year(2)

dr.from_date(date)
dr.to_date(date)

DateRange

r = DateRange(start_date, end_date)

r.days()
r.weeks()
r.months()
r.quarters()
r.years()

r.each_day()
r.each_week()
r.each_month()
r.each_quarter()
r.each_years()

r.get_range()
(start_date, end_date)

Contribute

test:

python -m unittest discover

This command executes all test cases under the folder DateRanger/test/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for DateRanger, version 0.2.2.dev
Filename, size File type Python version Upload date Hashes
Filename, size DateRanger-0.2.2.dev.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page