gnu: Add python-agate-sql.
[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 ;;;
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)
22 #:use-module (guix git-download)
23 #:use-module (guix packages)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages check)
26 #:use-module (gnu packages databases)
27 #:use-module (gnu packages python-web)
28 #:use-module (gnu packages python-xyz)
29 #:use-module (gnu packages sphinx)
30 #:use-module (gnu packages time))
31
32 ;; Base package definition for packages from https://github.com/wireservice.
33 ;; This is done so we can share how to run tests and build documentation.
34 (define base-package
35 (package
36 (name #f)
37 (version #f)
38 (source #f)
39 (home-page #f)
40 (synopsis #f)
41 (description #f)
42 (build-system python-build-system)
43 (native-inputs
44 `(("python-nose" ,python-nose)
45 ("python-sphinx" ,python-sphinx)
46 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
47 (arguments
48 `(#:phases
49 (modify-phases %standard-phases
50 (replace 'check
51 (lambda _
52 (invoke "nosetests" "tests")))
53 (add-after 'install 'install-docs
54 (lambda* (#:key outputs #:allow-other-keys)
55 (let* ((out (assoc-ref outputs "out"))
56 (doc (string-append out "/share/doc/"
57 ,(package-name this-package)
58 "-"
59 ,(package-version this-package))))
60 (with-directory-excursion "docs"
61 (for-each
62 (lambda (target)
63 (invoke "make" target)
64 (copy-recursively (string-append "_build/" target)
65 (string-append doc "/" target)))
66 '("html" "dirhtml" "singlehtml" "text")))
67 #t))))))
68 (license license:expat)))
69
70 (define-public python-leather
71 (package
72 (inherit base-package)
73 (name "python-leather")
74 (version "0.3.3")
75 (source (origin
76 (method git-fetch)
77 (uri (git-reference
78 (url "https://github.com/wireservice/leather.git")
79 (commit version)))
80 (file-name (git-file-name name version))
81 (sha256
82 (base32
83 "1ck3dplni99sv4s117cbm07ydwwjsrxkhdy19rnk0iglia1d4s5i"))))
84 (native-inputs
85 `(("python-cssselect" ,python-cssselect)
86 ("python-lxml" ,python-lxml)
87 ,@(package-native-inputs base-package)))
88 (propagated-inputs
89 `(("python-six" ,python-six)))
90 (home-page "https://leather.rtfd.org")
91 (synopsis "Python charting for 80% of humans")
92 (description "Leather is a Python charting library for those who need
93 charts now and don't care if they're perfect.")))
94
95 (define-public python-agate
96 (package
97 (inherit base-package)
98 (name "python-agate")
99 (version "1.6.1")
100 (source (origin
101 (method git-fetch)
102 (uri (git-reference
103 (url "https://github.com/wireservice/agate.git")
104 (commit version)))
105 (file-name (git-file-name name version))
106 (sha256
107 (base32
108 "077zj8xad8hsa3nqywvf7ircirmx3krxdipl8wr3dynv3l3khcpl"))))
109 (native-inputs
110 `(("python-cssselect" ,python-cssselect)
111 ("python-lxml" ,python-lxml)
112 ,@(package-native-inputs base-package)))
113 (propagated-inputs
114 `(("python-babel" ,python-babel)
115 ("python-isodate" ,python-isodate)
116 ("python-leather" ,python-leather)
117 ("python-parsedatetime" ,python-parsedatetime)
118 ("python-pytimeparse" ,python-pytimeparse)
119 ("python-six" ,python-six)
120 ("python-slugify" ,python-slugify)))
121 (home-page "https://agate.rtfd.org")
122 (synopsis "Data analysis library")
123 (description "Agate is a Python data analysis library. It is an
124 alternative to numpy and pandas that solves real-world problems with readable
125 code. Agate was previously known as journalism.")))
126
127 (define-public python-agate-sql
128 (package
129 (inherit base-package)
130 (name "python-agate-sql")
131 (version "0.5.4")
132 (source (origin
133 (method git-fetch)
134 (uri (git-reference
135 (url "https://github.com/wireservice/agate-sql.git")
136 (commit version)))
137 (file-name (git-file-name name version))
138 (sha256
139 (base32
140 "16q0b211n5b1qmhzkfl2jr56lda0rvyh5j1wzw26h2n4pm4wxlx2"))))
141 (propagated-inputs
142 `(("python-agate" ,python-agate)
143 ("python-crate" ,python-crate)
144 ("python-sqlalchemy" ,python-sqlalchemy)))
145 (home-page "https://agate-sql.rtfd.org")
146 (synopsis "SQL read/write support to agate")
147 (description "@code{agatesql} uses a monkey patching pattern to add SQL
148 support to all @code{agate.Table} instances.")))