python-dateutil 2.4.1__zip

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,31 @@
1
+ dateutil - Extensions to the standard Python datetime module.
2
+
3
+ Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net>
4
+ Copyright (c) 2012-2014 - Tomi Pieviläinen <tomi.pievilainen@iki.fi>
5
+ Copyright (c) 2014 - Yaron de Leeuw <me@jarondl.net>
6
+
7
+ All rights reserved.
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions are met:
11
+
12
+ * Redistributions of source code must retain the above copyright notice,
13
+ this list of conditions and the following disclaimer.
14
+ * Redistributions in binary form must reproduce the above copyright notice,
15
+ this list of conditions and the following disclaimer in the documentation
16
+ and/or other materials provided with the distribution.
17
+ * Neither the name of the copyright holder nor the names of its
18
+ contributors may be used to endorse or promote products derived from
19
+ this software without specific prior written permission.
20
+
21
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1 @@
1
+ include LICENSE NEWS zonefile_metadata.json updatezinfo.py
@@ -0,0 +1,219 @@
1
+ Version 2.4.1
2
+ -------------
3
+
4
+ - Added explicit check for valid hours if AM/PM is specified in parser.
5
+ (gh pr #22, issue #21)
6
+ - Fix bug in rrule introduced in 2.4.0 where byweekday parameter was not
7
+ handled properly. (gh pr #35, issue #34)
8
+ - Fix error where parser allowed some invalid dates, overwriting existing hours
9
+ with the last 2-digit number in the string. (gh pr #32, issue #31)
10
+ - Fix and add test for Python 2.x compatibility with boolean checking of
11
+ relativedelta objects. Implemented by @nimasmi (gh pr #43) and C�dric Krier
12
+ (lp: 1035038)
13
+ - Replaced parse() calls with explicit datetime objects in unit tests unrelated
14
+ to parser. (gh pr #36)
15
+ - Changed private _byxxx from sets to sorted tuples and fixed one currently
16
+ unreachable bug in _construct_byset. (gh pr #54)
17
+ - Additional documentation for parser (gh pr #29, #33, #41) and rrule.
18
+ - Formatting fixes to documentation of rrule and README.rst.
19
+ - Updated zoneinfo to 2015a.
20
+
21
+ Version 2.4.0
22
+ -------------
23
+
24
+ - Fix an issue with relativedelta and freezegun (lp:1374022)
25
+ - Fix tzinfo in windows for timezones without dst (lp:1010050, gh #2)
26
+ - Ignore missing timezones in windows like in POSIX
27
+ - Fix minimal version requirement for six (gh #6)
28
+ - Many rrule changes and fixes by @pganssle (gh pull requests #13 #14 #17),
29
+ including defusing some infinite loops (gh #4)
30
+
31
+ Version 2.3
32
+ -----------
33
+
34
+ - Cleanup directory structure, moved test.py to dateutil/tests/test.py
35
+
36
+ - Changed many aspects of dealing with the zone info file. Instead of a cache,
37
+ all the zones are loaded to memory, but symbolic links are loaded only once,
38
+ so not much memory is used.
39
+
40
+ - The package is now zip-safe, and universal-wheelable, thanks to changes in
41
+ the handling of the zoneinfo file.
42
+
43
+ - Fixed tzwin silently not imported on windows python2
44
+
45
+ - New maintainer, together with new hosting: GitHub, Travis, Read-The-Docs
46
+
47
+ Version 2.2
48
+ -----------
49
+
50
+ - Updated zoneinfo to 2013h
51
+
52
+ - fuzzy_with_tokens parse addon from Christopher Corley
53
+
54
+ - Bug with LANG=C fixed by Mike Gilbert
55
+
56
+ Version 2.1
57
+ -----------
58
+
59
+ - New maintainer
60
+
61
+ - Dateutil now works on Python 2.6, 2.7 and 3.2 from same codebase (with six)
62
+
63
+ - #704047: Ismael Carnales' patch for a new time format
64
+
65
+ - Small bug fixes, thanks for reporters!
66
+
67
+
68
+ Version 2.0
69
+ -----------
70
+
71
+ - Ported to Python 3, by Brian Jones. If you need dateutil for Python 2.X,
72
+ please continue using the 1.X series.
73
+
74
+ - There's no such thing as a "PSF License". This source code is now
75
+ made available under the Simplified BSD license. See LICENSE for
76
+ details.
77
+
78
+ Version 1.5
79
+ -----------
80
+
81
+ - As reported by Mathieu Bridon, rrules were matching the bysecond rules
82
+ incorrectly against byminute in some circumstances when the SECONDLY
83
+ frequency was in use, due to a copy & paste bug. The problem has been
84
+ unittested and corrected.
85
+
86
+ - Adam Ryan reported a problem in the relativedelta implementation which
87
+ affected the yearday parameter in the month of January specifically.
88
+ This has been unittested and fixed.
89
+
90
+ - Updated timezone information.
91
+
92
+
93
+ Version 1.4.1
94
+ -------------
95
+
96
+ - Updated timezone information.
97
+
98
+
99
+ Version 1.4
100
+ -----------
101
+
102
+ - Fixed another parser precision problem on conversion of decimal seconds
103
+ to microseconds, as reported by Erik Brown. Now these issues are gone
104
+ for real since it's not using floating point arithmetic anymore.
105
+
106
+ - Fixed case where tzrange.utcoffset and tzrange.dst() might fail due
107
+ to a date being used where a datetime was expected (reported and fixed
108
+ by Lennart Regebro).
109
+
110
+ - Prevent tzstr from introducing daylight timings in strings that didn't
111
+ specify them (reported by Lennart Regebro).
112
+
113
+ - Calls like gettz("GMT+3") and gettz("UTC-2") will now return the
114
+ expected values, instead of the TZ variable behavior.
115
+
116
+ - Fixed DST signal handling in zoneinfo files. Reported by
117
+ Nicholas F. Fabry and John-Mark Gurney.
118
+
119
+
120
+ Version 1.3
121
+ -----------
122
+
123
+ - Fixed precision problem on conversion of decimal seconds to
124
+ microseconds, as reported by Skip Montanaro.
125
+
126
+ - Fixed bug in constructor of parser, and converted parser classes to
127
+ new-style classes. Original report and patch by Michael Elsd�rfer.
128
+
129
+ - Initialize tzid and comps in tz.py, to prevent the code from ever
130
+ raising a NameError (even with broken files). Johan Dahlin suggested
131
+ the fix after a pyflakes run.
132
+
133
+ - Version is now published in dateutil.__version__, as requested
134
+ by Darren Dale.
135
+
136
+ - All code is compatible with new-style division.
137
+
138
+
139
+ Version 1.2
140
+ -----------
141
+
142
+ - Now tzfile will round timezones to full-minutes if necessary,
143
+ since Python's datetime doesn't support sub-minute offsets.
144
+ Thanks to Ilpo Nyyss�nen for reporting the issue.
145
+
146
+ - Removed bare string exceptions, as reported and fixed by
147
+ Wilfredo S�nchez Vega.
148
+
149
+ - Fix bug in leap count parsing (reported and fixed by Eugene Oden).
150
+
151
+
152
+ Version 1.1
153
+ -----------
154
+
155
+ - Fixed rrule byyearday handling. Abramo Bagnara pointed out that
156
+ RFC2445 allows negative numbers.
157
+
158
+ - Fixed --prefix handling in setup.py (by Sidnei da Silva).
159
+
160
+ - Now tz.gettz() returns a tzlocal instance when not given any
161
+ arguments and no other timezone information is found.
162
+
163
+ - Updating timezone information to version 2005q.
164
+
165
+
166
+ Version 1.0
167
+ -----------
168
+
169
+ - Fixed parsing of XXhXXm formatted time after day/month/year
170
+ has been parsed.
171
+
172
+ - Added patch by Jeffrey Harris optimizing rrule.__contains__.
173
+
174
+
175
+ Version 0.9
176
+ -----------
177
+
178
+ - Fixed pickling of timezone types, as reported by
179
+ Andreas K�hler.
180
+
181
+ - Implemented internal timezone information with binary
182
+ timezone files [1]. datautil.tz.gettz() function will now
183
+ try to use the system timezone files, and fallback to
184
+ the internal versions. It's also possible to ask for
185
+ the internal versions directly by using
186
+ dateutil.zoneinfo.gettz().
187
+
188
+ - New tzwin timezone type, allowing access to Windows
189
+ internal timezones (contributed by Jeffrey Harris).
190
+
191
+ - Fixed parsing of unicode date strings.
192
+
193
+ - Accept parserinfo instances as the parser constructor
194
+ parameter, besides parserinfo (sub)classes.
195
+
196
+ - Changed weekday to spell the not-set n value as None
197
+ instead of 0.
198
+
199
+ - Fixed other reported bugs.
200
+
201
+ [1] http://www.twinsun.com/tz/tz-link.htm
202
+
203
+
204
+ Version 0.5
205
+ -----------
206
+
207
+ - Removed FREQ_ prefix from rrule frequency constants
208
+ WARNING: this breaks compatibility with previous versions.
209
+
210
+ - Fixed rrule.between() for cases where "after" is achieved
211
+ before even starting, as reported by Andreas K�hler.
212
+
213
+ - Fixed two digit zero-year parsing (such as 31-Dec-00), as
214
+ reported by Jim Abramson, and included test case for this.
215
+
216
+ - Sort exdate and rdate before iterating over them, so that
217
+ it's not necessary to sort them before adding to the rruleset,
218
+ as reported by Nicholas Piper.
219
+
@@ -0,0 +1,26 @@
1
+ Metadata-Version: 1.1
2
+ Name: python-dateutil
3
+ Version: 2.4.1
4
+ Summary: Extensions to the standard Python datetime module
5
+ Home-page: https://dateutil.readthedocs.org
6
+ Author: Yaron de Leeuw
7
+ Author-email: me@jarondl.net
8
+ License: Simplified BSD
9
+ Description:
10
+ The dateutil module provides powerful extensions to the
11
+ datetime module available in the Python standard library.
12
+
13
+ Platform: UNKNOWN
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: BSD License
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 2
19
+ Classifier: Programming Language :: Python :: 2.6
20
+ Classifier: Programming Language :: Python :: 2.7
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3.2
23
+ Classifier: Programming Language :: Python :: 3.3
24
+ Classifier: Programming Language :: Python :: 3.4
25
+ Classifier: Topic :: Software Development :: Libraries
26
+ Requires: six
@@ -0,0 +1,124 @@
1
+ dateutil - powerful extensions to datetime
2
+ ==========================================
3
+
4
+ .. image:: https://img.shields.io/travis/dateutil/dateutil/master.svg?style=flat-square
5
+ :target: https://travis-ci.org/dateutil/dateutil
6
+ :alt: travis build status
7
+
8
+ .. image:: https://img.shields.io/appveyor/ci/dateutil/dateutil/master.svg?style=flat-square
9
+ :target: https://ci.appveyor.com/project/dateutil/dateutil
10
+ :alt: appveyor build status
11
+
12
+ .. image:: https://img.shields.io/pypi/dd/python-dateutil.svg?style=flat-square
13
+ :target: https://pypi.python.org/pypi/python-dateutil/
14
+ :alt: pypi downloads per day
15
+
16
+ .. image:: https://img.shields.io/pypi/v/python-dateutil.svg?style=flat-square
17
+ :target: https://pypi.python.org/pypi/python-dateutil/
18
+ :alt: pypi version
19
+
20
+
21
+
22
+ The `dateutil` module provides powerful extensions to
23
+ the standard `datetime` module, available in Python.
24
+
25
+
26
+ Download
27
+ ========
28
+ dateutil is available on PyPI
29
+ https://pypi.python.org/pypi/python-dateutil/
30
+
31
+ The documentation is hosted at:
32
+ https://dateutil.readthedocs.org/
33
+
34
+ Code
35
+ ====
36
+ https://github.com/dateutil/dateutil/
37
+
38
+ Features
39
+ ========
40
+
41
+ * Computing of relative deltas (next month, next year,
42
+ next monday, last week of month, etc);
43
+ * Computing of relative deltas between two given
44
+ date and/or datetime objects;
45
+ * Computing of dates based on very flexible recurrence rules,
46
+ using a superset of the `iCalendar <https://www.ietf.org/rfc/rfc2445.txt>`_
47
+ specification. Parsing of RFC strings is supported as well.
48
+ * Generic parsing of dates in almost any string format;
49
+ * Timezone (tzinfo) implementations for tzfile(5) format
50
+ files (/etc/localtime, /usr/share/zoneinfo, etc), TZ
51
+ environment string (in all known formats), iCalendar
52
+ format files, given ranges (with help from relative deltas),
53
+ local machine timezone, fixed offset timezone, UTC timezone,
54
+ and Windows registry-based time zones.
55
+ * Internal up-to-date world timezone information based on
56
+ Olson's database.
57
+ * Computing of Easter Sunday dates for any given year,
58
+ using Western, Orthodox or Julian algorithms;
59
+ * More than 400 test cases.
60
+
61
+ Quick example
62
+ =============
63
+ Here's a snapshot, just to give an idea about the power of the
64
+ package. For more examples, look at the documentation.
65
+
66
+ Suppose you want to know how much time is left, in
67
+ years/months/days/etc, before the next easter happening on a
68
+ year with a Friday 13th in August, and you want to get today's
69
+ date out of the "date" unix system command. Here is the code:
70
+
71
+ .. doctest:: readmeexample
72
+
73
+ >>> from dateutil.relativedelta import *
74
+ >>> from dateutil.easter import *
75
+ >>> from dateutil.rrule import *
76
+ >>> from dateutil.parser import *
77
+ >>> from datetime import *
78
+ >>> now = parse("Sat Oct 11 17:13:46 UTC 2003")
79
+ >>> today = now.date()
80
+ >>> year = rrule(YEARLY,dtstart=now,bymonth=8,bymonthday=13,byweekday=FR)[0].year
81
+ >>> rdelta = relativedelta(easter(year), today)
82
+ >>> print("Today is: %s" % today)
83
+ Today is: 2003-10-11
84
+ >>> print("Year with next Aug 13th on a Friday is: %s" % year)
85
+ Year with next Aug 13th on a Friday is: 2004
86
+ >>> print("How far is the Easter of that year: %s" % rdelta)
87
+ How far is the Easter of that year: relativedelta(months=+6)
88
+ >>> print("And the Easter of that year is: %s" % (today+rdelta))
89
+ And the Easter of that year is: 2004-04-11
90
+
91
+ Being exactly 6 months ahead was **really** a coincidence :)
92
+
93
+
94
+ Author
95
+ ======
96
+ The dateutil module was written by Gustavo Niemeyer <gustavo@niemeyer.net>
97
+ in 2003
98
+
99
+ It is maintained by:
100
+
101
+ * Gustavo Niemeyer <gustavo@niemeyer.net> 2003-2011
102
+ * Tomi Pieviläinen <tomi.pievilainen@iki.fi> 2012-2014
103
+ * Yaron de Leeuw <me@jarondl.net> 2014-
104
+
105
+ Building and releasing
106
+ ======================
107
+ When you get the source, it does not contain the internal zoneinfo
108
+ database. To get (and update) the database, run the updatezinfo.py script. Make sure
109
+ that the zic command is in your path, and that you have network connectivity
110
+ to get the latest timezone information from IANA. If you have downloaded
111
+ the timezone data earlier, you can give the tarball as a parameter to
112
+ updatezinfo.py.
113
+
114
+
115
+ Testing
116
+ =======
117
+ dateutil has a comprehensive test suite, which can be run simply by running
118
+ `python setup.py test [-q]` in the project root. Note that if you don't have the internal
119
+ zoneinfo database, some tests will fail. Apart from that, all tests should pass.
120
+
121
+ To easily test dateutil against all supported Python versions, you can use
122
+ `tox <https://tox.readthedocs.org/en/latest/>`_.
123
+
124
+ All github pull requests are automatically tested using travis.
@@ -0,0 +1,2 @@
1
+ # -*- coding: utf-8 -*-
2
+ __version__ = "2.4.1"
@@ -0,0 +1,89 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ This module offers a generic easter computing method for any given year, using
4
+ Western, Orthodox or Julian algorithms.
5
+ """
6
+
7
+ import datetime
8
+
9
+ __all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
10
+
11
+ EASTER_JULIAN = 1
12
+ EASTER_ORTHODOX = 2
13
+ EASTER_WESTERN = 3
14
+
15
+
16
+ def easter(year, method=EASTER_WESTERN):
17
+ """
18
+ This method was ported from the work done by GM Arts,
19
+ on top of the algorithm by Claus Tondering, which was
20
+ based in part on the algorithm of Ouding (1940), as
21
+ quoted in "Explanatory Supplement to the Astronomical
22
+ Almanac", P. Kenneth Seidelmann, editor.
23
+
24
+ This algorithm implements three different easter
25
+ calculation methods:
26
+
27
+ 1 - Original calculation in Julian calendar, valid in
28
+ dates after 326 AD
29
+ 2 - Original method, with date converted to Gregorian
30
+ calendar, valid in years 1583 to 4099
31
+ 3 - Revised method, in Gregorian calendar, valid in
32
+ years 1583 to 4099 as well
33
+
34
+ These methods are represented by the constants:
35
+
36
+ EASTER_JULIAN = 1
37
+ EASTER_ORTHODOX = 2
38
+ EASTER_WESTERN = 3
39
+
40
+ The default method is method 3.
41
+
42
+ More about the algorithm may be found at:
43
+
44
+ http://users.chariot.net.au/~gmarts/eastalg.htm
45
+
46
+ and
47
+
48
+ http://www.tondering.dk/claus/calendar.html
49
+
50
+ """
51
+
52
+ if not (1 <= method <= 3):
53
+ raise ValueError("invalid method")
54
+
55
+ # g - Golden year - 1
56
+ # c - Century
57
+ # h - (23 - Epact) mod 30
58
+ # i - Number of days from March 21 to Paschal Full Moon
59
+ # j - Weekday for PFM (0=Sunday, etc)
60
+ # p - Number of days from March 21 to Sunday on or before PFM
61
+ # (-6 to 28 methods 1 & 3, to 56 for method 2)
62
+ # e - Extra days to add for method 2 (converting Julian
63
+ # date to Gregorian date)
64
+
65
+ y = year
66
+ g = y % 19
67
+ e = 0
68
+ if method < 3:
69
+ # Old method
70
+ i = (19*g + 15) % 30
71
+ j = (y + y//4 + i) % 7
72
+ if method == 2:
73
+ # Extra dates to convert Julian to Gregorian date
74
+ e = 10
75
+ if y > 1600:
76
+ e = e + y//100 - 16 - (y//100 - 16)//4
77
+ else:
78
+ # New method
79
+ c = y//100
80
+ h = (c - c//4 - (8*c + 13)//25 + 19*g + 15) % 30
81
+ i = h - (h//28)*(1 - (h//28)*(29//(h + 1))*((21 - g)//11))
82
+ j = (y + y//4 + i + 2 - c + c//4) % 7
83
+
84
+ # p can be from -6 to 56 corresponding to dates 22 March to 23 May
85
+ # (later dates apply to method 2, although 23 May never actually occurs)
86
+ p = i - j + e
87
+ d = 1 + (p + 27 + (p + 6)//40) % 31
88
+ m = 3 + (p + 26)//30
89
+ return datetime.date(int(y), int(m), int(d))