aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/statistics.scm
diff options
context:
space:
mode:
authorTroy Figiel <troy@troyfigiel.com>2024-01-07 17:40:35 +0100
committerMathieu Othacehe <othacehe@gnu.org>2024-01-09 10:19:43 +0100
commit185ebc01f6122e0312202e53a5cf2dfaa85d6672 (patch)
treec46ca0a90f7bf38c2ea5b25aa964cb63164a75d5 /gnu/packages/statistics.scm
parent76470d47c56c2abc67e9a5dc20acd67f0426fd02 (diff)
downloadguix-185ebc01f6122e0312202e53a5cf2dfaa85d6672.tar.gz
guix-185ebc01f6122e0312202e53a5cf2dfaa85d6672.zip
gnu: Add python-pyreadstat.
* gnu/packages/patches/python-pyreadstat-link-libiconv.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/statistics.scm (python-pyreadstat): New variable. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Change-Id: I361df91487412e4bfd26fb728a6999752e6343e5
Diffstat (limited to 'gnu/packages/statistics.scm')
-rw-r--r--gnu/packages/statistics.scm45
1 files changed, 45 insertions, 0 deletions
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 712b1a9c37..906ec456b6 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -18,6 +18,7 @@
;;; Copyright © 2021 Frank Pursel <frank.pursel@gmail.com>
;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
+;;; Copyright © 2023 Troy Figiel <troy@troyfigiel.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -6919,6 +6920,50 @@ files, including Rmarkdown files.")
popular stats packages like SAS, Stata and SPSS.")
(license license:expat)))
+(define-public python-pyreadstat
+ (package
+ (name "python-pyreadstat")
+ (version "1.2.4")
+ ;; No tests in the PyPI tarball.
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Roche/pyreadstat")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0zysrzixvqw2lwwykxqg5yj8a0zyv5s2bmk22x30f4rj2hgvq1pv"))
+ (patches (search-patches "python-pyreadstat-link-libiconv.patch"))))
+ (arguments
+ '(#:phases (modify-phases %standard-phases
+ (add-before 'check 'change-home-dir
+ (lambda _
+ ;; test_sav_expand and test_sav_write_basic_expanduser need a
+ ;; home directory with write permissions.
+ (setenv "HOME" "/tmp")))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ ;; The source also contains tests/test_version.py
+ ;; which checks the version in __init__.py against the
+ ;; one in setup.py. Since this requires texlive
+ ;; dependencies to run and is also not mentioned in
+ ;; how_to_test.md, this test is skipped.
+ (invoke "python" "tests/test_basic.py")))))))
+ (build-system python-build-system)
+ (propagated-inputs (list python-pandas))
+ (inputs (list libiconv zlib))
+ (native-inputs (list python-cython-3))
+ (home-page "https://github.com/Roche/pyreadstat")
+ (synopsis
+ "Read and write SAS, SPSS and Stata files into/from Pandas DataFrames")
+ (description
+ "This Python package can be used to read and write SAS, SPSS and Stata
+files into/from Pandas DataFrames. It is a wrapper around the C library
+@code{readstat}.")
+ (license license:asl2.0)))
+
(define-public r-quantpsyc
(package
(name "r-quantpsyc")