1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-03 06:04:53 +00:00

Add devel/pytimespare, a small Python module for small Python module to parse

various kinds of time expressions.

Approved by: wg (mentor)
This commit is contained in:
Dan Langille 2015-09-04 17:18:21 +00:00
parent 1aba6e9749
commit f7e1c0c39d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=396120
4 changed files with 38 additions and 0 deletions

View File

@ -4175,6 +4175,7 @@
SUBDIR += py-python-statsd
SUBDIR += py-python2-pythondialog
SUBDIR += py-pythonbrew
SUBDIR += py-pytimeparse
SUBDIR += py-pytrie
SUBDIR += py-pytz
SUBDIR += py-pyutil

View File

@ -0,0 +1,18 @@
# Created by: Dan Langille <dvl@FreeBSD.org>
# $FreeBSD$
PORTNAME= pytimeparse
PORTVERSION= 1.1.5
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= dvl@FreeBSD.org
COMMENT= Small Python module to parse various kinds of time expressions.
LICENSE= MIT
USES= python
USE_PYTHON= distutils autoplist
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (pytimeparse-1.1.5.tar.gz) = 9addbd29ae638e610a78a3cb50371f2091938de89c1ab61fa9cde7556a18b207
SIZE (pytimeparse-1.1.5.tar.gz) = 9245

View File

@ -0,0 +1,17 @@
The single function pytimeparse.timeparse.timeparse, defined in the library,
(also available as pytimeparse.parse) parses time expressions like the following:
32m
2h32m
3d2h32m
1w3d2h32m
...
It returns the time as a number of seconds (an integer value if possible, otherwise a floating-point number):
>>> from pytimeparse import parse
>>> parse('1.2 minutes')
72
WWW: https://github.com/wroberts/pytimeparse