Skip to content

Commit

Permalink
Export the clojure.data.* into sci
Browse files Browse the repository at this point in the history
Providex csv, json, and xml namespaces. Also moves xml-in into xml-in.
  • Loading branch information
farcaller committed Jun 24, 2024
1 parent ece71ca commit ef4aed2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,14 @@ Currently supported threading operators for redirection:

| Library | Namespace | Alias | Example Query |
| ------- | --------- | ----- | ------- |
| `tolitius/xml-in` | `xml-in.core` | `xml` | `#\| (xml/find-all . [:universe :system :solar :planet])` |
| `tolitius/xml-in` | `xml-in.core` | `xml-in` | `#\| (xml-in/find-all . [:universe :system :solar :planet])` |
| `medley` | `medley.core` | `m` | `(m/mak-kv (fn [k v] [v k]))` |
| `com.rpl/specter` | `com.rpl.specter` | `s` | `(s/transform [MAP-VALS MAP-VALS] inc)` |
| `camel-snake-kebab` | `camel-snake-kebab.core` | `csk` | `csk/->SCREAMING_SNAKE_CASE` |
| `clojure.instant` | `clojure.instant` | `inst` | `inst/read-instant-timestamp` |
| `clojure.data.csv` | `clojure.data.csv` | `csv` | `csv/read-csv` |
| `clojure.data.json` | `clojure.data.json` | `json` | `json/read-str` |
| `clojure.data.xml` | `clojure.data.xml` | `xml` | `xml/parse-str` |


### Reader Macros
Expand Down
11 changes: 10 additions & 1 deletion src/cq/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
(require 'camel-snake-kebab.core)
(require 'xml-in.core)
(require 'clojure.instant)
(require 'clojure.data.csv)
(require 'clojure.data.json)
(require 'clojure.data.xml)

(def specter-bindings
(let [publics (ns-publics (the-ns 'com.rpl.specter))]
Expand All @@ -24,14 +27,20 @@

(def sci-ns-specs
{'xml-in.core
{:alias 'xml}
{:alias 'xml-in}
'camel-snake-kebab.core
{:alias 'csk}
'medley.core
{:alias 'm}
'com.rpl.specter
{:alias 's
:bindings-override specter-bindings}
'clojure.data.csv
{:alias 'csv}
'clojure.data.json
{:alias 'json}
'clojure.data.xml
{:alias 'xml}
'clojure.instant
{:alias 'inst}})

Expand Down

0 comments on commit ef4aed2

Please sign in to comment.