Skip to main content

Parse human-readable date/time text.

Project description

parsedatetime

Parse human-readable date/time strings.

Python 2.7 or greater is required for parsedatetime version 1.0 or greater.

Wheel Status Travis CI

Installing

You can install parsedatetime using:

pip install parsedatetime

Running Tests

From the source directory:

python run_tests.py parsedatetime

To run tests on several python versions, type tox:

$ tox
[... tox creates a virtualenv for every python version and runs tests inside of each]
py27: commands succeeded
py33: commands succeeded
py34: commands succeeded

This assumes that you have python2.7, python3.4, etc in PATH.

Using parsedatetime

An example of how to use parsedatetime:

import parsedatetime

cal = parsedatetime.Calendar()

cal.parse("tomorrow")

More detailed examples can be found in the examples directory.

Documentation

The generated documentation is included by default in the docs directory and can also be viewed online at https://bear.im/code/parsedatetime/docs/index.html

The docs can be generated using either of the two commands:

python setup.py doc
epydoc --html --config epydoc.conf

Notes

The Calendar class has a member property named ptc which is created during the class init method to be an instance of parsedatetime_consts.CalendarConstants().

History

The code in parsedatetime has been implemented over the years in many different languages (C, Clipper, Delphi) as part of different custom/proprietary systems I’ve worked on. Sadly the previous code is not “open” in any sense of that word.

When I went to work for Open Source Applications Foundation and realized that the Chandler project could benefit from my experience with parsing of date/time text I decided to start from scratch and implement the code using Python and make it truly open.

After working on the initial concept and creating something that could be shown to the Chandler folks the code has now evolved to it’s current state with the help the Chandler folks, most especially Darshana.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parsedatetime-1.5.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

parsedatetime-1.5-py2-none-any.whl (50.7 kB view details)

Uploaded Python 2

File details

Details for the file parsedatetime-1.5.tar.gz.

File metadata

  • Download URL: parsedatetime-1.5.tar.gz
  • Upload date:
  • Size: 52.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for parsedatetime-1.5.tar.gz
Algorithm Hash digest
SHA256 3da6be2be506f59cce32e19e30e201053e1bb4d07e25668918e00f8a49ad40ab
MD5 e72720f9cd638bb9bbb3b616bc2508d4
BLAKE2b-256 f7e85fa5dd8643cd9c75d2823faf7e07657d3b440cb446c872ec71e48c813cc8

See more details on using hashes here.

File details

Details for the file parsedatetime-1.5-py2-none-any.whl.

File metadata

File hashes

Hashes for parsedatetime-1.5-py2-none-any.whl
Algorithm Hash digest
SHA256 3a74f100f90d65918315fe6490771ad208bc3f13afd32d35fcfe4e8d0b3b812b
MD5 f894f27cbff2b0a1a18418b09831067f
BLAKE2b-256 bad86dbf446399124324606d1ed397a23b31df8fca2a1740cb356ffe0e560300

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page