whopperWednesday 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from datetime import date
|
|
2
|
+
|
|
3
|
+
__version__ = "0.2.0"
|
|
4
|
+
__all__ = ["isItWhopperWednesday", "COUNTRIES"]
|
|
5
|
+
|
|
6
|
+
# Countries with Whopper Wednesday
|
|
7
|
+
COUNTRIES = {
|
|
8
|
+
"US": "US", "USA": "US", "UNITED STATES": "US",
|
|
9
|
+
"UK": "UK", "GB": "UK", "UNITED KINGDOM": "UK",
|
|
10
|
+
"CA": "CA", "CAN": "CA", "CANADA": "CA",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def isItWhopperWednesday(day=None, country=None):
|
|
15
|
+
'''
|
|
16
|
+
Evaluates if it is Whopper Wednesday.
|
|
17
|
+
|
|
18
|
+
Inputs:
|
|
19
|
+
day -- a datetime.date (default today)
|
|
20
|
+
country -- "US", "UK" or "CA" (default None)
|
|
21
|
+
|
|
22
|
+
Outputs:
|
|
23
|
+
True -- it is Whopper Wednesday
|
|
24
|
+
False -- it is not Whopper Wednesday
|
|
25
|
+
'''
|
|
26
|
+
if day is None:
|
|
27
|
+
day = date.today()
|
|
28
|
+
if country is not None and country.strip().upper() not in COUNTRIES:
|
|
29
|
+
return False
|
|
30
|
+
if day.weekday() == 2:
|
|
31
|
+
return True
|
|
32
|
+
else:
|
|
33
|
+
return False
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: whopperWednesday
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Returns True if it is Whopper Wednesday (US, UK, Canada), else False.
|
|
5
|
+
Requires-Python: >=3.8
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# whopperWednesday
|
|
9
|
+
|
|
10
|
+
Zero dependencies. Tells you whether it's Whopper Wednesday.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install whopperWednesday
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
from datetime import date
|
|
18
|
+
from whopperWednesday import isItWhopperWednesday
|
|
19
|
+
|
|
20
|
+
isItWhopperWednesday() # True on Wednesdays, else False
|
|
21
|
+
isItWhopperWednesday(country="CA") # US, UK and Canada supported
|
|
22
|
+
isItWhopperWednesday(date(2026, 11, 25), "UK") # True
|
|
23
|
+
isItWhopperWednesday(country="France") # False (no Whopper Wednesday)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Country codes are case-insensitive and accept aliases (`USA`, `GB`, `Canada`, ...).
|
|
27
|
+
The day is checked using your computer's local date.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
whopperWednesday/__init__.py,sha256=qvWHqdP200Jhxdp0-tRd9BfkGFxXCpN3iMi98S1PoUk,838
|
|
2
|
+
whopperwednesday-0.2.0.dist-info/METADATA,sha256=wUgc_lvewVHm12UmP-vReq2bekT1DQiIS7aIS442a8s,840
|
|
3
|
+
whopperwednesday-0.2.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
4
|
+
whopperwednesday-0.2.0.dist-info/top_level.txt,sha256=6Tvhs983UUU6dTb06Sh63Ll3kQZt_CQvYLO7rTgRlnc,17
|
|
5
|
+
whopperwednesday-0.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
whopperWednesday
|