1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2013, 2017 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2015, 2017 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com>
8 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
9 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
10 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
11 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
12 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
14 ;;; Copyright © 2017 ng0 <ng0@n0.is>
15 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
16 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
17 ;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages time)
35 #:use-module (guix licenses)
36 #:use-module (guix packages)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system python)
41 #:use-module (gnu packages check)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages python-xyz))
54 (uri (string-append "mirror://gnu/time/time-"
58 "07jj7cz6lc13iqrpgn81ivqh8rkm73p4rnivwgrrshk23v4g1b7v"))))
59 (build-system gnu-build-system)
60 (home-page "https://www.gnu.org/software/time/")
61 (synopsis "Run a command, then display its resource usage")
63 "Time is a command that displays information about the resources that a
64 program uses. The display output of the program can be customized or saved
68 (define-public python-pytzdata
70 (name "python-pytzdata")
75 (uri (pypi-uri "pytzdata" version))
78 "1wi3jh39zsa9iiyyhynhj7w5b2p9wdyd0ppavpsrmf3wxvr7cwz8"))))
79 (build-system python-build-system)
81 `(("python-pytest" ,python-pytest)
82 ("python-nose" ,python-nose)))
83 (home-page "https://github.com/sdispater/pytzdata")
84 (synopsis "Timezone database for Python")
86 "This library provides a timezone database for Python.")
89 (define-public python2-tzdata
90 (package-with-python2 python-pytzdata))
92 (define-public python-pytz
99 (uri (pypi-uri "pytz" version ".tar.gz"))
102 "0xzj5gkpdn2da8m6j47chlp6zrzcypv9m0fjv4236q3jw4fyzfgz"))))
103 (build-system python-build-system)
104 (home-page "http://pythonhosted.org/pytz")
105 (synopsis "Python timezone library")
106 (description "This library brings the Olson tz database into Python. It
107 allows accurate and cross platform timezone calculations using Python 2.4 or
108 higher. It also solves the issue of ambiguous times at the end of daylight
109 saving time. Almost all of the Olson timezones are supported.")
112 (define-public python2-pytz
113 (package-with-python2 python-pytz))
115 (define-public python-pendulum
117 (name "python-pendulum")
122 (uri (pypi-uri "pendulum" version))
125 "1fj36yxi2f4lzchzd8ny1qjl67dbypnk0gn8qwad2w78579m8m8z"))))
126 (build-system python-build-system)
128 `(("python-pytest" ,python-pytest)
129 ("python-nose" ,python-nose)))
131 `(("python-dateutil" ,python-dateutil)
132 ("python-pytzdata" ,python-pytzdata)
133 ("python-tzlocal" ,python-tzlocal)))
134 (home-page "https://github.com/sdispater/pendulum")
135 (synopsis "Alternate API for Python datetimes")
136 (description "Pendulum is a drop-in replacement for the standard
137 @{datetime} class, providing an alternative API. As it inherits from the
138 standard @code{datetime} all @code{datetime} instances can be replaced by
139 Pendulum instances.")
142 (define-public python2-pendulum
143 (package-with-python2 python-pendulum))
145 (define-public python-dateutil
147 (name "python-dateutil")
152 (uri (pypi-uri "python-dateutil" version))
155 "1f7h54lg0w2ckch7592xpjkh8dg87k2br256h0iw49zn6bg02w72"))))
156 (build-system python-build-system)
158 `(("python-setuptools-scm" ,python-setuptools-scm)))
160 `(("python-six" ,python-six)))
161 (home-page "https://dateutil.readthedocs.io/en/stable/")
162 (synopsis "Extensions to the standard datetime module")
164 "The dateutil module provides powerful extensions to the standard
165 datetime module, available in Python 2.3+.")
166 ;; The license was changed from the three-clause BSD license to a dual
167 ;; Apache 2.0/BSD-3 variant at 2017-12-01. Some code is only available as
168 ;; BSD-3 still; but all new code is dual licensed (the user can choose).
169 (license (list bsd-3 asl2.0))))
171 (define-public python2-dateutil
172 (package-with-python2 python-dateutil))
174 (define-public python-parsedatetime
176 (name "python-parsedatetime")
181 (uri (pypi-uri "parsedatetime" version))
184 "0jxqkjks7z9dn222cqgvskp4wr6d92aglinxq7pd2w4mzdc7r09x"))))
185 (build-system python-build-system)
187 `(("python-nose" ,python-nose)
188 ("python-pyicu" ,python-pyicu)
189 ("python-pytest" ,python-pytest)
190 ("python-pytest-runner" ,python-pytest-runner)))
192 `(("python-future" ,python-future)))
193 (home-page "https://github.com/bear/parsedatetime/")
194 (synopsis "Parse human-readable date/time text")
196 "Parse human-readable date/time text.")
199 (define-public python2-parsedatetime
200 (package-with-python2 python-parsedatetime))
202 (define-public python-tzlocal
204 (name "python-tzlocal")
209 (uri (pypi-uri "tzlocal" version))
212 "0kiciwiqx0bv0fbc913idxibc4ygg4cb7f8rcpd9ij2shi4bigjf"))))
213 (build-system python-build-system)
216 (modify-phases %standard-phases
217 (add-before 'check 'fix-symlink-test
218 ;; see: https://github.com/regebro/tzlocal/issues/53
220 (delete-file "tzlocal/test_data/symlink_localtime/etc/localtime")
221 (symlink "../usr/share/zoneinfo/Africa/Harare"
222 "tzlocal/test_data/symlink_localtime/etc/localtime")
225 `(("python-pytz" ,python-pytz)))
227 `(("python-mock" ,python-mock)))
228 (home-page "https://github.com/regebro/tzlocal")
229 (synopsis "Local timezone information for Python")
231 "Tzlocal returns a tzinfo object with the local timezone information.
232 This module attempts to fix a glaring hole in pytz, that there is no way to
233 get the local timezone information, unless you know the zoneinfo name, and
234 under several distributions that's hard or impossible to figure out.")
237 (define-public python-isodate
239 (name "python-isodate")
244 (uri (pypi-uri "isodate" version))
247 "1n7jkz68kk5pwni540pr5zdh99bf6ywydk1p5pdrqisrawylldif"))))
248 (build-system python-build-system)
250 `(("python-six" ,python-six)))
251 (home-page "https://github.com/gweis/isodate/")
252 (synopsis "Python date parser and formatter")
254 "Python-isodate is a python module for parsing and formatting
255 ISO 8601 dates, time and duration.")
258 (define-public python2-isodate
259 (package-with-python2 python-isodate))
261 (define-public python-iso8601
263 (name "python-iso8601")
268 (uri (pypi-uri "iso8601" version))
271 "10nyvvnrhw2w3p09v1ica4lgj6f4g9j3kkfx17qmraiq3w7b5i29"))))
272 (build-system python-build-system)
274 `(("python-pytest" ,python-pytest)))
275 (home-page "https://bitbucket.org/micktwomey/pyiso8601")
276 (synopsis "Module to parse ISO 8601 dates")
278 "This module parses the most common forms of ISO 8601 date strings (e.g.
279 @code{2007-01-14T20:34:22+00:00}) into @code{datetime} objects.")
282 (define-public python2-iso8601
283 (package-with-python2 python-iso8601))
285 (define-public python-monotonic
287 (name "python-monotonic")
292 (uri (pypi-uri "monotonic" version))
295 "1c6z46yb600klbfhqadyl7vq0jdjdxkm72k43ra3iw3d0xakv593"))))
296 (build-system python-build-system)
297 (arguments '(#:tests? #f)) ; no tests
298 (home-page "https://github.com/atdt/monotonic")
299 (synopsis "Implementation of time.monotonic() for Python 2 & < 3.3")
301 "This module provides a @code{monotonic()} function which returns the
302 value (in fractional seconds) of a clock which never goes backwards.")
305 (define-public python2-monotonic
306 (package-with-python2 python-monotonic))
308 (define-public python-pyrfc3339
310 (name "python-pyrfc3339")
315 (uri (pypi-uri "pyRFC3339" version))
318 "06jv7ar7lpvvk0dixzwdr3wgm0g1lipxs429s2z7knwwa7hwpf41"))))
319 (build-system python-build-system)
321 `(("python-pytz" ,python-pytz)))
323 `(("python-nose" ,python-nose)))
324 (home-page "https://github.com/kurtraschke/pyRFC3339")
325 (synopsis "Python timestamp library")
326 (description "Python library for generating and parsing RFC 3339-compliant
330 (define-public python2-pyrfc3339
331 (package-with-python2 python-pyrfc3339))
333 (define-public python-arrow
335 (name "python-arrow")
339 (uri (pypi-uri "arrow" version))
342 "08n7q2l69hlainds1byd4lxhwrq7zsw7s640zkqc3bs5jkq0cnc0"))))
343 (build-system python-build-system)
346 ("python-chai" ,python-chai)
347 ("python-simplejson" ,python-simplejson)))
349 `(("python-dateutil" ,python-dateutil)))
350 (home-page "https://github.com/crsmithdev/arrow/")
351 (synopsis "Dates and times for Python")
353 "Arrow is a Python library to creating, manipulating, formatting and
354 converting dates, times, and timestamps. It implements and updates the
358 (define-public python2-arrow
359 (package-with-python2 python-arrow))
361 (define-public python-aniso8601
363 (name "python-aniso8601")
368 (uri (pypi-uri "aniso8601" version))
371 "1waj54iv3n3lw1fapbz8a93yjgrybgpc86wif5baxdh1arpj9df3"))))
372 (build-system python-build-system)
374 `(("python-dateutil" ,python-dateutil)))
375 (home-page "https://bitbucket.org/nielsenb/aniso8601")
376 (synopsis "Python library for parsing ISO 8601 strings")
378 "This package contains a library for parsing ISO 8601 datetime strings.")
381 (define-public python2-aniso8601
382 (package-with-python2 python-aniso8601))
384 (define-public datefudge
391 (url "https://salsa.debian.org/debian/datefudge.git")
392 (commit (string-append "debian/" version))))
393 (file-name (git-file-name name version))
396 "1fmd05r00wx4zc90lbi804jl7xwdl11jq2a1kp5lqimk3yyvfw4c"))))
397 (build-system gnu-build-system)
399 `(#:test-target "test"
400 #:make-flags (list "CC=gcc"
401 (string-append "prefix=" (assoc-ref %outputs "out")))
403 (modify-phases %standard-phases
404 (add-after 'unpack 'patch-makefile
406 (substitute* "Makefile"
407 ((" -o root -g root") "")
408 (("VERSION := \\$\\(shell dpkg-parsechangelog .*")
409 (string-append "VERSION = " ,version)))
411 (delete 'configure))))
414 (home-page "https://salsa.debian.org/debian/datefudge")
415 (synopsis "Pretend the system date is different")
417 "Utility that fakes the system time by pre-loading a small library that
418 modifies the @code{time}, @code{gettimeofday} and @code{clock_gettime} system