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