gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / wireservice.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
3 ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages wireservice)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix build-system python)
24 #:use-module (guix download)
25 #:use-module (guix git-download)
26 #:use-module (guix packages)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages check)
29 #:use-module (gnu packages databases)
30 #:use-module (gnu packages python-web)
31 #:use-module (gnu packages python-xyz)
32 #:use-module (gnu packages sphinx)
33 #:use-module (gnu packages time)
34 #:use-module (gnu packages xml))
35
36 ;; Common package definition for packages from https://github.com/wireservice.
37 (define-syntax-rule (wireservice-package extra-fields ...)
38 (package
39 (build-system python-build-system)
40 (arguments
41 `(#:phases
42 (modify-phases %standard-phases
43 (replace 'check
44 (lambda _
45 (invoke "nosetests" "tests")))
46 (add-after 'install 'install-docs
47 (lambda* (#:key outputs #:allow-other-keys)
48 (let* ((out (assoc-ref outputs "out"))
49 (doc (string-append out "/share/doc/"
50 ,(package-name this-package)
51 "-"
52 ,(package-version this-package))))
53 (with-directory-excursion "docs"
54 (for-each
55 (lambda (target)
56 (invoke "make" target)
57 (copy-recursively (string-append "_build/" target)
58 (string-append doc "/" target)))
59 '("html" "dirhtml" "singlehtml" "text")))
60 #t))))))
61 (license license:expat)
62 extra-fields ...))
63
64 (define-public python-leather
65 (wireservice-package
66 (name "python-leather")
67 (version "0.3.3")
68 (source (origin
69 (method git-fetch)
70 (uri (git-reference
71 (url "https://github.com/wireservice/leather")
72 (commit version)))
73 (file-name (git-file-name name version))
74 (sha256
75 (base32
76 "1ck3dplni99sv4s117cbm07ydwwjsrxkhdy19rnk0iglia1d4s5i"))))
77 (native-inputs
78 `(("python-nose" ,python-nose)
79 ("python-sphinx" ,python-sphinx)
80 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
81 ("python-csselect" ,python-cssselect)
82 ("python-lxml" ,python-lxml)))
83 (propagated-inputs
84 `(("python-six" ,python-six)))
85 (home-page "https://leather.rtfd.org")
86 (synopsis "Python charting for 80% of humans")
87 (description "Leather is a Python charting library for those who need
88 charts now and don't care if they're perfect.")))
89
90 (define-public python-agate
91 (wireservice-package
92 (name "python-agate")
93 (version "1.6.1")
94 (source (origin
95 (method git-fetch)
96 (uri (git-reference
97 (url "https://github.com/wireservice/agate")
98 (commit version)))
99 (file-name (git-file-name name version))
100 (sha256
101 (base32
102 "077zj8xad8hsa3nqywvf7ircirmx3krxdipl8wr3dynv3l3khcpl"))))
103 (native-inputs
104 `(("python-nose" ,python-nose)
105 ("python-sphinx" ,python-sphinx)
106 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
107 ("python-csselect" ,python-cssselect)
108 ("python-lxml" ,python-lxml)))
109 (propagated-inputs
110 `(("python-babel" ,python-babel)
111 ("python-isodate" ,python-isodate)
112 ("python-leather" ,python-leather)
113 ("python-parsedatetime" ,python-parsedatetime)
114 ("python-pytimeparse" ,python-pytimeparse)
115 ("python-six" ,python-six)
116 ("python-slugify" ,python-slugify)))
117 (home-page "https://agate.rtfd.org")
118 (synopsis "Data analysis library")
119 (description "Agate is a Python data analysis library. It is an
120 alternative to numpy and pandas that solves real-world problems with readable
121 code. Agate was previously known as journalism.")))
122
123 (define-public python-agate-sql
124 (wireservice-package
125 (name "python-agate-sql")
126 (version "0.5.4")
127 (source (origin
128 (method git-fetch)
129 (uri (git-reference
130 (url "https://github.com/wireservice/agate-sql")
131 (commit version)))
132 (file-name (git-file-name name version))
133 (sha256
134 (base32
135 "16q0b211n5b1qmhzkfl2jr56lda0rvyh5j1wzw26h2n4pm4wxlx2"))))
136 (native-inputs
137 `(("python-nose" ,python-nose)
138 ("python-sphinx" ,python-sphinx)
139 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
140 (propagated-inputs
141 `(("python-agate" ,python-agate)
142 ("python-crate" ,python-crate)
143 ("python-sqlalchemy" ,python-sqlalchemy)))
144 (home-page "https://agate-sql.rtfd.org")
145 (synopsis "SQL read/write support to agate")
146 (description "@code{agatesql} uses a monkey patching pattern to add SQL
147 support to all @code{agate.Table} instances.")))
148
149 (define-public python-agate-dbf
150 (wireservice-package
151 (name "python-agate-dbf")
152 (version "0.2.1")
153 (source (origin
154 (method git-fetch)
155 (uri (git-reference
156 (url "https://github.com/wireservice/agate-dbf")
157 (commit version)))
158 (file-name (git-file-name name version))
159 (sha256
160 (base32
161 "1y49fi6pmm7gzhajvqmfpcca2sqnwj24fqnsvzwk7r1hg2iaa2gi"))))
162 (native-inputs
163 `(("python-nose" ,python-nose)
164 ("python-sphinx" ,python-sphinx)
165 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
166 (propagated-inputs
167 `(("python-agate" ,python-agate)
168 ("python-dbfread" ,python-dbfread)))
169 (home-page "https://agate-dbf.rtfd.org")
170 (synopsis "Add read support for dbf files to agate")
171 (description "@code{agatedbf} uses a monkey patching pattern to add read
172 for dbf files support to all @code{agate.Table} instances.")))
173
174 (define-public python-agate-excel
175 (wireservice-package
176 (name "python-agate-excel")
177 (version "0.2.3")
178 (source (origin
179 (method git-fetch)
180 (uri (git-reference
181 (url "https://github.com/wireservice/agate-excel")
182 (commit version)))
183 (file-name (git-file-name name version))
184 (sha256
185 (base32
186 "1k5lv21k19s7kgbj5srd1xgrkqvxqqs49qwj33zncs9l7851afy7"))))
187 (native-inputs
188 `(("python-nose" ,python-nose)
189 ("python-sphinx" ,python-sphinx)
190 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
191 (propagated-inputs
192 `(("python-agate" ,python-agate)
193 ("python-openpyxl" ,python-openpyxl)
194 ("python-xlrd" ,python-xlrd)))
195 (home-page "https://agate-excel.rtfd.org")
196 (synopsis "Add read support for Excel files (xls and xlsx) to agate")
197 (description "@code{agateexcel} uses a monkey patching pattern to add read
198 for xls and xlsx files support to all @code{agate.Table} instances.")))
199
200 (define-public csvkit
201 (package
202 (name "csvkit")
203 (version "1.0.5")
204 (source (origin
205 (method url-fetch)
206 (uri (pypi-uri "csvkit" version))
207 (sha256
208 (base32
209 "1ffmbzk4rxnl1yhqfl58v7kvl5m9cbvjm8v7xp4mvr00sgs91lvv"))))
210 (build-system python-build-system)
211 (native-inputs
212 `(("python-psycopg2" ,python-psycopg2) ; to test PostgreSQL support
213 ("python-sphinx" ,python-sphinx)
214 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
215 (inputs
216 `(("python-agate-dbf" ,python-agate-dbf)
217 ("python-agate-excel" ,python-agate-excel)
218 ("python-agate-sql" ,python-agate-sql)
219 ("python-six" ,python-six)
220 ("python-text-unidecode" ,python-text-unidecode)))
221 (arguments
222 `(#:phases
223 (modify-phases %standard-phases
224 (add-after 'install 'install-docs
225 (lambda* (#:key outputs #:allow-other-keys)
226 (let* ((out (assoc-ref outputs "out"))
227 (man1 (string-append out "/share/man/man1")))
228 (with-directory-excursion "docs"
229 (invoke "make" "man")
230 (copy-recursively "_build/man" man1))
231 #t))))))
232 (home-page "https://csvkit.rtfd.org")
233 (synopsis "Command-line tools for working with CSV")
234 (description "csvkit is a suite of command-line tools for converting to
235 and working with CSV. It provides the following commands:
236 @itemize
237 @item Input:
238 @itemize
239 @item @command{in2csv}: Convert various formats to CSV.
240 @item @command{sql2csv}: Execute SQL commands on a database and return the
241 data as CSV.
242 @end itemize
243 @item Processing:
244 @itemize
245 @item @command{csvclean}: Remove common syntax errors.
246 @item @command{csvcut}: Filter and truncate CSV files.
247 @item @command{csvgrep}: Filter tabular data to only those rows where
248 certain columns contain a given value or match a regular expression.
249 @item @command{csvjoin}: Merges two or more CSV tables together using a
250 method analogous to SQL JOIN operation.
251 @item @command{csvsort}: Sort CSV files.
252 @item @command{csvstack}: Stack up the rows from multiple CSV files,
253 optionally adding a grouping value to each row.
254 @end itemize
255 @item Output and analysis:
256 @itemize
257 @item @command{csvformat}: Convert a CSV file to a custom output format.
258 @item @command{csvjson}: Converts a CSV file into JSON or GeoJSON.
259 @item @command{csvlook}: Renders a CSV to the command line in a
260 Markdown-compatible, fixed-width format.
261 @item @command{csvpy}: Loads a CSV file into a @code{agate.csv.Reader}
262 object and then drops into a Python shell so the user can inspect the data
263 however they see fit.
264 @item @command{csvsql}: Generate SQL statements for a CSV file or execute
265 those statements directly on a database.
266 @item @command{csvstat}: Prints descriptive statistics for all columns in a
267 CSV file.
268 @end itemize
269 @end itemize")
270 (license license:expat)))