Skip to main content

CalWeek class

The calweek module provide the class CalWeek. Instances represent specific weeks spanning 7 days Sunday to Saturday except weeks at the year beginning/end may be shorter. There are 53 or 54 numbered weeks in a year. Week 1 is always starts on January 1 of the year.

This is a traditional week number system different from the ISO 8601 standard. ISO 8601 week numbering is now more predominate, but still sometimes software needs to work with the old system.

For ISO 8601 week support in Python, use the isoweek module on which this code was based.

The CalWeek instances are light weight and immutable with an interface similar to the datetime.date objects. Example code:

from calweek import CalWeek
w = CalWeek(2011, 20)
print "Week %s starts on %s" % (w, w.day(0))

print "Current week number is", CalWeek.thisweek().week
print "Next week is", CalWeek.thisweek() + 1

weeknum() function

The calweek module also includes a weeknum() function compatible with Microsoft Excel's WEEKNUM formula function.

Metadata

Release files for calweek 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for calweek 0.5.0
File Interpreter ABI Platform
calweek-0.5.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / calweek-0.5.0-py2.py3-none-any.whl

Download URL calweek-0.5.0-py2.py3-none-any.whl
Size 5.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6dfb35cd0f930d4872018df92ffb741fb9e341114a59530e4abd0432b270fef5
BLAKE2b-256 checksum
How to use checksums
aab2afa1cfd3145e8089d489db3582a49a4a9d70467a981b82d79975cbae965d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.5.0 This release

1 release file

0.4.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page