diff --git a/pkgs/applications/science/math/readstat/default.nix b/pkgs/applications/science/math/readstat/default.nix new file mode 100644 index 000000000000..51ee824b6ff1 --- /dev/null +++ b/pkgs/applications/science/math/readstat/default.nix @@ -0,0 +1,22 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config }: + +stdenv.mkDerivation rec { + name = "readstat"; + version = "1.1.8"; + + src = fetchFromGitHub { + owner = "WizardMac"; + repo = "ReadStat"; + rev = "v${version}"; + sha256 = "1r04lq45h1yn34v1mgfiqjfzyaqv4axqlby0nkandamcsqyhc7y4"; + }; + + nativeBuildInputs = [ pkg-config autoreconfHook ]; + + meta = { + homepage = "https://github.com/WizardMac/ReadStat"; + description = "Command-line tool (+ C library) for converting SAS, Stata, and SPSS files"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ swflint ]; + }; +} diff --git a/pkgs/development/python-modules/pyreadstat/default.nix b/pkgs/development/python-modules/pyreadstat/default.nix new file mode 100644 index 000000000000..499aa97db8c7 --- /dev/null +++ b/pkgs/development/python-modules/pyreadstat/default.nix @@ -0,0 +1,34 @@ +{ lib, buildPythonPackage, fetchFromGitHub, cython, zlib, pandas, readstat }: + +buildPythonPackage rec { + pname = "pyreadstat"; + version = "1.1.9"; + + src = fetchFromGitHub { + owner = "Roche"; + repo = "pyreadstat"; + rev = "v${version}"; + sha256 = "16aa16ybh3ikmlxsg8zm19x9k6r4gpd0sxqagv318w76jjyw1nrs"; + }; + + nativeBuildInputs = [ + cython + ]; + + buildInputs = [ + zlib + ]; + + propagatedBuildInputs = [ + readstat + pandas + ]; + + meta = { + homepage = "https://github.com/Roche/pyreadstat"; + description = "Python package to read SAS, SPSS and Stata files into pandas data frames using the readstat C library"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ swflint ]; + }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 31585082d6e0..2ff38f9793ff 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10606,6 +10606,8 @@ with pkgs; read-edid = callPackage ../os-specific/linux/read-edid { }; + readstat = callPackage ../applications/science/math/readstat { }; + redir = callPackage ../tools/networking/redir { }; redmine = callPackage ../applications/version-management/redmine { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8fd467eaa441..047e0ae394dc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9556,6 +9556,8 @@ in { readme_renderer = callPackage ../development/python-modules/readme_renderer { }; + readstats = callPackage ../development/python-modules/pyreadstat { }; + readthedocs-sphinx-ext = callPackage ../development/python-modules/readthedocs-sphinx-ext { }; rebulk = callPackage ../development/python-modules/rebulk { };