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