gnu: stylish-haskell: Update description.
[jackhill/guix/guix.git] / gnu / packages / time.scm
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, 2020 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>
18 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
19 ;;;
20 ;;; This file is part of GNU Guix.
21 ;;;
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
26 ;;;
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
31 ;;;
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34
35 (define-module (gnu packages time)
36 #:use-module (guix licenses)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system python)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages python-xyz))
47
48 (define-public time
49 (package
50 (name "time")
51 (version "1.9")
52 (source
53 (origin
54 (method url-fetch)
55 (uri (string-append "mirror://gnu/time/time-"
56 version ".tar.gz"))
57 (sha256
58 (base32
59 "07jj7cz6lc13iqrpgn81ivqh8rkm73p4rnivwgrrshk23v4g1b7v"))))
60 (build-system gnu-build-system)
61 (home-page "https://www.gnu.org/software/time/")
62 (synopsis "Run a command, then display its resource usage")
63 (description
64 "Time is a command that displays information about the resources that a
65 program uses. The display output of the program can be customized or saved
66 to a file.")
67 (license gpl3+)))
68
69 (define-public python-pytimeparse
70 (package
71 (name "python-pytimeparse")
72 (version "1.1.8")
73 (source
74 (origin
75 (method url-fetch)
76 (uri (pypi-uri "pytimeparse" version))
77 (sha256
78 (base32
79 "02kaambsgpjx3zi42j6l11rwms2p35b9hsk4f3kdf979gd3kcqg8"))))
80 (native-inputs
81 `(("python-nose" ,python-nose)))
82 (build-system python-build-system)
83 (home-page "https://github.com/wroberts/pytimeparse")
84 (synopsis "Time expression parser")
85 (description "This small Python module parses various kinds of time
86 expressions.")
87 (license expat)))
88
89 (define-public python-pytzdata
90 (package
91 (name "python-pytzdata")
92 (version "2019.3")
93 (source
94 (origin
95 (method url-fetch)
96 (uri (pypi-uri "pytzdata" version))
97 (sha256
98 (base32
99 "0ppfc6kz4p41mxyqxq1g1zp6gvns99g6b344qj6ih0x9vxy6zh7s"))))
100 (build-system python-build-system)
101 ;; XXX: The PyPI distribution contains no tests, and the upstream
102 ;; repository lacks a setup.py! How to build from git?
103 (arguments '(#:tests? #f))
104 (propagated-inputs
105 `(("python-cleo" ,python-cleo)))
106 (home-page "https://github.com/sdispater/pytzdata")
107 (synopsis "Timezone database for Python")
108 (description
109 "This library provides a timezone database for Python.")
110 (license expat)))
111
112 (define-public python2-tzdata
113 (package-with-python2 python-pytzdata))
114
115 (define-public python-pytz
116 (package
117 (name "python-pytz")
118 (version "2019.1")
119 (source
120 (origin
121 (method url-fetch)
122 (uri (pypi-uri "pytz" version))
123 (sha256
124 (base32
125 "0hg1r2c41gnmljdsdmdgy6kb1zkfmxsf49imd96g8znp4cyxsiyp"))))
126 (build-system python-build-system)
127 (home-page "http://pythonhosted.org/pytz")
128 (synopsis "Python timezone library")
129 (description "This library brings the Olson tz database into Python. It
130 allows accurate and cross platform timezone calculations using Python 2.4 or
131 higher. It also solves the issue of ambiguous times at the end of daylight
132 saving time. Almost all of the Olson timezones are supported.")
133 (license expat)))
134
135 (define-public python2-pytz
136 (package-with-python2 python-pytz))
137
138 (define-public python-pendulum
139 (package
140 (name "python-pendulum")
141 (version "2.1.0")
142 (source
143 (origin
144 (method url-fetch)
145 (uri (pypi-uri "pendulum" version))
146 (sha256
147 (base32
148 "1zhzk0ai8is8zclw4v73dllf0hx0l5nmm4sbwrh6cl8h5qsang09"))))
149 (build-system python-build-system)
150 ;; XXX: The PyPI distribution lacks tests, and the upstream repository
151 ;; lacks a setup.py!
152 (arguments '(#:tests? #f))
153 (propagated-inputs
154 `(("python-dateutil" ,python-dateutil)
155 ("python-pytzdata" ,python-pytzdata)))
156 (home-page "https://github.com/sdispater/pendulum")
157 (synopsis "Alternate API for Python datetimes")
158 (description "Pendulum is a drop-in replacement for the standard
159 @{datetime} class, providing an alternative API. As it inherits from the
160 standard @code{datetime} all @code{datetime} instances can be replaced by
161 Pendulum instances.")
162 (license expat)))
163
164 (define-public python2-pendulum
165 (package-with-python2 python-pendulum))
166
167 (define-public python-dateutil
168 (package
169 (name "python-dateutil")
170 (version "2.8.0")
171 (source
172 (origin
173 (method url-fetch)
174 (uri (pypi-uri "python-dateutil" version))
175 (sha256
176 (base32
177 "17nsfhy4xdz1khrfxa61vd7pmvd5z0wa3zb6v4gb4kfnykv0b668"))))
178 (build-system python-build-system)
179 (arguments
180 `(#:phases (modify-phases %standard-phases
181 (replace 'check
182 (lambda _
183 ;; Delete tests that depend on "freezegun" to avoid a
184 ;; circular dependency.
185 (delete-file "dateutil/test/test_utils.py")
186 (delete-file "dateutil/test/test_rrule.py")
187
188 ;; XXX: Fails to get timezone from /etc/localtime.
189 (delete-file "dateutil/test/test_tz.py")
190
191 (invoke "pytest" "-vv"))))))
192 (native-inputs
193 `(("python-pytest" ,python-pytest)
194 ("python-setuptools-scm" ,python-setuptools-scm)))
195 (propagated-inputs
196 `(("python-six" ,python-six)))
197 (home-page "https://dateutil.readthedocs.io/en/stable/")
198 (synopsis "Extensions to the standard datetime module")
199 (description
200 "The dateutil module provides powerful extensions to the standard
201 datetime module, available in Python 2.3+.")
202 ;; The license was changed from the three-clause BSD license to a dual
203 ;; Apache 2.0/BSD-3 variant at 2017-12-01. Some code is only available as
204 ;; BSD-3 still; but all new code is dual licensed (the user can choose).
205 (license (list bsd-3 asl2.0))))
206
207 (define-public python2-dateutil
208 (package-with-python2 python-dateutil))
209
210 (define-public python-parsedatetime
211 (package
212 (name "python-parsedatetime")
213 (version "2.4")
214 (source
215 (origin
216 (method url-fetch)
217 (uri (pypi-uri "parsedatetime" version))
218 (sha256
219 (base32
220 "0jxqkjks7z9dn222cqgvskp4wr6d92aglinxq7pd2w4mzdc7r09x"))))
221 (build-system python-build-system)
222 (native-inputs
223 `(("python-nose" ,python-nose)
224 ("python-pyicu" ,python-pyicu)
225 ("python-pytest" ,python-pytest)
226 ("python-pytest-runner" ,python-pytest-runner)))
227 (propagated-inputs
228 `(("python-future" ,python-future)))
229 (home-page "https://github.com/bear/parsedatetime/")
230 (synopsis "Parse human-readable date/time text")
231 (description
232 "Parse human-readable date/time text.")
233 (license asl2.0)))
234
235 (define-public python2-parsedatetime
236 (package-with-python2 python-parsedatetime))
237
238 (define-public python-tzlocal
239 (package
240 (name "python-tzlocal")
241 (version "1.5.1")
242 (source
243 (origin
244 (method url-fetch)
245 (uri (pypi-uri "tzlocal" version))
246 (sha256
247 (base32
248 "0kiciwiqx0bv0fbc913idxibc4ygg4cb7f8rcpd9ij2shi4bigjf"))))
249 (build-system python-build-system)
250 (arguments
251 `(#:phases
252 (modify-phases %standard-phases
253 (add-before 'check 'fix-symlink-test
254 ;; see: https://github.com/regebro/tzlocal/issues/53
255 (lambda _
256 (delete-file "tzlocal/test_data/symlink_localtime/etc/localtime")
257 (symlink "../usr/share/zoneinfo/Africa/Harare"
258 "tzlocal/test_data/symlink_localtime/etc/localtime")
259 #t)))))
260 (propagated-inputs
261 `(("python-pytz" ,python-pytz)))
262 (native-inputs
263 `(("python-mock" ,python-mock)))
264 (home-page "https://github.com/regebro/tzlocal")
265 (synopsis "Local timezone information for Python")
266 (description
267 "Tzlocal returns a tzinfo object with the local timezone information.
268 This module attempts to fix a glaring hole in pytz, that there is no way to
269 get the local timezone information, unless you know the zoneinfo name, and
270 under several distributions that's hard or impossible to figure out.")
271 (license expat)))
272
273 (define-public python-isodate
274 (package
275 (name "python-isodate")
276 (version "0.6.0")
277 (source
278 (origin
279 (method url-fetch)
280 (uri (pypi-uri "isodate" version))
281 (sha256
282 (base32
283 "1n7jkz68kk5pwni540pr5zdh99bf6ywydk1p5pdrqisrawylldif"))))
284 (build-system python-build-system)
285 (native-inputs
286 `(("python-six" ,python-six)))
287 (home-page "https://github.com/gweis/isodate/")
288 (synopsis "Python date parser and formatter")
289 (description
290 "Python-isodate is a python module for parsing and formatting
291 ISO 8601 dates, time and duration.")
292 (license bsd-3)))
293
294 (define-public python2-isodate
295 (package-with-python2 python-isodate))
296
297 (define-public python-iso8601
298 (package
299 (name "python-iso8601")
300 (version "0.1.12")
301 (source
302 (origin
303 (method url-fetch)
304 (uri (pypi-uri "iso8601" version))
305 (sha256
306 (base32
307 "10nyvvnrhw2w3p09v1ica4lgj6f4g9j3kkfx17qmraiq3w7b5i29"))))
308 (build-system python-build-system)
309 (native-inputs
310 `(("python-pytest" ,python-pytest)))
311 (home-page "https://bitbucket.org/micktwomey/pyiso8601")
312 (synopsis "Module to parse ISO 8601 dates")
313 (description
314 "This module parses the most common forms of ISO 8601 date strings (e.g.
315 @code{2007-01-14T20:34:22+00:00}) into @code{datetime} objects.")
316 (license expat)))
317
318 (define-public python2-iso8601
319 (package-with-python2 python-iso8601))
320
321 (define-public python-monotonic
322 (package
323 (name "python-monotonic")
324 (version "1.5")
325 (source
326 (origin
327 (method url-fetch)
328 (uri (pypi-uri "monotonic" version))
329 (sha256
330 (base32
331 "1c6z46yb600klbfhqadyl7vq0jdjdxkm72k43ra3iw3d0xakv593"))))
332 (build-system python-build-system)
333 (arguments '(#:tests? #f)) ; no tests
334 (home-page "https://github.com/atdt/monotonic")
335 (synopsis "Implementation of time.monotonic() for Python 2 & < 3.3")
336 (description
337 "This module provides a @code{monotonic()} function which returns the
338 value (in fractional seconds) of a clock which never goes backwards.")
339 (license asl2.0)))
340
341 (define-public python2-monotonic
342 (package-with-python2 python-monotonic))
343
344 (define-public python-pyrfc3339
345 (package
346 (name "python-pyrfc3339")
347 (version "1.1")
348 (source
349 (origin
350 (method url-fetch)
351 (uri (pypi-uri "pyRFC3339" version))
352 (sha256
353 (base32
354 "06jv7ar7lpvvk0dixzwdr3wgm0g1lipxs429s2z7knwwa7hwpf41"))))
355 (build-system python-build-system)
356 (propagated-inputs
357 `(("python-pytz" ,python-pytz)))
358 (native-inputs
359 `(("python-nose" ,python-nose)))
360 (home-page "https://github.com/kurtraschke/pyRFC3339")
361 (synopsis "Python timestamp library")
362 (description "Python library for generating and parsing RFC 3339-compliant
363 timestamps.")
364 (license expat)))
365
366 (define-public python2-pyrfc3339
367 (package-with-python2 python-pyrfc3339))
368
369 (define-public python-arrow
370 (package
371 (name "python-arrow")
372 (version "0.10.0")
373 (source (origin
374 (method url-fetch)
375 (uri (pypi-uri "arrow" version))
376 (sha256
377 (base32
378 "08n7q2l69hlainds1byd4lxhwrq7zsw7s640zkqc3bs5jkq0cnc0"))))
379 (build-system python-build-system)
380 (native-inputs
381 `(;; For testing
382 ("python-chai" ,python-chai)
383 ("python-simplejson" ,python-simplejson)))
384 (propagated-inputs
385 `(("python-dateutil" ,python-dateutil)))
386 (home-page "https://github.com/crsmithdev/arrow/")
387 (synopsis "Dates and times for Python")
388 (description
389 "Arrow is a Python library to creating, manipulating, formatting and
390 converting dates, times, and timestamps. It implements and updates the
391 datetime type.")
392 (license asl2.0)))
393
394 (define-public python2-arrow
395 (package-with-python2 python-arrow))
396
397 (define-public python-aniso8601
398 (package
399 (name "python-aniso8601")
400 (version "1.3.0")
401 (source
402 (origin
403 (method url-fetch)
404 (uri (pypi-uri "aniso8601" version))
405 (sha256
406 (base32
407 "1waj54iv3n3lw1fapbz8a93yjgrybgpc86wif5baxdh1arpj9df3"))))
408 (build-system python-build-system)
409 (propagated-inputs
410 `(("python-dateutil" ,python-dateutil)))
411 (home-page "https://bitbucket.org/nielsenb/aniso8601")
412 (synopsis "Python library for parsing ISO 8601 strings")
413 (description
414 "This package contains a library for parsing ISO 8601 datetime strings.")
415 (license bsd-3)))
416
417 (define-public python2-aniso8601
418 (package-with-python2 python-aniso8601))
419
420 (define-public datefudge
421 (package
422 (name "datefudge")
423 (version "1.23")
424 (source (origin
425 (method git-fetch)
426 (uri (git-reference
427 (url "https://salsa.debian.org/debian/datefudge.git")
428 (commit (string-append "debian/" version))))
429 (file-name (git-file-name name version))
430 (sha256
431 (base32
432 "0r9g8v9xnv60hq3j20wqy34kyig3sc2pisjxl4irn7jjx85f1spv"))))
433 (build-system gnu-build-system)
434 (arguments
435 `(#:test-target "test"
436 #:make-flags (list "CC=gcc"
437 (string-append "prefix=" (assoc-ref %outputs "out")))
438 #:phases
439 (modify-phases %standard-phases
440 (add-after 'unpack 'patch-makefile
441 (lambda _
442 (substitute* "Makefile"
443 ((" -o root -g root") "")
444 (("VERSION := \\$\\(shell dpkg-parsechangelog .*")
445 (string-append "VERSION = " ,version)))
446 #t))
447 (delete 'configure))))
448 (native-inputs
449 `(("perl" ,perl)))
450 (home-page "https://salsa.debian.org/debian/datefudge")
451 (synopsis "Pretend the system date is different")
452 (description
453 "Utility that fakes the system time by pre-loading a small library that
454 modifies the @code{time}, @code{gettimeofday} and @code{clock_gettime} system
455 calls.")
456 (license gpl2)))