projects/guix·blob ruby-team · refs

933 lines · 34.5 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012 Nikita Karetnikov <[email protected]>
3;;; Copyright © 2013, 2017, 2020, 2021 Ludovic Courtès <[email protected]>
4;;; Copyright © 2013, 2015 Andreas Enge <[email protected]>
5;;; Copyright © 2015-2019, 2021, 2024 Efraim Flashner <[email protected]>
6;;; Copyright © 2015, 2017 Leo Famulari <[email protected]>
7;;; Copyright © 2015, 2017 Cyril Roelandt <[email protected]>
8;;; Copyright © 2016 Sou Bunnbu <[email protected]>
9;;; Copyright © 2016 Hartmut Goebel <[email protected]>
10;;; Copyright © 2016 Danny Milosavljevic <[email protected]>
11;;; Copyright © 2016, 2020 Marius Bakke <[email protected]>
12;;; Copyright © 2016, 2017, 2018, 2020 Tobias Geerinckx-Rice <[email protected]>
13;;; Copyright © 2017 Ben Woodcroft <[email protected]>
14;;; Copyright © 2017 Nikita <[email protected]>
15;;; Copyright © 2017 Julien Lepiller <[email protected]>
16;;; Copyright © 2018 Alex Vong <[email protected]>
17;;; Copyright © 2019 Kyle Meyer <[email protected]>
18;;; Copyright © 2019 Pierre Langlois <[email protected]>
19;;; Copyright © 2020 Lars-Dominik Braun <[email protected]>
20;;; Copyright © 2020 Tanguy Le Carrour <[email protected]>
21;;; Copyright © 2021 Ryan Prior <[email protected]>
22;;; Copyright © 2021 Foo Chuan Wei <[email protected]>
23;;; Copyright © 2022 Maxim Cournoyer <[email protected]>
24;;; Copyright © 2022 Pradana AUMARS <[email protected]>
25;;; Copyright © 2023 Sharlatan Hellseher <[email protected]>
26;;; Copyright © 2024 Liliana Marie Prikler <[email protected]>
27;;; Copyright © 2024 Sharlatan Hellseher <[email protected]>
28;;; Copyright © 2024 Zheng Junjie <[email protected]>
29;;; Copyright © 2024 Vinicius Monego <[email protected]>
30;;; Copyright © 2024, 2025 Ricardo Wurmus <[email protected]>
31;;; Copyright © 2026 jgart <[email protected]>
32;;;
33;;; This file is part of GNU Guix.
34;;;
35;;; GNU Guix is free software; you can redistribute it and/or modify it
36;;; under the terms of the GNU General Public License as published by
37;;; the Free Software Foundation; either version 3 of the License, or (at
38;;; your option) any later version.
39;;;
40;;; GNU Guix is distributed in the hope that it will be useful, but
41;;; WITHOUT ANY WARRANTY; without even the implied warranty of
42;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43;;; GNU General Public License for more details.
44;;;
45;;; You should have received a copy of the GNU General Public License
46;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
47
48(define-module (gnu packages time)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages build-tools)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages geo)
55 #:use-module (gnu packages golang-build)
56 #:use-module (gnu packages golang-xyz)
57 #:use-module (gnu packages libffi)
58 #:use-module (gnu packages perl)
59 #:use-module (gnu packages python)
60 #:use-module (gnu packages python-build)
61 #:use-module (gnu packages python-check)
62 #:use-module (gnu packages python-xyz)
63 #:use-module (gnu packages rust)
64 #:use-module (gnu packages serialization)
65 #:use-module (gnu packages terminals)
66 #:use-module (gnu packages textutils)
67 #:use-module (gnu packages)
68 #:use-module (guix build-system cargo)
69 #:use-module (guix build-system gnu)
70 #:use-module (guix build-system go)
71 #:use-module (guix build-system pyproject)
72 #:use-module (guix download)
73 #:use-module (guix gexp)
74 #:use-module (guix utils)
75 #:use-module (guix git-download)
76 #:use-module (guix licenses)
77 #:use-module (guix packages))
78
79(define-public termdown
80 (package
81 (name "termdown")
82 (version "1.18.0")
83 (source
84 (origin
85 (method git-fetch)
86 (uri (git-reference
87 (url "https://github.com/trehn/termdown")
88 (commit version)))
89 (file-name (git-file-name name version))
90 (sha256
91 (base32 "15i7ilwzwdj831bcd1gjnirydcdbr1b10d7jw5syjv0xwqq3yy8y"))))
92 (build-system pyproject-build-system)
93 (arguments (list #:tests? #f)) ; No tests.
94 (native-inputs (list python-pytest python-setuptools))
95 (propagated-inputs (list python-click python-pyfiglet python-dateutil))
96 (home-page "https://github.com/trehn/termdown")
97 (synopsis "Countdown timer for your terminal")
98 (description
99 "Termdown provides a fancy text display while it counts down to zero from
100a starting point you provide. The user can pause and resume the countdown
101from the text user interface. It can also be used in stop watch mode which
102counts forward or for just showing the current time.")
103 (license gpl3)))
104
105(define-public time
106 (package
107 (name "time")
108 (version "1.10")
109 (source
110 (origin
111 (method url-fetch)
112 (uri (string-append "mirror://gnu/time/time-"
113 version ".tar.gz"))
114 (sha256
115 (base32
116 "1hq9vvam1bi8xz9d09xgj2fdxbmq1psii1hywiw897armfs9zhp8"))))
117 (build-system gnu-build-system)
118 (home-page "https://www.gnu.org/software/time/")
119 (synopsis "Run a command, then display its resource usage")
120 (description
121 "Time is a command that displays information about the resources that a
122program uses. The display output of the program can be customized or saved
123to a file.")
124 (license gpl3+)))
125
126(define-public pps-tools
127 ;; Last tagged release was in 2021
128 (let ((commit "e5083fe1481a34373dee2acfabb63001ee9c40e0")
129 (revision "1"))
130 (package
131 (name "pps-tools")
132 (version (git-version "1.0.3" revision commit))
133 (source
134 (origin
135 (method git-fetch)
136 (uri (git-reference
137 (url "https://github.com/redlab-i/pps-tools")
138 (commit commit)))
139 (file-name (git-file-name name version))
140 (sha256
141 (base32 "1q3yvkwgqzafpx940cgqjn0harziv9gix1k3r3ymidmip0i5z1cp"))))
142 (arguments
143 (list
144 #:tests? #f ;There is no test suite.
145 #:make-flags
146 #~(list "CC=gcc"
147 (string-append "DESTDIR=" %output))
148 #:phases
149 #~(modify-phases %standard-phases
150 ;; No configure script
151 (delete 'configure)
152 (add-after 'unpack 'patch-makefile
153 (lambda _
154 (substitute* "Makefile"
155 (("/usr/")
156 "/")))))))
157 (build-system gnu-build-system)
158 (home-page "https://github.com/redlab-i/pps-tools")
159 (synopsis "User-space tools and headers for LinuxPPS")
160 (description
161 "This package includes the necessary headers for using
162@url{http://linuxpps.org/, LinuxPPS} PPSAPI kernel interface in user-space
163applications, and several support tools.")
164 (license gpl2+))))
165
166(define-public python-pytimeparse
167 (package
168 (name "python-pytimeparse")
169 (version "1.1.8")
170 (source
171 (origin
172 (method git-fetch)
173 (uri (git-reference
174 (url "https://github.com/wroberts/pytimeparse")
175 (commit version)))
176 (file-name (git-file-name name version))
177 (sha256
178 (base32 "1r5ybq2brdinqlvvdmfv2lz4g1hwz2zd6k21qwzzw17jfxdv2m6g"))))
179 (build-system pyproject-build-system)
180 (arguments
181 (list
182 #:phases
183 #~(modify-phases %standard-phases
184 (add-before 'check 'cleanup
185 (lambda* (#:key inputs outputs #:allow-other-keys)
186 (delete-file-recursively
187 (string-append (site-packages inputs outputs)
188 "/pytimeparse/tests"))))
189 (replace 'check
190 (lambda* (#:key tests? #:allow-other-keys)
191 (when tests?
192 (invoke "python" "-m" "unittest")))))))
193 (native-inputs
194 (list python-setuptools python-wheel))
195 (home-page "https://github.com/wroberts/pytimeparse")
196 (synopsis "Time expression parser")
197 (description
198 "This small Python module parses various kinds of time expressions.")
199 (license expat)))
200
201(define-public python-pytzdata
202 (package
203 (name "python-pytzdata")
204 (version "2020.1")
205 (source
206 (origin
207 (method git-fetch)
208 (uri (git-reference
209 (url "https://github.com/sdispater/pytzdata")
210 (commit version)))
211 (file-name (git-file-name name version))
212 (sha256
213 (base32 "1idzpps56wx2lqvflxhpb1isz1ijn9y91ffd6hfg6qv1zikj9xa4"))))
214 (build-system pyproject-build-system)
215 (arguments
216 (list
217 #:phases
218 #~(modify-phases %standard-phases
219 (add-after 'unpack 'use-poetry-core
220 (lambda _
221 ;; Patch to use the core poetry API.
222 (substitute* "pyproject.toml"
223 (("poetry.masonry.api") "poetry.core.masonry.api")))))))
224 (native-inputs (list python-poetry-core python-pytest))
225 (propagated-inputs (list python-cleo))
226 (home-page "https://github.com/sdispater/pytzdata")
227 (synopsis "Timezone database for Python")
228 (description "This library provides a timezone database for Python.")
229 (license expat)))
230
231(define-public python-tzdata
232 (package
233 (name "python-tzdata")
234 ;; This package should be kept in sync with tzdata in (gnu packages base).
235 (version "2025.1")
236 (source
237 (origin
238 (method url-fetch)
239 (uri (pypi-uri "tzdata" version))
240 (sha256
241 (base32 "156nh5d0fagghgyz54ymbd4cnr6z05w8iiin2syjinwcx04lk294"))
242 (modules '((guix build utils)))
243 (snippet #~(delete-file-recursively "src/tzdata/zoneinfo"))))
244 (build-system pyproject-build-system)
245 (arguments
246 (list #:phases
247 #~(modify-phases %standard-phases
248 (add-after 'ensure-no-mtimes-pre-1980 'unpack-tzdata
249 (lambda* (#:key inputs #:allow-other-keys)
250 (copy-recursively
251 (search-input-directory inputs "share/zoneinfo")
252 "src/tzdata/zoneinfo")
253 (delete-file "src/tzdata/zoneinfo/posix")
254 (call-with-output-file "src/tzdata/zoneinfo/__init__.py"
255 (const #t)))))))
256 (inputs (list tzdata))
257 (native-inputs
258 (list python-pytest
259 python-setuptools))
260 (home-page "https://github.com/python/tzdata")
261 (synopsis "Python wrapper of IANA time zone data")
262 (description "This package provides a thin Python wrapper around tzdata.")
263 (license asl2.0)))
264
265(define-public python-pytz-deprecation-shim
266 (package
267 (name "python-pytz-deprecation-shim")
268 (version "0.1.0.post0")
269 (source
270 (origin
271 (method url-fetch)
272 (uri (pypi-uri "pytz_deprecation_shim" version))
273 (sha256
274 (base32 "17d58msbi18dc4lk29hcrgylvrv9vhniwi24axfdwvb13fp7n2dg"))))
275 (build-system pyproject-build-system)
276 (propagated-inputs (list python-dateutil python-tzdata))
277 (native-inputs (list python-pytest
278 python-pytz
279 python-setuptools
280 python-wheel))
281 (home-page "https://github.com/pganssle/pytz-deprecation-shim")
282 (synopsis "Shims to make deprecation of pytz easier")
283 (description
284 "This package aims to make the transition away from @code{pytz} easier.
285It is intended for temporary usage only, and should allow you to drop your
286dependency on @code{pytz} while also giving your users notice that eventually
287you will remove support for the pytz-specific interface.")
288 (license asl2.0)))
289
290(define-public python-pytz
291 (package
292 (name "python-pytz")
293 ;; This package should be kept in sync with tzdata in (gnu packages base).
294 (version "2025.1")
295 (source
296 (origin
297 (method url-fetch)
298 (uri (pypi-uri "pytz" version))
299 (sha256
300 (base32
301 "13hpf2my8mgqkr38ch7s3rym9zz60m6pq87rcn7b46155az45ny2"))))
302 (build-system pyproject-build-system)
303 (arguments
304 (list #:test-backend #~'unittest
305 #:test-flags #~(list "discover" "pytz/tests")))
306 (native-inputs
307 (list python-setuptools))
308 (home-page "http://pythonhosted.org/pytz")
309 (synopsis "Python timezone library")
310 (description "This library brings the Olson tz database into Python. It
311allows accurate and cross platform timezone calculations using Python 2.4 or
312higher. It also solves the issue of ambiguous times at the end of daylight
313saving time. Almost all of the Olson timezones are supported.")
314 (license expat)))
315
316(define-public python-pendulum
317 (package
318 (name "python-pendulum")
319 (version "3.1.0")
320 (source
321 (origin
322 (method git-fetch)
323 (uri (git-reference
324 (url "https://github.com/sdispater/pendulum")
325 (commit version)))
326 (file-name (git-file-name name version))
327 (sha256
328 (base32 "0rhh5hnrjbi1ams5ylnymari522k4v2kdk82qzafvmykkcvild36"))))
329 (build-system pyproject-build-system)
330 (arguments
331 (list
332 #:imported-modules `(,@%cargo-build-system-modules
333 ,@%pyproject-build-system-modules)
334 #:modules '(((guix build cargo-build-system)
335 #:prefix cargo:)
336 (guix build pyproject-build-system)
337 (guix build utils))
338 #:phases
339 #~(modify-phases %standard-phases
340 (add-after 'unpack 'prepare-cargo-build-system
341 (lambda args
342 (with-directory-excursion "rust"
343 (for-each (lambda (phase)
344 (format #t "Running cargo phase: ~a~%" phase)
345 (apply (assoc-ref cargo:%standard-phases phase)
346 #:cargo-target #$(cargo-triplet) args))
347 '(unpack-rust-crates configure
348 check-for-pregenerated-files
349 patch-cargo-checksums))))))))
350 (native-inputs
351 (list maturin
352 python-pytest
353 python-pytest-benchmark
354 python-pytz
355 python-setuptools
356 python-time-machine
357 rust
358 `(,rust "cargo")))
359 (inputs (cargo-inputs 'pendulum))
360 (propagated-inputs (list python-dateutil python-tzdata))
361 (home-page "https://github.com/sdispater/pendulum")
362 (synopsis "Alternate API for Python datetimes")
363 (description
364 "Pendulum is a drop-in replacement for the standard @code{datetime}
365class, providing an alternative API. As it inherits from the standard
366@code{datetime} all @code{datetime} instances can be replaced by Pendulum
367instances.")
368 (license expat)))
369
370(define-public python-dateutil
371 (package
372 (name "python-dateutil")
373 (version "2.9.0")
374 (source
375 (origin
376 (method url-fetch)
377 (uri (pypi-uri "python-dateutil" version))
378 (sha256
379 (base32 "02b7qqimar3p311m0y5z8b09v4qdd0qia037lpzj0nrzqqckxrvq"))))
380 (build-system pyproject-build-system)
381 (arguments
382 (list
383 #:test-flags
384 #~(list ;avoid freezegun dependency
385 "--ignore=tests/test_utils.py"
386 "--ignore=tests/test_rrule.py"
387 ;; XXX: Fails to get timezone from /etc/localtime.
388 "--ignore=tests/test_tz.py")
389 #:phases
390 #~(modify-phases %standard-phases
391 (add-after 'unpack 'relax-pytest-cov-requirement
392 (lambda _
393 (substitute* "tests/conftest.py"
394 (("\\item.add_marker\\(pytest\\.mark\\.no_cover\\)")
395 "continue")))))))
396 (native-inputs
397 (list python-pytest
398 python-setuptools
399 python-setuptools-scm))
400 (propagated-inputs
401 (list python-six))
402 (home-page "https://dateutil.readthedocs.io/en/stable/")
403 (synopsis "Extensions to the standard datetime module")
404 (description
405 "The dateutil module provides powerful extensions to the standard
406datetime module, available in Python 2.3+.")
407 ;; The license was changed from the three-clause BSD license to a dual
408 ;; Apache 2.0/BSD-3 variant at 2017-12-01. Some code is only available as
409 ;; BSD-3 still; but all new code is dual licensed (the user can choose).
410 (license (list bsd-3 asl2.0))))
411
412(define-public python-dateutils
413 ;; XXX: The last release was in 2021, no development on the master
414 ;; branch. consider to remove when nothing depends on it.
415 (package
416 (name "python-dateutils")
417 (version "0.6.12")
418 (source (origin
419 (method url-fetch)
420 (uri (pypi-uri "dateutils" version))
421 (sha256
422 (base32
423 "1wg3f3imjq3snvjccv64h5498pqv9xz664xhni7bsh8mnay91p83"))))
424 (build-system pyproject-build-system)
425 (arguments (list #:tests? #f)) ;requires twine
426 (propagated-inputs (list python-dateutil python-pytz))
427 (native-inputs (list python-setuptools))
428 (home-page "https://github.com/jmcantrell/python-dateutils")
429 (synopsis "Various utilities for working with date and datetime objects")
430 (description
431 "The main purpose of this package is to provide more complex arithmetic
432operations on dates/times. Heavy use is made of the @code{relativedelta} type
433from the @code{dateutil} library. Much of this package is just a light
434wrapper on top of this with some added features such as range generation and
435business day calculation.")
436 (license bsd-0)))
437
438(define-public python-parsedatetime
439 (package
440 (name "python-parsedatetime")
441 (version "2.6")
442 (source
443 (origin
444 (method git-fetch)
445 (uri (git-reference
446 (url "https://github.com/bear/parsedatetime")
447 (commit (string-append "v" version))))
448 (file-name (git-file-name name version))
449 (sha256
450 (base32 "001rxkawjjjffbqzjg96znkhj4z6q7ky349rldd8yx6vk8cgdc2m"))))
451 (build-system pyproject-build-system)
452 (native-inputs
453 (list python-pyicu python-pytest python-setuptools python-wheel))
454 (propagated-inputs
455 (list python-future))
456 (home-page "https://github.com/bear/parsedatetime/")
457 (synopsis "Parse human-readable date/time text")
458 (description
459 "This package provides some tools to parse human-readable date/time text
460in Python.")
461 (license asl2.0)))
462
463(define-public python-ciso8601
464 (package
465 (name "python-ciso8601")
466 (version "2.3.2")
467 (source
468 (origin
469 (method git-fetch)
470 ;; The PyPi distribution doesn't include the tests.
471 (uri (git-reference
472 (url "https://github.com/closeio/ciso8601")
473 (commit (string-append "v" version))))
474 (file-name (git-file-name name version))
475 (sha256
476 (base32 "189adk14ygs1cx3ncm1wqqfh18r72gl299zkllncynp1y79d0nd1"))))
477 (build-system pyproject-build-system)
478 (native-inputs
479 (list python-pytest
480 python-setuptools
481 python-wheel))
482 (home-page "https://github.com/closeio/ciso8601")
483 (synopsis "Fast ISO8601 date time parser")
484 (description
485 "The package ciso8601 converts ISO 8601 or RFC 3339 date time strings
486into Python datetime objects.")
487 (license expat)))
488
489(define-public python-relativetimebuilder
490 (package
491 (name "python-relativetimebuilder")
492 (version "3.0.1")
493 (source
494 (origin
495 (method url-fetch)
496 (uri (pypi-uri "relativetimebuilder" version))
497 (sha256
498 (base32 "1x83vzwajz8rmml8x4ysr4cnxh6x0w42wkhw4zivd8qsbi9zcwzm"))))
499 (build-system pyproject-build-system)
500 (native-inputs
501 (list python-pytest
502 python-setuptools
503 python-wheel))
504 (propagated-inputs
505 (list python-aniso8601
506 python-dateutil))
507 (home-page "https://bitbucket.org/nielsenb/relativetimebuilder")
508 (synopsis "ANISO8601 builder for dateutil relativedeltas")
509 (description
510 "This package provides functionality for utilizing the relativedelta
511feature from the dateutil library, ensuring calendar precision with
512aniso8601.")
513 ;; setup.py and PyPI: "License :: OSI Approved :: BSD License"
514 (license bsd-3)))
515
516(define-public python-timeslot
517 (let ((commit "af35445e96cbb2f3fb671a75aac6aa93e4e7e7a6")
518 (revision "0"))
519 (package
520 (name "python-timeslot")
521 (version (git-version "0.1.2" revision commit))
522 (source
523 (origin
524 (method git-fetch)
525 (uri (git-reference
526 (url "https://github.com/ErikBjare/timeslot")
527 (commit commit)))
528 (file-name (git-file-name name version))
529 (sha256
530 (base32 "1m0zrr60p4brkdwkkhdzhvmd98flklqgbjryjpdcfq1c4gd60j0q"))))
531 (build-system pyproject-build-system)
532 (native-inputs
533 (list python-poetry-core python-pytest python-setuptools))
534 (home-page "https://github.com/ErikBjare/timeslot")
535 (synopsis "Data type for representing time slots")
536 (description
537 "This package provides a data type for representing time slots with a
538start and end. It completes the datetime Python module, which can represent a
539time, a duration, a timezone, but not a range or interval.")
540 (license expat))))
541
542(define-public python-timezonefinder
543 (package
544 (name "python-timezonefinder")
545 (version "8.2.1")
546 (source
547 (origin
548 (method git-fetch)
549 (uri (git-reference
550 (url "https://github.com/jannikmi/timezonefinder")
551 (commit version)))
552 (file-name (git-file-name name version))
553 (sha256
554 (base32 "0madqryxm3ynij1n285vakp8l2mz8mzlfg5slcy0mbbz5vh4kqrs"))))
555 (build-system pyproject-build-system)
556 (arguments
557 (list
558 ;; tests: 1995 passed, 1 deselected
559 #:test-flags
560 ;; FileNotFoundError: [Errno 2] No such file or directory: 'uv'
561 #~(list "--ignore=tests/test_package_contents.py"
562 "--ignore=tests/test_integration.py"
563 ;; ValueError: Trying to use the clang implementation of the
564 ;; point in polygon algorithm while the C extension in not
565 ;; loaded.
566 "--ignore=tests/utils_test.py"
567 ;; pytz.exceptions.UnknownTimeZoneError: 'America/Coyhaique'
568 (string-append "--deselect=tests/test_compatibility.py::"
569 "TestCompatibility::test_with_pytz"))))
570 (native-inputs
571 (list python-pytest
572 python-pytz
573 python-setuptools))
574 (propagated-inputs
575 (list python-cffi
576 python-h3
577 python-flatbuffers
578 python-numpy
579 python-pydantic))
580 (home-page "https://timezonefinder.michelfe.it/gui")
581 (synopsis "Finding the timezone of any coordinates on Earth offline")
582 (description "This is a python package for looking up the corresponding
583timezone for given coordinates on earth entirely offline.")
584 (license expat)))
585
586(define-public python-strict-rfc3339
587 (package
588 (name "python-strict-rfc3339")
589 (version "0.7")
590 (source
591 (origin
592 (method git-fetch)
593 (uri (git-reference
594 (url "https://github.com/danielrichman/strict-rfc3339")
595 (commit (string-append "version-" version))))
596 (file-name (git-file-name name version))
597 (sha256
598 (base32 "0b12bh9v9gwkm89kxbidxw2z81lg8fx1v5fzgs313v1wgx6qb09p"))))
599 (build-system pyproject-build-system)
600 (arguments
601 (list
602 #:test-backend #~'unittest
603 #:test-flags #~(list "discover")
604 #:phases
605 #~(modify-phases %standard-phases
606 (add-after 'unpack 'skip-bad-tests
607 (lambda _
608 ;; The timestamp to local offset tests fail due to missing
609 ;; timezone data (see:
610 ;; https://github.com/danielrichman/strict-rfc3339/issues/9).
611 (substitute* "test_strict_rfc3339.py"
612 ((#$(if (or (target-x86-32?) (target-arm32?))
613 ;; On 32-bit platforms the size of time_t is too small
614 ;; for these tests.
615 (string-append "(test_dst_transition|test_float|"
616 "test_now|test_simple_cases|"
617 "test_leap_year|test_y2038)")
618 (string-append "(test_dst_transition|test_float|"
619 "test_now|test_simple_cases)"))
620 match)
621 (string-append "__off_" match))))))))
622 (native-inputs (list python-setuptools))
623 (home-page "https://github.com/danielrichman/strict-rfc3339")
624 (synopsis "RFC3339 procedures library")
625 (description
626 "The @code{strict_rfc3339} Python module provides strict, simple, lightweight
627@url{https://www.rfc-editor.org/rfc/rfc3339, RFC3339} (Date and Time on the
628Internet: Timestamps) procedures.
629
630It enables or aims to:
631@itemize
632@item Convert UNIX timestamps to and from RFC3339.
633@item Produce RFC3339 strings with a UTC offset (Z) or with the offset that
634the C time module reports is the local timezone offset.
635@item Be simple with minimal dependencies/libraries.
636@item Avoid timezones as much as possible.
637@item Be very strict and follow RFC3339.
638@end itemize")
639 (license gpl3+)))
640
641(define-public python-tzlocal
642 (package
643 (name "python-tzlocal")
644 (version "5.2")
645 (source
646 (origin
647 (method git-fetch)
648 (uri (git-reference
649 (url "https://github.com/regebro/tzlocal")
650 (commit version)))
651 (file-name (git-file-name name version))
652 (sha256
653 (base32
654 "1apa3i5fsfw28jnaaaa7jr976y5wbifl3h04id0bvplvsb9zpmy7"))))
655 (build-system pyproject-build-system)
656 (propagated-inputs
657 (list python-tzdata))
658 (native-inputs
659 (list python-pytest python-pytest-mock python-setuptools))
660 (home-page "https://github.com/regebro/tzlocal")
661 (synopsis "Local timezone information for Python")
662 (description
663 "Tzlocal returns a tzinfo object with the local timezone information.
664This module attempts to fix a glaring hole in pytz, that there is no way to
665get the local timezone information, unless you know the zoneinfo name, and
666under several distributions that's hard or impossible to figure out.")
667 (license expat)))
668
669(define-public python-isodate
670 (package
671 (name "python-isodate")
672 (version "0.7.2")
673 (source
674 (origin
675 (method url-fetch)
676 (uri (pypi-uri "isodate" version))
677 (sha256
678 (base32
679 "1rjkm5qj3lz60sgva5g38cpfqd8byj2jlaf0qskg8xna8c7smlac"))))
680 (build-system pyproject-build-system)
681 (native-inputs
682 (list python-pytest
683 python-setuptools
684 python-setuptools-scm
685 python-wheel))
686 (home-page "https://github.com/gweis/isodate/")
687 (synopsis "Python date parser and formatter")
688 (description
689 "Python-isodate is a python module for parsing and formatting
690ISO 8601 dates, time and duration.")
691 (license bsd-3)))
692
693(define-public python-iso8601
694 (package
695 (name "python-iso8601")
696 (version "2.1.0")
697 (source
698 (origin
699 (method url-fetch)
700 (uri (pypi-uri "iso8601" version))
701 (sha256
702 (base32 "1px83gnklx1dmwb3n3dcplyfvaczhbvhkjcq34qc88c9xqlkh7bb"))))
703 (build-system pyproject-build-system)
704 (native-inputs (list python-poetry-core python-pytest python-pytz))
705 (home-page "https://github.com/micktwomey/pyiso8601")
706 (synopsis "Module to parse ISO 8601 dates")
707 (description
708 "This module parses the most common forms of ISO 8601 date strings (e.g.
709@code{2007-01-14T20:34:22+00:00}) into @code{datetime} objects.")
710 (license expat)))
711
712;; The only one user is samba/pinned.
713(define-public python-iso8601/pinned
714 (hidden-package
715 (package/inherit python-iso8601
716 (version "1.0.2")
717 (source
718 (origin
719 (method url-fetch)
720 (uri (pypi-uri "iso8601" version))
721 (sha256
722 (base32
723 "1ccl6plks706hxm35cn1wsvxhqh3bfwi5cjgjpdxjib81qi07x97")))))))
724
725(define-public python-pyrfc3339
726 (package
727 (name "python-pyrfc3339")
728 (version "2.0.1")
729 (source
730 (origin
731 (method git-fetch) ;no tests in PyPI archive
732 (uri (git-reference
733 (url "https://github.com/kurtraschke/pyRFC3339")
734 (commit (string-append "v" version))))
735 (file-name (git-file-name name version))
736 (sha256
737 (base32 "1q7kz8i8kp1hk40zswgm7dcyyd2xmjpgn1jdm6rlpv3ddjdxdg48"))))
738 (build-system pyproject-build-system)
739 (arguments
740 (list
741 #:phases
742 #~(modify-phases %standard-phases
743 (add-before 'check 'pre-check
744 (lambda* (#:key inputs #:allow-other-keys)
745 (setenv "TZ" "UTC")
746 (setenv "TZDIR"
747 (search-input-directory inputs "share/zoneinfo")))))))
748 (native-inputs
749 (list python-pytest
750 python-setuptools
751 tzdata-for-tests))
752 (home-page "https://github.com/kurtraschke/pyRFC3339")
753 (synopsis "Python timestamp library")
754 (description "Python library for generating and parsing RFC 3339-compliant
755timestamps.")
756 (license expat)))
757
758(define-public python-arrow
759 (package
760 (name "python-arrow")
761 (version "1.3.0")
762 (source (origin
763 (method url-fetch)
764 (uri (pypi-uri "arrow" version))
765 (sha256
766 (base32
767 "11bssv25jix57igvfmvg2v8dmwk55b4dh6hgffazidccchbhcm6l"))))
768 (build-system pyproject-build-system)
769 ;; Tests: 1837 passed, 2 xpassed.
770 (native-inputs
771 (list python-dateparser
772 python-flit-core
773 python-pytest
774 python-pytest-mock
775 python-pytz
776 python-simplejson))
777 (propagated-inputs
778 (list python-dateutil
779 python-types-python-dateutil))
780 (home-page "https://github.com/arrow-py/arrow")
781 (synopsis "Dates and times for Python")
782 (description
783 "Arrow is a Python library to creating, manipulating, formatting and
784converting dates, times, and timestamps. It implements and updates the
785datetime type.")
786 (license asl2.0)))
787
788(define-public python-aniso8601
789 (package
790 (name "python-aniso8601")
791 (version "10.0.1")
792 (source
793 (origin
794 (method url-fetch)
795 (uri (pypi-uri "aniso8601" version))
796 (sha256
797 (base32 "0ib8s62d3zh7qy5rnlrisns2bbjixb0lmyal3yp2h5fxcf38yj15"))))
798 (build-system pyproject-build-system)
799 (arguments (list #:test-backend #~'unittest
800 #:test-flags #~(list "discover" "aniso8601")))
801 (native-inputs
802 (list python-setuptools))
803 (home-page "https://codeberg.org/nielsenb-jf/aniso8601")
804 (synopsis "Python library for parsing ISO 8601 strings")
805 (description
806 "This package contains a library for parsing ISO 8601 datetime strings.")
807 (license bsd-3)))
808
809(define-public rdate
810 (let ((commit "91d84610e3695e90a884e2953908e95a856a9b74")
811 (revision "1"))
812 (package
813 (name "rdate")
814 (version (git-version "1.4" revision commit))
815 (source
816 (origin
817 (method git-fetch)
818 (uri (git-reference
819 (url "https://github.com/njh/rdate")
820 (commit commit)))
821 (file-name (git-file-name name version))
822 (sha256
823 (base32 "002ryjq8gj1ml5la4v6dr3bh1zw5kxwy65rpziq8d2ccccarhv59"))))
824 (build-system gnu-build-system)
825 (native-inputs (list autoconf automake))
826 (synopsis "Get date and time based on RFC 868")
827 (description
828 "@code{rdate} connects to an RFC 868 time server over a TCP/IP network,
829printing the returned time and/or setting the system clock.")
830 (home-page "https://www.aelius.com/njh/rdate/")
831 (license gpl2+))))
832
833(define-public datefudge
834 (package
835 (name "datefudge")
836 (version "1.27")
837 (source (origin
838 ;; Source code is available from
839 ;; <https://salsa.debian.org/debian/datefudge.git>. However,
840 ;; for bootstrapping reasons, we do not rely on 'git-fetch' here
841 ;; (since Git -> GnuTLS -> datefudge).
842 (method url-fetch)
843 (uri (list
844 (string-append
845 "mirror://debian/pool/main/d/datefudge/datefudge_"
846 version ".tar.xz")
847 ;; Update the Debian snapshot URL when updating the package.
848 (string-append
849 "https://snapshot.debian.org/archive/debian/"
850 "20240830T084547Z/pool/main/d/datefudge/"
851 "datefudge_1.27.tar.xz")))
852 (sha256
853 (base32
854 "0b9azg6z92s74f0rmm3hdd5l5dcldgiq5bza06mgc3ibpnlhqz0g"))))
855 (build-system gnu-build-system)
856 (arguments
857 `(#:test-target "test"
858 #:make-flags (list (string-append "CC=" ,(cc-for-target))
859 (string-append "VERSION=" ,version)
860 (string-append "prefix=" (assoc-ref %outputs "out")))
861 #:phases
862 (modify-phases %standard-phases
863 (delete 'configure))))
864 (native-inputs
865 (list perl))
866 (home-page "https://salsa.debian.org/debian/datefudge")
867 (synopsis "Pretend the system date is different")
868 (description
869 "Utility that fakes the system time by pre-loading a small library that
870modifies the @code{time}, @code{gettimeofday} and @code{clock_gettime} system
871calls.")
872 (license gpl2)))
873
874(define-public tz
875 (package
876 (name "tz")
877 (version "0.8.0")
878 (source
879 (origin
880 (method git-fetch)
881 (uri (git-reference
882 (url "https://github.com/oz/tz")
883 (commit (string-append "v" version))))
884 (file-name (git-file-name name version))
885 (sha256
886 (base32 "0pnfz88pbb5jmr1p6m53447d9r8mn9s0f6qd8dpmn0i844lfv5rs"))))
887 (build-system go-build-system)
888 (arguments
889 (list
890 #:import-path "github.com/oz/tz"
891 #:test-flags #~(list "-vet=off")))
892 (inputs
893 (list go-github-com-charmbracelet-bubbletea
894 go-github-com-mattn-go-isatty
895 go-github-com-muesli-termenv
896 go-github-com-pelletier-go-toml-v2
897 go-github-com-tkuchiki-go-timezone
898 go-golang-org-x-term
899 go-golang-org-x-tools))
900 (home-page "https://github.com/oz/tz")
901 (synopsis "TUI time zone helper")
902 (description
903 "@command{tz} helps you schedule things across time zones. It is an
904interactive TUI program that displays time across a few time zones of your
905choosing.")
906 (license gpl3+)))
907
908(define-public countdown
909 (package
910 (name "countdown")
911 (version "1.5.0")
912 (source
913 (origin
914 (method git-fetch)
915 (uri (git-reference
916 (url "https://github.com/antonmedv/countdown")
917 (commit (string-append "v" version))))
918 (file-name (git-file-name name version))
919 (sha256
920 (base32 "0snz26dvj8v58fyzd51bcf07b5yp2akcyy26w7b0pnkmlh3lknmk"))))
921 (build-system go-build-system)
922 (arguments
923 (list
924 #:import-path "github.com/antonmedv/countdown"))
925 (native-inputs
926 (list go-github-com-nsf-termbox-go))
927 (home-page "https://github.com/antonmedv/countdown")
928 (synopsis "Counts to zero with a text user interface")
929 (description
930 "Countdown provides a fancy text display while it counts down to zero
931from a starting point you provide. The user can pause and resume the
932countdown from the text user interface.")
933 (license expat)))