Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ANN] python-dateutil 0.1

0 views
Skip to first unread message

Gustavo Niemeyer

unread,
Oct 8, 2003, 8:38:38 PM10/8/03
to
What is it?
-----------
The dateutil module provides powerful extensions to the standard
datetime module, available in Python 2.3+.

Features
--------

* Computing of relative deltas (next month, next year,
next monday, last week of month, and a lot more);

* Computing of relative deltas between two given
date and/or datetime objects;

* Computing of dates based on very flexible recurrence rules
(every month, every week on Thursday and Friday, every
Friday 13th, and a *LOT* more), using a superset of the
iCalendar RFC specification. Parsing of RFC strings is
supported as well.

* Generic parsing of dates in almost any string format;

* Timezone (tzinfo) implementations for tzfile(5) format
files (/etc/localtime, /usr/share/zoneinfo, etc), TZ
environment string (in all known formats), iCalendar
format files, given ranges (with help from relative deltas),
local machine timezone, fixed offset timezone, and UTC
timezone.

* Computing of Easter Sunday dates for any given year,
using Western, Orthodox or Julian algorithms;

* More than 400 test cases.


Where to get it?
----------------
https://moin.conectiva.com.br/DateUtil

--
Gustavo Niemeyer
http://niemeyer.net

Robin Becker

unread,
Oct 9, 2003, 3:53:00 AM10/9/03
to
In article <mailman.1065660018...@python.org>, Gustavo
Niemeyer <niem...@conectiva.com> writes

>What is it?
>-----------
>The dateutil module provides powerful extensions to the standard
>datetime module, available in Python 2.3+.
>
.... is there support for business dates ie number of business days
between two dates etc?
--
Robin Becker

William Dode

unread,
Oct 9, 2003, 4:22:40 AM10/9/03
to
Gustavo Niemeyer <niem...@conectiva.com> writes:

> What is it?
> -----------
> The dateutil module provides powerful extensions to the standard
> datetime module, available in Python 2.3+.

Do you plan to propose it to the core python ? It would be great to
don't have again to change API when the same fonction will be integrated
in the core like it was with mx

Anyway, thanks for your work

--
William Dodé - http://flibuste.net

Gustavo Niemeyer

unread,
Oct 9, 2003, 9:27:30 AM10/9/03
to
> >What is it?
> >-----------
> >The dateutil module provides powerful extensions to the standard
> >datetime module, available in Python 2.3+.
> >
> .... is there support for business dates ie number of business days
> between two dates etc?

It will be hard to find something you can't do. :-)

How may work days until the end of the month?

>>> from dateutil.rrule import *
>>> from datetime import *
>>> now = datetime.now()
>>> len(list(rrule(FREQ_DAILY,byweekday=(MO,TU,WE,TH,FR),
dtstart=now,until=now.replace(day=31))))
16

Hummm.. interesting enough, this result is not right. Today should
also be counted in this case. There's a small bug related to
micrseconds handling in the module: since the recurrence is compared
against a date without microseconds, the recurrence is not greater
than the dtstart passed. I haven't got this because all 415 testcases
were using datetime instances without microseconds. Well, we
have 417 now.. ;-)

Here is the right result, with the fix:

>>> len(list(rrule(FREQ_DAILY,byweekday=(MO,TU,WE,TH,FR),
dtstart=now,until=now.replace(day=31))))
17

Thanks!

Gustavo Niemeyer

unread,
Oct 9, 2003, 9:33:03 AM10/9/03
to
> > What is it?
> > -----------
> > The dateutil module provides powerful extensions to the standard
> > datetime module, available in Python 2.3+.
>
> Do you plan to propose it to the core python ? It would be great to
> don't have again to change API when the same fonction will be
> integrated in the core like it was with mx

I don't quite understand. Are you're complaining that someone took
his time to build an internal datetime type? Or are you complaining
that M.-A. Lemburg has written mx.DateTime? :-)

The internal datetime is not the same thing as the mx.DateTime module.
If you're using mx.DateTime, you can keep using it.

Answering your question, yes, I do plan to propose the inclusion
in the core. If it will be included or not, I have no idea.

William Dode

unread,
Oct 9, 2003, 10:24:46 AM10/9/03
to
Gustavo Niemeyer <niem...@conectiva.com> writes:

>> > What is it?
>> > -----------
>> > The dateutil module provides powerful extensions to the standard
>> > datetime module, available in Python 2.3+.
>>
>> Do you plan to propose it to the core python ? It would be great to
>> don't have again to change API when the same fonction will be
>> integrated in the core like it was with mx
>
> I don't quite understand. Are you're complaining that someone took
> his time to build an internal datetime type? Or are you complaining
> that M.-A. Lemburg has written mx.DateTime? :-)

I just complain that such wonderfull tools are not in the core.

>
> The internal datetime is not the same thing as the mx.DateTime module.
> If you're using mx.DateTime, you can keep using it.

I thought they overlap, i'll look more...

>
> Answering your question, yes, I do plan to propose the inclusion
> in the core. If it will be included or not, I have no idea.

Thanks :-)

Robin Becker

unread,
Oct 9, 2003, 2:22:15 PM10/9/03
to
In article <mailman.106570615...@python.org>, Gustavo
Niemeyer <niem...@conectiva.com> writes
wow great. Do we have a to find the next bank holiday microsecond :).

With this functionality it'll make calculating those bond prices even
more interesting.
--
Robin Becker

Scott David Daniels

unread,
Oct 10, 2003, 12:30:35 PM10/10/03
to
Gustavo Niemeyer wrote:
> The dateutil module provides powerful extensions to the standard
> datetime module, available in Python 2.3+....
I looked on the page, but couldn't find a license description.
What licensing?

-Scott David Daniels
Scott....@Acm.Org

Gustavo Niemeyer

unread,
Oct 10, 2003, 4:39:09 PM10/10/03
to
> I looked on the page, but couldn't find a license description.
> What licensing?

Oh.. Sorry. I'll include it. It's released under the Python
Software Foundation license, the same as Python itself.

0 new messages