https://github.com/ramwin/week
documentation: https://week.readthedocs.io
https://github.com/ramwin/week
datetime python3 week
Last synced: 7 days ago
JSON representation
documentation: https://week.readthedocs.io
- Host: GitHub
- URL: https://github.com/ramwin/week
- Owner: ramwin
- Created: 2017-05-24T05:21:02.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-18T06:00:57.000Z (about 5 years ago)
- Last Synced: 2025-08-24T08:29:52.644Z (5 months ago)
- Topics: datetime, python3, week
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#### Xiang Wang @ 2017-05-24 13:40:52
# Documentation
to see the whole documentation, please click [week.readthedocs.io](https://week.readthedocs.io/en/latest/)
## Installation
```
pip install week
```
## Usage
```
>>> import datetime
>>> from week import Week
>>> Week.thisweek() == Week.create_from_date(datetime.date.today())
True
>>> week = Week.thisweek()
>>> week.startdate
datetime.date(2017, 5, 22)
>>> next_week = week.get_next_week()
>>> next_week.enddate
datetime.date(2017, 6, 4)
>>> another_week = week + 1
>>> another_week == next_week
True
>>> print(Week.create_from_date(datetime.date(2017,1,1)))
2016year 52week
>>> print(Week.create_from_date(datetime.date(2017,1,10)))
2017year 2week
```