gnu: Add python-slugify.
[jackhill/guix/guix.git] / gnu / packages / time.scm
CommitLineData
233e7676
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
33dc54b0
RW
3;;; Copyright © 2013, 2017 Ludovic Courtès <ludo@gnu.org>
4;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
d1e75921 5;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
33dc54b0
RW
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>
33fdde8d 12;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5d20e1ec 13;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
47956fa0 14;;; Copyright © 2017 ng0 <ng0@n0.is>
33dc54b0 15;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
f8460d26 16;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
3ef29c00 17;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com>
b147f59f 18;;;
233e7676 19;;; This file is part of GNU Guix.
b147f59f 20;;;
233e7676 21;;; GNU Guix is free software; you can redistribute it and/or modify it
b147f59f
NK
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.
25;;;
233e7676 26;;; GNU Guix is distributed in the hope that it will be useful, but
b147f59f
NK
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.
30;;;
31;;; You should have received a copy of the GNU General Public License
233e7676 32;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
b147f59f 33
1ffa7090 34(define-module (gnu packages time)
4a44e743 35 #:use-module (guix licenses)
b147f59f
NK
36 #:use-module (guix packages)
37 #:use-module (guix download)
3ef29c00 38 #:use-module (guix git-download)
5d20e1ec
BW
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system python)
ac257f12 41 #:use-module (gnu packages check)
33dc54b0 42 #:use-module (gnu packages compression)
3ef29c00 43 #:use-module (gnu packages perl)
44d10b1f
RW
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages python-xyz))
b147f59f
NK
46
47(define-public time
48 (package
49 (name "time")
64f925cb 50 (version "1.9")
b147f59f
NK
51 (source
52 (origin
53 (method url-fetch)
54 (uri (string-append "mirror://gnu/time/time-"
55 version ".tar.gz"))
56 (sha256
57 (base32
64f925cb 58 "07jj7cz6lc13iqrpgn81ivqh8rkm73p4rnivwgrrshk23v4g1b7v"))))
b147f59f 59 (build-system gnu-build-system)
6fd52309 60 (home-page "https://www.gnu.org/software/time/")
f50d2669 61 (synopsis "Run a command, then display its resource usage")
b147f59f 62 (description
a22dc0c4
LC
63 "Time is a command that displays information about the resources that a
64program uses. The display output of the program can be customized or saved
65to a file.")
c8b38f8e 66 (license gpl3+)))
5d20e1ec
BW
67
68(define-public python-pytzdata
69 (package
70 (name "python-pytzdata")
01e9bc46 71 (version "2017.3.1")
5d20e1ec
BW
72 (source
73 (origin
74 (method url-fetch)
75 (uri (pypi-uri "pytzdata" version))
76 (sha256
77 (base32
01e9bc46 78 "1wi3jh39zsa9iiyyhynhj7w5b2p9wdyd0ppavpsrmf3wxvr7cwz8"))))
5d20e1ec
BW
79 (build-system python-build-system)
80 (native-inputs
81 `(("python-pytest" ,python-pytest)
82 ("python-nose" ,python-nose)))
83 (home-page "https://github.com/sdispater/pytzdata")
84 (synopsis "Timezone database for Python")
85 (description
86 "This library provides a timezone database for Python.")
87 (license expat)))
88
89(define-public python2-tzdata
90 (package-with-python2 python-pytzdata))
89c3eaaa 91
33dc54b0
RW
92(define-public python-pytz
93 (package
94 (name "python-pytz")
cb5ba282 95 (version "2018.5")
33dc54b0
RW
96 (source
97 (origin
98 (method url-fetch)
cb5ba282 99 (uri (pypi-uri "pytz" version ".tar.gz"))
33dc54b0
RW
100 (sha256
101 (base32
cb5ba282 102 "0xzj5gkpdn2da8m6j47chlp6zrzcypv9m0fjv4236q3jw4fyzfgz"))))
33dc54b0 103 (build-system python-build-system)
33dc54b0
RW
104 (home-page "http://pythonhosted.org/pytz")
105 (synopsis "Python timezone library")
106 (description "This library brings the Olson tz database into Python. It
107allows accurate and cross platform timezone calculations using Python 2.4 or
108higher. It also solves the issue of ambiguous times at the end of daylight
109saving time. Almost all of the Olson timezones are supported.")
110 (license expat)))
111
112(define-public python2-pytz
113 (package-with-python2 python-pytz))
114
89c3eaaa
BW
115(define-public python-pendulum
116 (package
117 (name "python-pendulum")
118 (version "1.2.4")
119 (source
120 (origin
121 (method url-fetch)
122 (uri (pypi-uri "pendulum" version))
123 (sha256
124 (base32
125 "1fj36yxi2f4lzchzd8ny1qjl67dbypnk0gn8qwad2w78579m8m8z"))))
126 (build-system python-build-system)
127 (native-inputs
128 `(("python-pytest" ,python-pytest)
129 ("python-nose" ,python-nose)))
130 (propagated-inputs
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
138standard @code{datetime} all @code{datetime} instances can be replaced by
139Pendulum instances.")
140 (license expat)))
141
142(define-public python2-pendulum
143 (package-with-python2 python-pendulum))
33dc54b0
RW
144
145(define-public python-dateutil
146 (package
147 (name "python-dateutil")
e30fc546 148 (version "2.7.3")
33dc54b0
RW
149 (source
150 (origin
151 (method url-fetch)
152 (uri (pypi-uri "python-dateutil" version))
153 (sha256
154 (base32
e30fc546 155 "1f7h54lg0w2ckch7592xpjkh8dg87k2br256h0iw49zn6bg02w72"))))
33dc54b0 156 (build-system python-build-system)
e30fc546
MB
157 (native-inputs
158 `(("python-setuptools-scm" ,python-setuptools-scm)))
33dc54b0
RW
159 (propagated-inputs
160 `(("python-six" ,python-six)))
161 (home-page "https://dateutil.readthedocs.io/en/stable/")
162 (synopsis "Extensions to the standard datetime module")
163 (description
164 "The dateutil module provides powerful extensions to the standard
165datetime module, available in Python 2.3+.")
e30fc546
MB
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))))
33dc54b0
RW
170
171(define-public python2-dateutil
172 (package-with-python2 python-dateutil))
173
174(define-public python-parsedatetime
175 (package
176 (name "python-parsedatetime")
177 (version "2.4")
178 (source
179 (origin
180 (method url-fetch)
181 (uri (pypi-uri "parsedatetime" version))
182 (sha256
183 (base32
184 "0jxqkjks7z9dn222cqgvskp4wr6d92aglinxq7pd2w4mzdc7r09x"))))
185 (build-system python-build-system)
186 (native-inputs
187 `(("python-nose" ,python-nose)
188 ("python-pyicu" ,python-pyicu)
189 ("python-pytest" ,python-pytest)
190 ("python-pytest-runner" ,python-pytest-runner)))
191 (propagated-inputs
192 `(("python-future" ,python-future)))
193 (home-page "https://github.com/bear/parsedatetime/")
194 (synopsis "Parse human-readable date/time text")
195 (description
196 "Parse human-readable date/time text.")
197 (license asl2.0)))
198
199(define-public python2-parsedatetime
200 (package-with-python2 python-parsedatetime))
201
202(define-public python-tzlocal
203 (package
204 (name "python-tzlocal")
d1e75921 205 (version "1.5.1")
33dc54b0
RW
206 (source
207 (origin
208 (method url-fetch)
209 (uri (pypi-uri "tzlocal" version))
210 (sha256
211 (base32
d1e75921 212 "0kiciwiqx0bv0fbc913idxibc4ygg4cb7f8rcpd9ij2shi4bigjf"))))
33dc54b0 213 (build-system python-build-system)
d1e75921
EF
214 (arguments
215 `(#:phases
216 (modify-phases %standard-phases
217 (add-before 'check 'fix-symlink-test
218 ;; see: https://github.com/regebro/tzlocal/issues/53
219 (lambda _
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")
223 #t)))))
33dc54b0
RW
224 (propagated-inputs
225 `(("python-pytz" ,python-pytz)))
d1e75921
EF
226 (native-inputs
227 `(("python-mock" ,python-mock)))
33dc54b0
RW
228 (home-page "https://github.com/regebro/tzlocal")
229 (synopsis "Local timezone information for Python")
230 (description
231 "Tzlocal returns a tzinfo object with the local timezone information.
232This module attempts to fix a glaring hole in pytz, that there is no way to
233get the local timezone information, unless you know the zoneinfo name, and
234under several distributions that's hard or impossible to figure out.")
d1e75921 235 (license expat)))
33dc54b0
RW
236
237(define-public python-isodate
238 (package
239 (name "python-isodate")
e4be1faa 240 (version "0.6.0")
33dc54b0
RW
241 (source
242 (origin
243 (method url-fetch)
244 (uri (pypi-uri "isodate" version))
245 (sha256
246 (base32
e4be1faa 247 "1n7jkz68kk5pwni540pr5zdh99bf6ywydk1p5pdrqisrawylldif"))))
33dc54b0 248 (build-system python-build-system)
e4be1faa
EF
249 (native-inputs
250 `(("python-six" ,python-six)))
251 (home-page "https://github.com/gweis/isodate/")
33dc54b0
RW
252 (synopsis "Python date parser and formatter")
253 (description
254 "Python-isodate is a python module for parsing and formatting
255ISO 8601 dates, time and duration.")
256 (license bsd-3)))
257
258(define-public python2-isodate
259 (package-with-python2 python-isodate))
260
261(define-public python-iso8601
262 (package
263 (name "python-iso8601")
56f3b85b 264 (version "0.1.12")
33dc54b0
RW
265 (source
266 (origin
267 (method url-fetch)
268 (uri (pypi-uri "iso8601" version))
269 (sha256
270 (base32
56f3b85b 271 "10nyvvnrhw2w3p09v1ica4lgj6f4g9j3kkfx17qmraiq3w7b5i29"))))
33dc54b0
RW
272 (build-system python-build-system)
273 (native-inputs
274 `(("python-pytest" ,python-pytest)))
275 (home-page "https://bitbucket.org/micktwomey/pyiso8601")
276 (synopsis "Module to parse ISO 8601 dates")
277 (description
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.")
280 (license expat)))
281
282(define-public python2-iso8601
283 (package-with-python2 python-iso8601))
284
285(define-public python-monotonic
286 (package
287 (name "python-monotonic")
33fdde8d 288 (version "1.5")
33dc54b0
RW
289 (source
290 (origin
291 (method url-fetch)
db3e631d 292 (uri (pypi-uri "monotonic" version))
33dc54b0
RW
293 (sha256
294 (base32
33fdde8d 295 "1c6z46yb600klbfhqadyl7vq0jdjdxkm72k43ra3iw3d0xakv593"))))
33dc54b0 296 (build-system python-build-system)
33fdde8d 297 (arguments '(#:tests? #f)) ; no tests
33dc54b0
RW
298 (home-page "https://github.com/atdt/monotonic")
299 (synopsis "Implementation of time.monotonic() for Python 2 & < 3.3")
300 (description
301 "This module provides a @code{monotonic()} function which returns the
302value (in fractional seconds) of a clock which never goes backwards.")
303 (license asl2.0)))
304
305(define-public python2-monotonic
306 (package-with-python2 python-monotonic))
307
308(define-public python-pyrfc3339
309 (package
310 (name "python-pyrfc3339")
0ce92d74 311 (version "1.1")
33dc54b0
RW
312 (source
313 (origin
314 (method url-fetch)
315 (uri (pypi-uri "pyRFC3339" version))
316 (sha256
317 (base32
0ce92d74 318 "06jv7ar7lpvvk0dixzwdr3wgm0g1lipxs429s2z7knwwa7hwpf41"))))
33dc54b0
RW
319 (build-system python-build-system)
320 (propagated-inputs
321 `(("python-pytz" ,python-pytz)))
322 (native-inputs
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
327timestamps.")
328 (license expat)))
329
330(define-public python2-pyrfc3339
331 (package-with-python2 python-pyrfc3339))
332
333(define-public python-arrow
334 (package
335 (name "python-arrow")
336 (version "0.10.0")
337 (source (origin
338 (method url-fetch)
339 (uri (pypi-uri "arrow" version))
340 (sha256
341 (base32
342 "08n7q2l69hlainds1byd4lxhwrq7zsw7s640zkqc3bs5jkq0cnc0"))))
343 (build-system python-build-system)
344 (native-inputs
345 `(;; For testing
346 ("python-chai" ,python-chai)
347 ("python-simplejson" ,python-simplejson)))
348 (propagated-inputs
349 `(("python-dateutil" ,python-dateutil)))
350 (home-page "https://github.com/crsmithdev/arrow/")
351 (synopsis "Dates and times for Python")
352 (description
353 "Arrow is a Python library to creating, manipulating, formatting and
354converting dates, times, and timestamps. It implements and updates the
355datetime type.")
356 (license asl2.0)))
357
358(define-public python2-arrow
359 (package-with-python2 python-arrow))
360
361(define-public python-aniso8601
362 (package
363 (name "python-aniso8601")
364 (version "1.3.0")
365 (source
366 (origin
367 (method url-fetch)
368 (uri (pypi-uri "aniso8601" version))
369 (sha256
370 (base32
371 "1waj54iv3n3lw1fapbz8a93yjgrybgpc86wif5baxdh1arpj9df3"))))
372 (build-system python-build-system)
373 (propagated-inputs
374 `(("python-dateutil" ,python-dateutil)))
375 (home-page "https://bitbucket.org/nielsenb/aniso8601")
376 (synopsis "Python library for parsing ISO 8601 strings")
377 (description
378 "This package contains a library for parsing ISO 8601 datetime strings.")
379 (license bsd-3)))
380
381(define-public python2-aniso8601
382 (package-with-python2 python-aniso8601))
3ef29c00
KM
383
384(define-public datefudge
385 (package
386 (name "datefudge")
387 (version "1.22")
388 (source (origin
389 (method git-fetch)
390 (uri (git-reference
391 (url "https://salsa.debian.org/debian/datefudge.git")
392 (commit (string-append "debian/" version))))
393 (file-name (git-file-name name version))
394 (sha256
395 (base32
396 "1fmd05r00wx4zc90lbi804jl7xwdl11jq2a1kp5lqimk3yyvfw4c"))))
397 (build-system gnu-build-system)
398 (arguments
399 `(#:test-target "test"
400 #:make-flags (list "CC=gcc"
401 (string-append "prefix=" (assoc-ref %outputs "out")))
402 #:phases
403 (modify-phases %standard-phases
404 (add-after 'unpack 'patch-makefile
405 (lambda _
406 (substitute* "Makefile"
407 ((" -o root -g root") "")
408 (("VERSION := \\$\\(shell dpkg-parsechangelog .*")
409 (string-append "VERSION = " ,version)))
410 #t))
411 (delete 'configure))))
412 (native-inputs
413 `(("perl" ,perl)))
414 (home-page "https://salsa.debian.org/debian/datefudge")
415 (synopsis "Pretend the system date is different")
416 (description
417 "Utility that fakes the system time by pre-loading a small library that
418modifies the @code{time}, @code{gettimeofday} and @code{clock_gettime} system
419calls.")
420 (license gpl2)))