Skip to main content

An argparse-extension for parsing command-line arguments as time-, date-, datetime-, or timedelta-objects.

Project description

An argparse-extension for parsing command-line arguments as time-, date-, datetime-, or timedelta-objects.

Latest Version

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

Installation

  • Option 1 : Install via pip

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

    python setup.py install

Dokumentaion:

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

Usage

How to use?

>>> import argparse
>>> from timeparse import ParseDatetime
>>>
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--datetime', action=ParseDatetime, nargs='+')
>>>
>>> parser.parse_args("--datetime 2.4.2013 23:02".split()).datetime
datetime.datetime(2013, 4, 2, 23, 2)

Reporting Bugs

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

Author

thomst <thomaslfuss@gmx.de> Thomas Leichtfuß

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

timeparse-0.5.5.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file timeparse-0.5.5.tar.gz.

File metadata

  • Download URL: timeparse-0.5.5.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for timeparse-0.5.5.tar.gz
Algorithm Hash digest
SHA256 1066c90088e39212eb964edf3176d593fa26dcb329430c369259a9a8c8c4e539
MD5 e740526bb047d53e42483765c6750285
BLAKE2b-256 aeb8687c11c33d2a985c9f40f3fccd0d9b836245a49cb8d2b23ca7a0bf672f82

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