Fork me on GitHub
#announcements
<
2022-01-21
>
Teemu Kaukoranta08:01:12

After three years, a new release of ring-logger is here šŸ˜„ ā€¢ Version 1.1.1 adds support for async ring handlers ā€¢ Adds :status-to-level-fn, which allows you to control the logging level of HTTP status codes in wrap-log-response ā€¢ Updates org.clojure/tools.logging dependency to version 1.2.3 https://github.com/nberger/ring-logger

šŸ„³ 14
wilkerlucio13:01:14

Pathom Viz 2022.1.21 is out! This release adds a long waited support for setting custom headers when setting up a connection via URL! It will also keep a record of the latest connections so you can reconnect with ease. Check it out at https://github.com/wilkerlucio/pathom-viz/releases/tag/v2022.1.21!

šŸŽ‰ 16
gratitude 4
markw16:01:57

I have just released a new update for cq (Clojure Query) - version 2022.01.21-16.20.00 , which adds XML support - and this is also my first time posting it on the Clojurians Slack. cq is a Command-line Data Processor for EDN, YAML, JSON, XML and other data formats. Essentially, it brings the joy of Clojure's threading macros to the command line. It is inspired by jq and jet but aims to provide a bit more support for transforming deeply nested data structures. https://github.com/markus-wa/cq

šŸŽ‰ 18
borkdude16:01:52

@U0244CZ9LAF Awesome. I'll add you to the list of SCI projects here https://github.com/babashka/sci

šŸ™Œ 1
markw16:01:04

ahh thanks! šŸ˜„ - yeah sci is such an amazing project, thanks a lot for building/maintaining it ā¤ļø - it really does all of the heavy lifting for cq! šŸ™‚

borkdude17:01:46

$ echo '[1 2 3]' | ./cq -i edn -- '->> (s/transform [s/ALL] inc)'
[2 3 4]

borkdude17:01:48

it works :)

markw17:01:46

šŸ„³ - note that thread-last is actually the default šŸ™‚ - so echo '[1 2 3]' | ./cq -i edn -- '(s/transform [s/ALL] inc)' works as well!

borkdude17:01:31

@U0244CZ9LAF Is there a way I can just evaluate regular clojure without a threading macro? like

echo '[1 2 3]' | ./cq -i edn -- "(require '[com.rpl.specter :refer :all]) ..."

Ivan17:01:57

I guess the -i input format matches the output. It would be interesting to have a -o option to define the output separately. So, read in a structure in the defined format, process it, and output as a potentially different format.

markw17:01:11

in theory you can do

echo '[1 2 3]' | ./cq -i edn -- "#| (do (require '[com.rpl.specter :refer :all]) (identity .))"
but that gives Could not find namespace com.rpl.specter

Ivan17:01:43

I'm thinking of borkdude's question as whether it is possible to extend the operations possible on the data

markw17:01:45

@U8ZE1VBSS actually the output always defaults to edn - I use it often to just convert from JSON to EDN by doing cat file | cq

markw17:01:14

you can define vars & functions like this - there might be a way to make this a bit nicer, but so far I haven't done this myself so I'm just thinking about it now

echo '[1 2 3]' | cq -i edn -- "#| (do (def x identity) (x .))"
if you have suggestions on what would be a good syntax let me know and I can try to see if we can make that work šŸ˜„

markw17:01:04

@U04V15CAJ if I do {:namespaces {'s {...}}} in sci - I should be able to then (require '[s :refer :all]) - no? (currently getting Could not find namespace s) If I can figure that out then it should be possible to do what you're looking for šŸ™‚

borkdude18:01:21

I'll be back in 30 minutes to explain :)

borkdude18:01:53

@U0244CZ9LAF So, this works:

echo '[1 2 3]' | ./cq -i edn -- "#| (do (require '[s :refer :all]) (ns-publics 's))"

borkdude18:01:35

but it might be better to add the namespace com.rpl.specter and alias that as s in the user namespace

borkdude18:01:05

There is also an :aliases {'s 'com.rpl.specter} option

markw18:01:21

ahh, amazing! thanks for elaborating šŸ™‚ - I will try to make the required changes early next week! I'm thinking I'll go with the aliases approach

markw15:01:08

^ I've implemented the aliases solution now, thanks for the hint!

jlmr18:02:27

Really enjoying cq so far, thanks for making this!

ā¤ļø 1
markw12:02:35

glad to hear! @U56R03VNW šŸ™‚

hlship19:01:26

io.github.hlship/test-pipeline. 0.1 test-pipeline is a small (very small!) library that can be used to improve your Clojure test suite, by breaking test code into composable, reusable steps. https://github.com/hlship/test-pipeline

šŸ‘€ 5
Carsten Behring20:01:06

pppmap 1.0 was released It is a small library which adds progress logging and partitions to map and pmap In 1.0.0 the logging happens via tap> now https://clojars.org/pppmap/versions/1.0.0

šŸ’„ 5