opendate 0.1.20__py3-none-any.whl → 0.1.21__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.

Potentially problematic release.


This version of opendate might be problematic. Click here for more details.

date/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = '0.1.20'
1
+ __version__ = '0.1.21'
2
2
 
3
3
  import datetime as _datetime
4
4
 
@@ -32,6 +32,7 @@ from date.date import expect_utc_timezone
32
32
  from date.date import prefer_native_timezone
33
33
  from date.date import prefer_utc_timezone
34
34
  from date.date import Timezone
35
+ from date.extras import create_ics
35
36
  from date.extras import is_business_day
36
37
  from date.extras import is_within_business_hours
37
38
  from date.extras import overlap_days
@@ -153,4 +154,5 @@ __all__ = [
153
154
  'GMT',
154
155
  'UTC',
155
156
  'WEEKDAY_SHORTNAME',
157
+ 'create_ics',
156
158
  ]
date/date.py CHANGED
@@ -1836,19 +1836,3 @@ class Interval(_pendulum.Interval):
1836
1836
  current = handlers['advance'](current)
1837
1837
 
1838
1838
  return result
1839
-
1840
-
1841
- def create_ics(begdate, enddate, summary, location) -> str:
1842
- """Create a simple .ics file per RFC 5545 guidelines."""
1843
-
1844
- return f"""BEGIN:VCALENDAR
1845
- VERSION:2.0
1846
- PRODID:-//hacksw/handcal//NONSGML v1.0//EN
1847
- BEGIN:VEVENT
1848
- DTSTART;TZID=America/New_York:{begdate:%Y%m%dT%H%M%S}
1849
- DTEND;TZID=America/New_York:{enddate:%Y%m%dT%H%M%S}
1850
- SUMMARY:{summary}
1851
- LOCATION:{location}
1852
- END:VEVENT
1853
- END:VCALENDAR
1854
- """
date/extras.py CHANGED
@@ -15,6 +15,7 @@ __all__ = [
15
15
  'is_within_business_hours',
16
16
  'is_business_day',
17
17
  'overlap_days',
18
+ 'create_ics',
18
19
  ]
19
20
 
20
21
 
@@ -56,3 +57,19 @@ def overlap_days(
56
57
  if days:
57
58
  return overlap
58
59
  return overlap >= 0
60
+
61
+
62
+ def create_ics(begdate: Date | DateTime, enddate: Date | DateTime, summary: str, location: str) -> str:
63
+ """Create a simple .ics file per RFC 5545 guidelines."""
64
+
65
+ return f"""BEGIN:VCALENDAR
66
+ VERSION:2.0
67
+ PRODID:-//hacksw/handcal//NONSGML v1.0//EN
68
+ BEGIN:VEVENT
69
+ DTSTART;TZID=America/New_York:{begdate:%Y%m%dT%H%M%S}
70
+ DTEND;TZID=America/New_York:{enddate:%Y%m%dT%H%M%S}
71
+ SUMMARY:{summary}
72
+ LOCATION:{location}
73
+ END:VEVENT
74
+ END:VCALENDAR
75
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opendate
3
- Version: 0.1.20
3
+ Version: 0.1.21
4
4
  Summary: Python business datetimes
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -0,0 +1,7 @@
1
+ date/__init__.py,sha256=tKjf65xKkRvKfvXDnrZ5m5W-0dtcu99ZYoU-TYVJYh8,3927
2
+ date/date.py,sha256=93PxOA1ddW5qs773v6J65cUpdsWTzXr0GWSA3-MKQD4,62194
3
+ date/extras.py,sha256=bCU3UTDbWVX-7aDMptnGS4Zi1P_vM17D_M_zIphV1cg,2554
4
+ opendate-0.1.21.dist-info/METADATA,sha256=JdloOAIGxClCeyd9NVBlQuNYNazlZVTOkNznh_z7Y7k,22942
5
+ opendate-0.1.21.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
6
+ opendate-0.1.21.dist-info/licenses/LICENSE,sha256=V4Rx8WWy7v8Fim6PHcEBszpZkDLbCHeorz1e_gr0Cbk,1111
7
+ opendate-0.1.21.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- date/__init__.py,sha256=fBTJ_YMVP3bsGdDEip-PAwLjZuYNIV3Ov1FWAzQNXrc,3873
2
- date/date.py,sha256=iCGssGXDG2E0G5vPlBkq5T2fQmnHvfgcpriGJU48Osc,62594
3
- date/extras.py,sha256=oRgjCfqtYLE3RZeCVa95sBo5tas9XFcufl-zIqAjM34,2092
4
- opendate-0.1.20.dist-info/METADATA,sha256=Flar8a8gH-L5ih_OEY4Z7eUnBECVG03Mhb7_nusCNyQ,22942
5
- opendate-0.1.20.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
6
- opendate-0.1.20.dist-info/licenses/LICENSE,sha256=V4Rx8WWy7v8Fim6PHcEBszpZkDLbCHeorz1e_gr0Cbk,1111
7
- opendate-0.1.20.dist-info/RECORD,,