2021-04-17 13:10:26 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2021-09-28 01:46:37 +01:00
|
|
|
, cchardet
|
2021-04-17 13:10:26 +01:00
|
|
|
, chardet
|
|
|
|
, cleo
|
|
|
|
, clikit
|
|
|
|
, pandas
|
|
|
|
, regex
|
|
|
|
, tabview
|
|
|
|
, python
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "clevercsv";
|
2021-09-28 01:46:37 +01:00
|
|
|
version = "0.7.1";
|
2021-04-17 13:10:26 +01:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alan-turing-institute";
|
|
|
|
repo = "CleverCSV";
|
|
|
|
rev = "v${version}";
|
2021-09-28 01:46:37 +01:00
|
|
|
sha256 = "sha256-ynS3G2ZcEqVlC2d6n5ZQ1Em5lh/dWESj9jEO8C4WzZQ=";
|
2021-04-17 13:10:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-09-28 01:46:37 +01:00
|
|
|
cchardet
|
2021-04-17 13:10:26 +01:00
|
|
|
chardet
|
|
|
|
cleo
|
|
|
|
clikit
|
|
|
|
pandas
|
|
|
|
regex
|
|
|
|
tabview
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"clevercsv"
|
|
|
|
"clevercsv.cparser"
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
# by linking the installed version the tests also have access to compiled native libraries
|
|
|
|
rm -r clevercsv
|
|
|
|
ln -s $out/${python.sitePackages}/clevercsv/ clevercsv
|
|
|
|
# their ci only runs unit tests, there are also integration and fuzzing tests
|
|
|
|
${python.interpreter} -m unittest discover -v -f -s ./tests/test_unit
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "CleverCSV is a Python package for handling messy CSV files";
|
|
|
|
longDescription = ''
|
|
|
|
CleverCSV is a Python package for handling messy CSV files. It provides
|
|
|
|
a drop-in replacement for the builtin CSV module with improved dialect
|
|
|
|
detection, and comes with a handy command line application for working
|
|
|
|
with CSV files.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/alan-turing-institute/CleverCSV";
|
|
|
|
changelog = "https://github.com/alan-turing-institute/CleverCSV/blob/master/CHANGELOG.md";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|