Skip to main content

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ß

Metadata

Release files for timeparser 0.7.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for timeparser 0.7.4
File Size Uploaded
timeparser-0.7.4.tar.gz 9.4 kB Details

Release files / timeparser-0.7.4.tar.gz

Download URL timeparser-0.7.4.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
601740b58613240bcb23e1e3acf772e6a5f9457398dd5df961c95187382627dc
BLAKE2b-256 checksum
How to use checksums
615c325b7fbd474a18035b41bed48c28e2e418b830d957a6683a8b96773e8674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.7.4 This release

1 release file

0.7.3

1 release file

0.7.1

0.7.0

1 release file

0.6.0

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4

1 release file

0.3.1

1 release file

0.3

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page