changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/dat/pkg.lisp

changeset 604: 74a55d5decce
parent: 5bd0eb9fa1fa
child: 35a579313b80
author: Richard Westhaver <ellis@rwest.io>
date: Sat, 17 Aug 2024 23:42:08 -0400
permissions: -rw-r--r--
description: emacs org libraries and upgrades
1 ;;; dat/pkg.lisp --- Data
2 
3 ;;; Code:
4 (defpackage :dat/proto
5  (:use :cl :std)
6  (:export :serialize :deserialize
7  :serializer-error :deserializer-error
8  :serde :serde-error :dat-error))
9 
10 (defpackage :dat/sxp
11  (:nicknames :sxp)
12  (:use :cl :sb-mop :std)
13  (:import-from :uiop :read-file-forms :slurp-stream-forms :with-output-file)
14  ;; TODO: hot-patch readtables into sxp classes/parsers
15  (:import-from :std/named-readtables :defreadtable :in-readtable)
16  (:export
17  :sxp-fmt-designator
18  :form :formp :sxp-error :sxp-syntax-error :reader :writer :fmt
19  :wrap :unwrap
20  :unwrap-or
21  :sxpp :build-ast :load-ast :load-ast*
22  :ast
23  :define-macro :define-fmt :read-sxp-file :write-sxp-file
24  :read-sxp-string :write-sxp-string :read-sxp-stream :write-sxp-stream
25  :make-sxp :sxp :formp :form
26  :file-read-forms
27  :wrap-object :unwrap-object))
28 
29 (defpackage :dat/dot
30  (:use :cl :std :dat/proto :obj/graph)
31  (:export
32  :read-dot-file :write-dot-file
33  :read-dot-stream :write-dot-stream
34  :parse-dot-string))
35 
36 (defpackage :dat/csv
37  (:use :cl :std :dat/proto :obj/query)
38  (:export
39  :read-csv-file
40  :*csv-separator*
41  #:read-csv-stream
42  :write-csv-file
43  :write-csv-stream
44  :read-csv-file-and-sort
45  :parse-csv-string
46  #:write-csv-string))
47 
48 (defpackage :dat/toml
49  (:use :cl :std :dat/proto :obj/time)
50  (:export
51  #:parse
52  #:parse-toml-blocks
53  #:toml-collection
54  #:children
55  #:toml-table
56  #:inline-toml-table
57  #:toml-table-array
58  #:toml-redefine-table-error
59  #:toml-redefine-property-error
60  #:toml-modify-inline-table-error
61  #:toml-dotted-key-redefine-table-error
62  #:toml-dotted-key-open-table-array-error))
63 
64 (defpackage :dat/arff
65  (:use :cl :std :dat/proto :dat/csv)
66  (:export
67  :arff :arff-relation :arff-attributes :arff-data :arff-path
68  :parse-arff :parse-arff-string :parse-arff-stream
69  :remove-attribute-by-name))
70 
71 (defpackage :dat/json
72  (:use :cl :std :dat/proto)
73  (:export
74  :*allow-json-trailing-commas*
75  :json-trailing-commas-p
76  #:json-decode
77  #:json-encode
78  #:json-read
79  #:json-enable-reader-macro
80  #:json-object
81  #:json-object-members
82  #:json-getf
83  #:json-setf))
84 
85 (defpackage :dat/base64
86  (:use :cl :std :dat/proto)
87  (:export #:base64-stream-to-integer
88  #:base64-stream-to-string
89  #:base64-stream-to-stream
90  #:base64-stream-to-usb8-array
91  #:base64-string-to-integer
92  #:base64-string-to-string
93  #:base64-string-to-stream
94  #:base64-string-to-usb8-array
95  #:string-to-base64-string
96  #:string-to-base64-stream
97  #:usb8-array-to-base64-string
98  #:usb8-array-to-base64-stream
99  #:stream-to-base64-string
100  #:stream-to-base64-stream
101  #:integer-to-base64-string
102  #:integer-to-base64-stream
103  ;; Conditions.
104  #:base64-error
105  #:bad-base64-character
106  #:incomplete-base64-data
107  ;; For creating custom encode/decode tables.
108  #:make-decode-table
109  #:+decode-table+
110  #:+uri-decode-table+))
111 
112 (defpackage :dat/html
113  (:use :cl :std :dat/proto)
114  (:import-from :sb-ext :defglobal)
115  (:export
116  :parse-html5
117  :parse-html5-fragment
118  :transform-html5-dom
119  :xml-escape-name
120  :xml-unescape-name
121  ;; A simple DOM
122  :make-document
123  :make-fragment
124  :make-doctype
125  :make-comment
126  :make-element
127  :make-text-node
128  :node-type
129  :node-name
130  :node-namespace
131  :node-value
132  :node-public-id
133  :node-system-id
134  :element-attribute
135  :node-append-child
136  :node-insert-before
137  :node-remove-child
138  :node-parent
139  :node-first-child
140  :node-last-child
141  :node-previous-sibling
142  :node-next-sibling
143  :element-map-attributes
144  :element-map-attributes*
145  :element-map-children))
146 
147 (defpackage :dat/xml
148  (:use :cl :std :dat/proto :log)
149  (:shadow :read-char :unread-char)
150  (:export
151  :xml-node-name
152  :xml-node-ns
153  :xml-node-attrs
154  :xml-node-children
155  :make-xml-node
156  :xml-parse
157  :to-xml
158  :write-xml
159  :xml-node-p
160  :xml-node ; needed to support use in typep
161  ;; processing instruction objects
162  :proc-inst-p
163  :proc-inst-target
164  :proc-inst-contents
165  :write-prologue
166  :write-prolog
167  ;; rpg utils
168  :make-xmlrep :xmlrep-add-child!
169  :xmlrep-tag :xmlrep-tagmatch
170  :xmlrep-attribs :xmlrep-children
171  :xmlrep-string-child :xmlrep-integer-child
172  :xmlrep-find-child-tags :xmlrep-find-child-tag
173  :xmlrep-attrib-value :xmlrep-boolean-attrib-value
174  ;; tree searching from Daniel Eliason
175  :extract-path-list
176  :extract-path))
177 
178 (defpackage :dat/handlebars
179  (:use :cl :std :dat/proto :dat/html)
180  (:export))
181 
182 (defpackage :dat/mime
183  (:use :cl :std :dat/proto :dat/xml)
184  (:export :*mime-database*
185  :load-mime-info :update-mime-database
186  :mime-magic :mime-magic-offset :mime-magic-type :mime-magic-value
187  :mime-type :mime-type-name :mime-type-superclasses :mime-type-glob
188  :mime-type-glob :mime-type-magic
189  :mime :get-mime :get-mime*))
190 
191 (defpackage :dat/bencode
192  (:use :cl :std :dat/proto :sb-gray)
193  (:export
194  :bencode-encode
195  :bencode-decode
196  :*bencode-binary-key-p*))
197 
198 (defpackage :dat/midi
199  (:nicknames :midi)
200  (:use :cl :std :dat/proto)
201  (:export #:read-midi-file #:write-midi-file
202  #:midifile
203  #:midifile-format #:midifile-tracks #:midifile-division
204  #:message #:note-off-message #:note-on-message #:tempo-message
205  #:program-change-message #:pitch-bend-message
206  #:key-signature-message #:time-signature-message
207  #:smpte-offset-message
208  #:sequence/track-name-message
209  #:message-channel #:message-key #:message-time
210  #:message-velocity #:message-numerator #:message-denominator
211  #:message-sf #:message-mi #:message-tempo #:message-program
212  #:message-value
213  #:header #:header-type
214  #:unknown-event #:status #:data-byte #:dd #:bb #:cc #:nn))
215 
216 (defpackage :dat/qrcode
217  (:nicknames :qrcode)
218  (:use :cl :std :dat/proto)
219  (:export
220  :encode-symbol
221  ;; QR code representation
222  ;; this should be enough to write another backend for QR symbol
223  :qr-symbol
224  :matrix
225  :modules
226  :dark-module-p
227  :read-file-content))
228 
229 (defpackage :dat/gif
230  (:nicknames :gif)
231  (:use :cl :std :dat/proto)
232  (:export))
233 
234 (defpackage :dat/png
235  (:use :cl :std :dat/proto #+png :png)
236  (:export))
237 
238 (defpackage :dat/tar
239  (:use :cl :std :dat/proto)
240  (:export))
241 
242 (defpackage :dat/parquet
243  (:use :cl :std :obj/id :dat/proto :dat/json)
244  (:export
245  :parquet-object
246  :parquet-enum-object
247  :parquet-struct-object
248  :parquet-read
249  :parquet-write
250  :parquet-encode
251  :parquet-decode))
252 
253 (pkg:defpkg :dat
254  (:use-reexport :dat/proto :dat/csv :dat/arff
255  :dat/toml :dat/json :dat/sxp :dat/xml
256  :dat/bencode :dat/qrcode))