Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A python-module to parse strings to time-, date-, datetime- or timedelta-objects.

Project Description

Parse strings to objects of the datetime-module.

This module intends to make string-parsing to objects of the datetime-module as easy as possible while allowing a fine configuration about which kind of formats are supported.

Latest Version

The latest version of this project can be found at : http://github.com/thomst/timeparser.

Installation

  • Option 1 : Install via pip

    pip install timeparser
    
  • Option 2 : If you have downloaded the source

    python setup.py install
    

Dokumentaion:

Please visit the documentation on readthedocs.org: https://timeparser.readthedocs.org/en/latest/index.html

Usage

How to use?

>>> import timeparser
>>>
>>> timeparser.parsedate('24.4.13')
datetime.date(2013, 4, 24)
>>>
>>> timeparser.parsedate('24 Apr 2013')
datetime.date(2013, 4, 24)
>>>
>>> timeparser.parsetime('234405')
datetime.time(23, 44, 5)
>>>
>>> timeparser.TimeFormats.config(allow_no_sep=False)
>>> timeparser.parsetime('234405')
ValueError: couldn't parse 234405 as time
>>>
>>> timeparser.parsedatetime('24-04-13_23:44:05')
datetime.datetime(2013, 4, 24, 23, 44, 5)

Changes in v0.7

The formats-classes accept an keyword try_hard, which means they try to build formats for what ever kind of string was passed -regardless of any configuration

Reporting Bugs

Please report bugs at github issue tracker: https://github.com/thomst/timeparser/issues

Author

thomst <thomaslfuss@gmx.de> Thomas Leichtfuß

Release History

Release History

This version
History Node

0.7.4

History Node

0.7.3

History Node

0.7.1

History Node

0.7.0

History Node

0.6.0

History Node

0.5.2

History Node

0.5.1

History Node

0.5

History Node

0.4.3

History Node

0.4.2

History Node

0.4.1

History Node

0.4

History Node

0.3.1

History Node

0.3

History Node

0.2

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
timeparser-0.7.4.tar.gz (9.4 kB) Copy SHA256 Checksum SHA256 Source Feb 21, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting