[ANN] python-dateutil 0.1

  • Thread starter Gustavo Niemeyer
  • Start date
G

Gustavo Niemeyer

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?
 
G

Gustavo Niemeyer

What is it?
.... 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?
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:
dtstart=now,until=now.replace(day=31))))
17

Thanks!
 
R

Robin Becker

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

How may work days until the end of the month?

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:

dtstart=now,until=now.replace(day=31))))
17

Thanks!
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.
 
S

Scott David Daniels

Gustavo said:
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
(e-mail address removed)
 
G

Gustavo Niemeyer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top