blallo

blallo

DeepDive - a debugging tool for deeply nested data structures

Hi! This is my first public elixir library. I hope someone can benefit from it, as I ceased to work with this nice language at the moment.

DeepDive

Where

Github: GitHub - blallo/deep_dive: Debug utility to explore nested data structures in elixir · GitHub
Hex.pm: deep_dive | Hex
Hexdocs.pm: DeepDive — Deep Dive v1.0.0

What

DeepDive is an extremely simple library to explore a complex and possibly unknown data structures in search of keys that sound. I developed an early stub to explore a deeply nested Absinthe.Resolution struct I needed to get hold of. It treats everything as a map and every map as a tree. It offers two different strategies to explore the tree in search for nodes (the keys) that match some pattern:

  • DeepDive.FirstFound looks for the first match on each branch and returns
  • DeepDive.FullWalk looks for each match on the whole tree

The interface is a single function, find_key/2, that wants the data structure as first argument and a matcher as second argument. A matcher may be:

  • an exact value to match
  • a regex
  • a function of kind (term -> bool)

Peek into the documentation for more info.

How

I used to put an IEx.pry() near the code I needed to examine and, from there, call the function on the data. I suggest to install the library only in the :dev mix environment.

Have fun and use the github issues to signal any problem.

Where Next?

Popular in Announcing Top

bryanjos
Hi, I just published version 0.23.0 of Elixirscript. https://github.com/bryanjos/elixirscript/blob/master/CHANGELOG.md Most of the chan...
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
ityonemo
Currently just starting out on a new mini-project - getting zig NIFs to run in elixir. https://github.com/ityonemo/zigler The idea here...
New
Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 14703 100
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
zoltanszogyenyi
Hey everyone :waving_hand: Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-s...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54006 488
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New

We're in Beta

About us Mission Statement