CUE utilities and helpers for working with tree based objects in any combination of CUE, Yaml, and JSON.

Related tags

Utilities cuetils
Overview

Cuetils

CUE utilities and helpers for working with tree based objects in any combination of CUE, Yaml, and JSON.

Using

As a command line binary

The cuetils CLI is useful for bulk operations or when you don't want to write extra CUE or Go.

Download a release from GitHub.

cuetils -h

As a Go library

The Go libraries are optimized and have more capabilities.*

go get github.com/hofstadter-io/[email protected]
import "github.com/hofstadter-io/cuetils/structural"

* work in progress, unoptimized use the CUE helper and RecurseN

As a CUE library

The CUE libraries all use the RecurseN helper and make use of the "function" pattern. You can also write custom operators.

Add to your project with hof mod or another method. See: https://cuetorials.com/first-steps/modules-and-packages/#dependency-management

import "github.com/hofstadter-io/cuetils/structural"

Structural Helpers

  • Count the nodes in an object
  • Depth how deep an object is
  • Diff two objects, producing a structured diff
  • Patch an object, producing a new object
  • Pick a subojbect from another, selecting only the parts you want
  • Maks a subobject from another, filtering out parts you don't want
  • Replace with a subobject, updating fields found
  • Upsert with a subobject, updating and adding fields
  • Transform one or more objects into another using CUE
  • Validate one or more objects with the power of CUE

The helpers work by checking if two operands unify. We try to make note of the edge cases where appropriate, as it depends on both the operation and the method you are using (CUE, Go, or cuetils).

Count

#Count calculates how many nodes are in an object.

CLI example
a: {
	foo: "bar"
	a: b: c: "d"
}
cow: "moo"
$ cuetils count tree.cue
9
CUE example
import "github.com/hofstadter-io/cuetils/structural"

tree: {
	a: {
		foo: "bar"
		a: b: c: "d"
	}
	cow: "moo"
}

depth: (structural.#Count & { #in: tree }).out
depth: 9
Go example

Depth

#Depth calculates the deepest branch of an object.

CLI example
a: {
	foo: "bar"
	a: b: c: "d"
}
cow: "moo"
$ cuetils depth tree.cue
5
CUE example
import "github.com/hofstadter-io/cuetils/structural"

tree: {
	a: {
		foo: "bar"
		a: b: c: "d"
	}
	cow: "moo"
}

depth: (structural.#Depth & { #in: tree }).out
depth: 5
Go example
import "github.com/hofstadter-io/cuetils/structural"

Diff

#Diff computes a semantic diff object

CLI example
-- a.json --
{
	"a": {
		"b": "B"
	}
}
-- b.yaml --
a:
  c: C
b: B
$ cuetils diff a.json b.yaml
{
	"+": {
		b: "B"
	}
	a: {
		"-": {
			b: "B"
		}
		"+": {
			c: "C"
		}
	}
}
CUE example
import "github.com/hofstadter-io/cuetils/structural"

x: {
	a: "a"
	b: "b"
	d: "d"
	e: {
		a: "a"
		b: "b"
		d: "d"
	}
}

y: {
	b: "b"
	c: "c"
	d: "D"
	e:  {
		b: "b"
		c: "c"
		d: 1
	}
}

diff: (structural.#Diff & { #X: x, #Y: y }).diff
diff: {
	"-": {
		a: "a"
		d: "d"
	}
	e: {
		"-": {
			a: "a"
			d: "d"
		}
		"+": {
			d: 1
			c: "c"
		}
	}
	"+": {
		d: "D"
		c: "c"
	}
}
Go example
import "github.com/hofstadter-io/cuetils/structural"

For diff and patch, int & 1 like expressions will not be detected. Lists are not currently supported for diff and patch. It may be workable if the list sizes are known and order consistent. Associative Lists may solve this issue. We don't currently have good syntax for specifying the key to match elements on.

Patch

#Patch applies a diff object

CLI example
-- patch.json --
{
  "+": {
    b: "B"
  }
  a: {
    "-": {
      b: "B"
    }
    "+": {
      c: "C"
    }
  }
}
-- a.json --
{
	"a": {
		"b": "B"
	}
}
$ cuetils patch patch.json a.json
{
	b: "B"
	a: {
		c: "C"
	}
}
CUE example
import "github.com/hofstadter-io/cuetils/structural"

x: {
	a: "a"
	b: "b"
	d: "d"
	e: {
		a: "a"
		b: "b"
		d: "d"
	}
}

p: {
	"-": {
		a: "a"
		d: "d"
	}
	e: {
		"-": {
			a: "a"
			d: "d"
		}
		"+": {
			d: 1
			c: "c"
		}
	}
	"+": {
		d: "D"
		c: "c"
	}
}

patch: (structural.#Patch & { #X: x, #Y: y }).patch
patch: {
	b: "b"
	c: "c"
	d: "D"
	e:  {
		b: "b"
		c: "c"
		d: 1
	}
}
Go example
import "github.com/hofstadter-io/cuetils/structural"

Pick

#Pick extracts a subobject

CLI example
-- pick.cue --
{
	a: {
		b: string
	}
	c: int
	d: "D"
}
-- a.json --
{
	"a": {
		"b": "B"
	},
	"b": 1,
	"c": 2,
	"d": "D"
}
$ cuetils pick pick.cue a.json
{
	a: {
		b: "B"
	}
	c: 2
	d: "D"
}
CUE example
import "github.com/hofstadter-io/cuetils/structural"

x: {
	a: "a"
	b: "b"
	d: "d"
	e: {
		a: "a"
		b: "b1"
		d: "cd"
	}
}
p: {
	b: string
	d: int
	e: {
		a: _
		b: =~"^b"
		d: =~"^d"
	}
}
pick: (structural.#Pick & { #X: x, #P: p }).pick
pick: {
	b: "b"
	e:  {
		a: "a"
		b: "b1"
	}
}
Go example
import "github.com/hofstadter-io/cuetils/structural"

Mask

#Mask removes a subobject

CLI example
-- mask.cue --
{
	a: {
		b: string
	}
	c: int
	d: "D"
}
-- a.json --
{
	"a": {
		"b": "B"
		"c": "C"
	},
	"b": 1,
	"c": 2,
	"d": "D"
}
$ cuetils mask mask.cue a.json
{
	a: {
		c: "C"
	}
	b: 1
}
CUE example
import "github.com/hofstadter-io/cuetils/structural"

x: {
	a: "a"
	b: "b"
	d: "d"
	e: {
		a: "a"
		b: "b1"
		d: "cd"
	}
}
m: {
	b: string
	d: int
	e: {
		a: _
		b: =~"^b"
		d: =~"^d"
	}
}
mask: (structural.#Mask & { #X: x, #M: m }).mask
mask: {
	a: "a"
	d: "d"
	e:  {
		d: "cd"
	}
}
Go example
import "github.com/hofstadter-io/cuetils/structural"

Replace

CLI example
-- replace.cue --
{
	a: {
		b: "b"
	}
	d: "d"
	e: "E"
}
-- a.json --
{
	"a": {
		"b": "B"
	},
	"b": 1,
	"c": 2,
	"d": "D"
}
$ cuetils replace replace.cue a.json
{
	b: 1
	c: 2
	a: {
		b: "b"
	}
	d: "d"
}
CUE example
import "github.com/hofstadter-io/cuetils/structural"
Go example
import "github.com/hofstadter-io/cuetils/structural"

Upsert

CLI example
-- upsert.cue --
{
	a: {
		b: "b"
	}
	d: "d"
	e: "E"
}
-- a.json --
{
	"a": {
		"b": "B"
	},
	"b": 1,
	"d": "D"
}
$ cuetils upsert upsert.cue a.json
{
	b: 1
	a: {
		b: "b"
	}
	d: "d"
	e: "E"
}
CUE example
import "github.com/hofstadter-io/cuetils/structural"
Go example
import "github.com/hofstadter-io/cuetils/structural"

Transform

CLI example
-- t.cue --
#In: _        // required, filled in during processing
{
	B: #In.a.b
	C: #In.a.c
	D: #In.d
}

-- a.json --
{
	"a": {
		"b": "b"
		"c": "c"
	}
	"d": "d"
}
$ cuetils transform t.cue a.json
{
	B: "b"
	C: "c"
	D: "d"
}
Go example
import "github.com/hofstadter-io/cuetils/structural"

Validate

CLI example
-- schema.cue --
{
	a: {
		b: int
	}
	c: int
	d: "D"
}
-- a.json --
{
	"a": {
		"b": "B"
	},
	"b": 1,
	"c": 2,
	"d": "D"
}
$ cuetils validate schema.cue a.json
a.json
----------------------
a.b: conflicting values "B" and int (mismatched types string and int):
    ./schema.cue:1:1
    ./schema.cue:3:6
    a.json:3:8


Errors in 1 file(s)
Go example
import "github.com/hofstadter-io/cuetils/structural"

RecurseN

A function factory for bounded recursion, defaulting to 20. This is a pattern to get around CUE's cycle detection by creating a struct with fields named for each iteration. See https://cuetorials.com/deep-dives/recursion/ for more details.

#RecurseN: {
	#maxiter: uint | *20
	#funcFactory: {
		#next: _
		#func: _
	}

	for k, v in list.Range(0, #maxiter, 1) {
		#funcs: "\(k)": (#funcFactory & {#next: #funcs["\(k+1)"]}).#func
	}
	#funcs: "\(#maxiter)": null

	#funcs["0"]
}

The core of the bounded recursion is this structural comprehension (unrolled for loop). The "recursive call" is made with the following pattern.

(#funcFactory & {#next: #funcs["\(k+1)"]}).#func

You can override the iterations with { #maxdepth: 100 } at the point of usage or by creating new helpers from the existing ones. You may need to adjust this

  • up for deep objects
  • down if runtime is an issue
import "github.com/hofstadter-io/cuetils/structural"

#LeaguesDeep: structural.#Depth & { #maxdepth: 10000 }

Custom Helpers

You can make new helpers by building on the #RecurseN pattern. You need two definitions, a factory and the user facing, recursed version.

package structural

import (
	"list"

	"github.com/hofstadter-io/cuetils/recurse"
)

// A function factory
#depthF: {
	// always required
	#next: _
	
	// the actual computation, must be named #func
	#func: {
		// you can have any args
		#in: _
		// or internal helpers
		#multi: {...} | [...]
		
		// the result, can be named anything
    depth: {
			// detect leafs
			if (#in & #multi) == _|_ { 1 }
			// detect struct
			if (#in & {...}) != _|_ {
				list.Max([for k,v in #in {(#next & {#in: v}).depth}]) + 1
			}
			// detect list
			if (#in & [...]) != _|_ {
				list.Max([for k,v in #in {(#next & {#in: v}).depth}])
			}
    }
	}
}

// The user facing, recursed version
#Depth: recurse.#RecurseN & {#funcFactory: #depthF}

The core of the recursive calling is:

(#next & {#in: v}).depth
Comments
  • feature/pipeline

    feature/pipeline

    • implements the pipeline command and library
    • based on cue/flow DAG engine, tasks found by attributes
      • [x] @pipeline(name,[tags]) and @task([task/type],[tags])
    • supports many ops
      • [x] cuetils/structural
      • [x] @log (named @print currently)
      • [x] cue/tools/...
      • [x] api requests
      • [x] api server (?)
      • [x] db conn / call
      • [ ] background commands (bg, fg, kill)

    questions:

    • how to compose pipelines and still find tasks?
    • getting the final value?
    • is a pipeline a task as well?
    • progress reporting via chans?

    later / follow up issues:

    • drawing the pipeline?
    opened by verdverm 1
  • Go implementations for improved performance and capabilities

    Go implementations for improved performance and capabilities

    Today, the implementations are in CUE and entry is at the top level. Go implementations would likely have better performance. Additionally, they may open up features like Pattern Constraints l: [string]: string and Closedness close(), #def, and ...

    The idea would be to walk values and the AST as needed.

    • [x] count
    • [x] depth
    • [x] diff
    • [x] patch
    • [x] pick
    • [x] mask
    • [x] replace
    • [x] insert
    • [x] upsert
    • [x] transform
    • [x] validate
    opened by verdverm 1
  • Enable overwriting of files, or modifying name

    Enable overwriting of files, or modifying name

    When operating on many files, it would be helpful to

    • overwrite inplace
    • provide a pattern for alternative naming so as to write out without overwriting
    opened by verdverm 1
  • Output when doing shell pipes and redirects

    Output when doing shell pipes and redirects

    Currently, redirecting or piping output is troublesome as output has headings when using globs. This should only be enabled with a flag so that piping / redir is easier in the default case

    opened by verdverm 1
  • Don't use flags directly in structural Go funcs

    Don't use flags directly in structural Go funcs

    Flagpoles should be passed in rather than used directly. Would like to avoid having an extra config object since the flags are in their own package anyhow. Is this an anti-pattern?

    Support passing nil to the pkg funcs and filling in as necessary? How to handle defaults? Viper handles this via the bind that happens in the CLI, maybe modify hofmod-cli to create a DefaultFlagpole var?

    opened by verdverm 1
  • support expressions for args

    support expressions for args

    args are always files, there are places where an expression could be useful like: mask / pick / query / replace

    cuetils query '{
      kind: _
      metadata: {
        name: _
        namespace: _
        labels: [string]: string
      }
    }' k8s/*.yaml
    
    opened by verdverm 1
  • Additional helpers

    Additional helpers

    • [x] Replace - only if found, simpler input than patch
    • [x] Upsert - replace and add, simpler input than patch
    • [ ] ~Query - more capable than pick?~ (#18)
    • [x] Transform - mainly for bulk operations
    • [x] Validate - mainly for bulk operations
    • [x] Count - how many nodes are in object

    Others:

    Stats helper

    • combine depth and count
    • other stats?
    • demo of multiple multiple return

    ValidateDetail

    • show in object where validation errors happen, as a structured object
    opened by verdverm 0
  • field not allowed: #content

    field not allowed: #content

    // schema.cue
    #a: {
      name: string
    }
    #a
    
    # a.yaml
    name: foo
    
    > cuetils validate schema.cue a.yaml
    a.yaml
    ----------------------
    field not allowed: #content
    
    
    Errors in 1 file(s)
    
    > cuetils version  
    cuetils ConfigDir "/Users/samlee/Library/Application Support/cuetils" <nil>
    
    Version:     v0.4.0
    Commit:      6263ed1672d52dfca3bb3cd7d5d27adfa102ec53
    
    BuildDate:   2022-02-02T05:05:42Z
    GoVersion:   go1.14
    OS / Arch:   darwin amd64
    
    
    Author:   Hofstadter, Inc
    Homepage: https://docs.hofstadter.io
    GitHub:   https://github.com/hofstadter-io/cuetils
    

    Workaround

    > cue vet schema.cue a.yaml
    >
    
    opened by sjwl 1
  • No `cuetils` executable in container image v0.4

    No `cuetils` executable in container image v0.4

    # Executable file not found in $PATH
    $ docker run -it --rm hofstadter/cuetils:v0.4
    docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "cuetils": executable file not found in $PATH: unknown.
    
    # Nothing found
    $ docker run -it --rm --entrypoint find hofstadter/cuetils:v0.4 / -iname cuetils
    
    opened by qjcg 3
  • cmd/extract

    cmd/extract

    Add an extract command that takes a CUE path and returns the result as a top level value, or maybe just add an -e flag?

    Maybe we have some of this with the input.cue:path.to.value syntax at the cli?

    opened by verdverm 0
  • How might an operator be defined as a recursive structure?

    How might an operator be defined as a recursive structure?

    Creating an issue to capture the later thought in #32

    How could we define an operator input, such that it applies recursively to a tree which is itself recursive?

    a tree:

    name: "a1
    val: 0
    children: [{
      name: "b1"
      val: 0
      children: [ { name: "c1", val: 0 }]
    },{  
      name: "b2"
      val: 0
      children: [ { name: "c2", val: 0 }]
    }]
    

    the desired pick per node would produce the tree with just names

    name: string
    children: <...>?
    
    opened by verdverm 1
  • Support Operators working on Go values

    Support Operators working on Go values

    An interesting use case is derived from the conversation in https://github.com/cue-lang/cue/discussions/1389

    Where one would like to pretty print a CUE AST with kr/pretty but without all the noise

    So how might Pick be applied recursively to an already recursive structure? meta...

    opened by verdverm 0
  • Make an API mode

    Make an API mode

    Support an API mode, where ops & pipelines can be stored and then data can be sent.

    • v0, ops are loaded from disk
    • v1, a proper api with CRUD on ops
    opened by verdverm 0
Releases(v0.4.0)
  • v0.4.0(Feb 2, 2022)

    Changelog

    This release introduces the flow command and package.

    • Flow allows you to write task DAGs, which are properly run based on inter-task dependencies that are automatically inferred
    • library of tasks for you to use, wide and growing variety
    • ability to import flows & sets of tasks for reuse

    see examples/flow and flow/tasks to see what is available. Docs will be added in the near future on https://docs.hofstadter.io

    Commits

    6263ed1 Merge pull request #35 from hofstadter-io/feat-pipeline 6941d77 add in-mem k/v store; ideate some new tasks 3ba33f9 add links to each output in youtube.cue example 15022f2 add lost changeset for passing pipeline flags 0d9af4f add new task os.Mkdir, enable append in os.WriteFile 90a11da add new tasks os.FileLock and os.FileUnlock ce562e9 add some notes to ideas.md 6baa8b2 add tags to pipeline for data injection; there's a bug 096cedc add youtube api example 0b3a06e bugfixes b76184e checkpoint before removing calls to t.Value() b335fe9 cleanup ideas.md some more 350c53f cmd/cuetils: add verbose flag d4c03e6 cmd/pipeline: add list & docs flags 65674a4 cmd/pipeline: add logging flag to api.Serve f15d71d cmd/pipeline: cleanup pipeline task, and build flow.Controller when needed to ensure latest value updates are available 11ddb78 cmd/pipeline: cleanup, refactor, task:api/call 577078c cmd/pipeline: enable listing and doc printing for available pipelines 87f4215 cmd/pipeline: enable verbose printing during listing 8671d62 cmd/pipeline: fix bug in os.Getenv 9c65f7e cmd/pipeline: implement tags for injecting data from the command line 321b8f3 examples/pipeline: add new streamer example with twitch oauth and imported helper task 4f0dc48 finish s/pipeline/flow/g 5a77f05 get basic twitch bot working 9ca2391 implement api.Serve task with routes that support pipelines as their definition 4b1a37a implement db.Call.stmts to share a connection while processing a list of calls 5389d21 implement more of pipeline/os tasks; add several tests 6abd2c7 implement several pipeline/os tasks; general cleanup 4efb003 improve commands and how they are processed in the irc handler e247dc0 in flow/tasks/*: add locks around CUE evaluator until concurrency safe f7123ce initial pass at an ETL pipeline built on cue/flow and cuetils/ops 081e585 move around cue test & example files 2c62df5 pipeline largely working; many new task types and tests 29241a4 print tags when listing available pipelines; split up files in pipeline/ f9436ad propagate flag set if nil 910d391 prototype api.Serve task 2a2894d refactor pipeline pt1; add test cases 4cca9bc refactor pipeline task code; mostly fix issue?; update tests/cue; get twitch bot example working again 6d3596b rename example/pipeline to flow 520d1ff rename pipeline cmd to flow and regenerate 1eb0122 rename pipeline dir to flow 2d008ed repro in cuetils, but not cue/cmd 961c2c3 s/pipeline/flow/g in examples dir 8952918 s/pipeline/flow/g in flow dir 8e001fd start breaking down twitch cue files de98ab9 test cleanup; remove empty file 689d54e update CUE and hof versions

    Docker images

    • docker pull hofstadter/cuetils:v0.4.0-scratch
    • docker pull hofstadter/cuetils:v0.4-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.4.0
    • docker pull hofstadter/cuetils:v0.4
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.4.0-debian
    • docker pull hofstadter/cuetils:v0.4-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.4.0_Windows_x86_64.exe(16.14 MB)
    cuetils_0.4.0_checksums.txt(382 bytes)
    cuetils_0.4.0_Darwin_x86_64(17.07 MB)
    cuetils_0.4.0_Linux_arm64(15.43 MB)
    cuetils_0.4.0_Linux_x86_64(15.65 MB)
  • v0.3.3(Dec 29, 2021)

    Changelog

    5bb7f11 improve more empty results for diff

    Docker images

    • docker pull hofstadter/cuetils:v0.3.3-scratch
    • docker pull hofstadter/cuetils:v0.3-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.3.3
    • docker pull hofstadter/cuetils:v0.3
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.3.3-debian
    • docker pull hofstadter/cuetils:v0.3-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.3.3_Windows_x86_64.exe(11.74 MB)
    cuetils_0.3.3_checksums.txt(382 bytes)
    cuetils_0.3.3_Darwin_x86_64(12.35 MB)
    cuetils_0.3.3_Linux_arm64(11.37 MB)
    cuetils_0.3.3_Linux_x86_64(11.46 MB)
  • v0.3.2(Dec 29, 2021)

    Changelog

    a25ff92 fix bug and cleanup diff

    Docker images

    • docker pull hofstadter/cuetils:v0.3.2-scratch
    • docker pull hofstadter/cuetils:v0.3-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.3.2
    • docker pull hofstadter/cuetils:v0.3
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.3.2-debian
    • docker pull hofstadter/cuetils:v0.3-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.3.2_Windows_x86_64.exe(11.74 MB)
    cuetils_0.3.2_checksums.txt(382 bytes)
    cuetils_0.3.2_Darwin_x86_64(12.35 MB)
    cuetils_0.3.2_Linux_arm64(11.37 MB)
    cuetils_0.3.2_Linux_x86_64(11.46 MB)
  • v0.3.1(Nov 21, 2021)

    Changelog

    2a90591 cleanup some common funcs 8dfb2ff create common glob processors and reduce lots of code 07a7a35 fix go test 342dab0 fix transform bug, fix pick test 4ac0153 implement diff in Go f3a698c implement insert in Go, some other cleanup 1d6903b implement mask in Go cbd7b2d implement patch in Go 03e488f implement replace in Go 541090a implement upsert in Go bd4c8b2 pass opts (flags) as pointer to more places and through recursion; start breaking out op funcs for differnt node types e0a1bcc prep for rewriting some ops to Go 2c51178 proxy st ops and update cli to use cce16a4 remove old replace implementation 937a998 reshape the CLI UX a bit

    Docker images

    • docker pull hofstadter/cuetils:v0.3.1-scratch
    • docker pull hofstadter/cuetils:v0.3-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.3.1
    • docker pull hofstadter/cuetils:v0.3
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.3.1-debian
    • docker pull hofstadter/cuetils:v0.3-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.3.1_Windows_x86_64.exe(11.74 MB)
    cuetils_0.3.1_checksums.txt(382 bytes)
    cuetils_0.3.1_Darwin_x86_64(12.35 MB)
    cuetils_0.3.1_Linux_arm64(11.37 MB)
    cuetils_0.3.1_Linux_x86_64(11.46 MB)
  • v0.3.0(Nov 17, 2021)

    Changelog

    • always use cue.Load to process op code (globs in next version)
    • fix issue with loading data files
    • implement extend (add only if not present)
    • fix issue in Walk not passing options on recursion
    • enable more tests in CI, start Go tests
    • start implementing ops in Go (pick so far)
    • improve CLI args and short help messages

    Commits

    4f65451 clean up CLI args and short help; add two new command stubs abef592 cleanup pick code d21b59f disable cue tests until a bash enabled cue action is available ffd8750 enable more tests 2d9be41 fix issue with json/yaml entrypoints 45d4a9f implement Go version of Pick 259d90f implement extend command a121c4c pass options in Walk recursion 0830a61 remove unused file ac38182 rename input funcs for reuse on all args 1f47c87 rename input processing funcs, refactor in consumers

    Docker images

    • docker pull hofstadter/cuetils:v0.3.0-scratch
    • docker pull hofstadter/cuetils:v0.3-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.3.0
    • docker pull hofstadter/cuetils:v0.3
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.3.0-debian
    • docker pull hofstadter/cuetils:v0.3-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.3.0_Windows_x86_64.exe(11.74 MB)
    cuetils_0.3.0_checksums.txt(382 bytes)
    cuetils_0.3.0_Darwin_x86_64(12.35 MB)
    cuetils_0.3.0_Linux_arm64(11.37 MB)
    cuetils_0.3.0_Linux_x86_64(11.47 MB)
  • v0.2.2(Oct 16, 2021)

    Changelog

    f24692b add clean flag for picking out basic lits 6f2c1c5 add special case for pick with _; can use for converting formats, eventually selecting subobject or field ce32612 update pick to support embedded scalars

    Docker images

    • docker pull hofstadter/cuetils:v0.2.2-scratch
    • docker pull hofstadter/cuetils:v0.2-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.2.2
    • docker pull hofstadter/cuetils:v0.2
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.2.2-debian
    • docker pull hofstadter/cuetils:v0.2-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.2.2_Windows_x86_64.exe(11.73 MB)
    cuetils_0.2.2_checksums.txt(382 bytes)
    cuetils_0.2.2_Darwin_x86_64(12.34 MB)
    cuetils_0.2.2_Linux_arm64(11.25 MB)
    cuetils_0.2.2_Linux_x86_64(11.45 MB)
  • v0.2.1(Oct 16, 2021)

    Changelog

    a53e9cd fix pick cue f436376 move cue tests 3cb1390 rename load* flags to just load and use for all args cf76c89 return non-nil error when trying to overwrite without flag bd461c6 support expressions as operator for a number of commands bd09f4c update validate command to use new operator loading method

    Docker images

    • docker pull hofstadter/cuetils:v0.2.1-scratch
    • docker pull hofstadter/cuetils:v0.2-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.2.1
    • docker pull hofstadter/cuetils:v0.2
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.2.1-debian
    • docker pull hofstadter/cuetils:v0.2-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.2.1_Windows_x86_64.exe(11.73 MB)
    cuetils_0.2.1_checksums.txt(382 bytes)
    cuetils_0.2.1_Darwin_x86_64(12.34 MB)
    cuetils_0.2.1_Linux_arm64(11.25 MB)
    cuetils_0.2.1_Linux_x86_64(11.45 MB)
  • v0.2.0(Oct 16, 2021)

    Changelog

    049fdc7 add a number of flags for upcoming changes b0c3cd2 add validate test and example e82efa1 add walk function, implement count with walk and Go f6ea079 implement depth in Go with walk; fix bug in count cc7c02d operator ,@ ; outname ; overwrite ; update pick to use these b38d044 pass flags to helpers rather than importing there dc8ec7b remove default from accum & outname flags 913b891 remove old code df7953c update other commands to use new operator and output features a704de8 update readme with cli examples

    Docker images

    • docker pull hofstadter/cuetils:v0.2.0-scratch
    • docker pull hofstadter/cuetils:v0.2-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.2.0
    • docker pull hofstadter/cuetils:v0.2
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.2.0-debian
    • docker pull hofstadter/cuetils:v0.2-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.2.0_Windows_x86_64.exe(11.73 MB)
    cuetils_0.2.0_checksums.txt(382 bytes)
    cuetils_0.2.0_Darwin_x86_64(12.33 MB)
    cuetils_0.2.0_Linux_arm64(11.25 MB)
    cuetils_0.2.0_Linux_x86_64(11.45 MB)
  • v0.1.2(Oct 12, 2021)

    Changelog

    ab25472 add example details / show to each helper 8d54b03 add workflow to run tests de9d328 adjust details dc37150 consolidate pkg into structural, start transform / validate helpers e188a84 enable cue.Load on some helpers, add tests for implemented commands 3932cbb fix build and test in workflow e9c371c fix import in default.cue workflow 2dd86e2 implement transform command 66b5c49 implement validate command 3b71ebe prep for cue/load single inputs 4d8408a readme fixes 0709c8f remove test output files... 19e2cec wip readme

    Docker images

    • docker pull hofstadter/cuetils:v0.1.2-scratch
    • docker pull hofstadter/cuetils:v0.1-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.1.2
    • docker pull hofstadter/cuetils:v0.1
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.1.2-debian
    • docker pull hofstadter/cuetils:v0.1-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.1.2_Windows_x86_64.exe(11.72 MB)
    cuetils_0.1.2_checksums.txt(382 bytes)
    cuetils_0.1.2_Darwin_x86_64(12.33 MB)
    cuetils_0.1.2_Linux_arm64(11.25 MB)
    cuetils_0.1.2_Linux_x86_64(11.44 MB)
  • v0.1.1(Oct 10, 2021)

    Changelog

    402c2ad add count helper; change basic->multi; fix depth for lists be0adda add replace and upsert

    Docker images

    • docker pull hofstadter/cuetils:v0.1.1-scratch
    • docker pull hofstadter/cuetils:v0.1-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.1.1
    • docker pull hofstadter/cuetils:v0.1
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.1.1-debian
    • docker pull hofstadter/cuetils:v0.1-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.1.1_Windows_x86_64.exe(11.27 MB)
    cuetils_0.1.1_checksums.txt(382 bytes)
    cuetils_0.1.1_Darwin_x86_64(11.84 MB)
    cuetils_0.1.1_Linux_arm64(10.81 MB)
    cuetils_0.1.1_Linux_x86_64(11.00 MB)
  • v0.1.0(Oct 9, 2021)

    Changelog

    b5b805e add output formatting 427c0ed add patch command 442fc07 add pick/mask commands

    Docker images

    • docker pull hofstadter/cuetils:v0.1.0-scratch
    • docker pull hofstadter/cuetils:v0.1-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.1.0
    • docker pull hofstadter/cuetils:v0.1
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.1.0-debian
    • docker pull hofstadter/cuetils:v0.1-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.1.0_Windows_x86_64.exe(11.25 MB)
    cuetils_0.1.0_checksums.txt(382 bytes)
    cuetils_0.1.0_Darwin_x86_64(11.82 MB)
    cuetils_0.1.0_Linux_arm64(10.81 MB)
    cuetils_0.1.0_Linux_x86_64(10.98 MB)
  • v0.0.2(Oct 9, 2021)

    Changelog

    3d04792 add maxiter flag for controlling recursion 129f226 add yaml converter 2ceff6a implement diff 8fef365 start input helper dd6a5d2 update commands for flexible globbing in the terminal

    Docker images

    • docker pull hofstadter/cuetils:v0.0.2-scratch
    • docker pull hofstadter/cuetils:v0.0-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.0.2
    • docker pull hofstadter/cuetils:v0.0
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.0.2-debian
    • docker pull hofstadter/cuetils:v0.0-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.0.2_Windows_x86_64.exe(11.23 MB)
    cuetils_0.0.2_checksums.txt(382 bytes)
    cuetils_0.0.2_Darwin_x86_64(11.80 MB)
    cuetils_0.0.2_Linux_arm64(10.81 MB)
    cuetils_0.0.2_Linux_x86_64(10.96 MB)
  • v0.0.1(Oct 9, 2021)

    Changelog

    4116ac5 Initial commit 2ce4890 add mask, make test results and real definitions, more readme 76696df add patch helper; improve readme de9eb0d add pick, breakout test results db492b7 fix spelling mistake 852b349 go mod tidy a6105cd implement first version of depth f161031 initial import from cuetorials a32a6d0 rename to cuetils c561463 sketch out cli skeleton b468a0f update cue.mods 16cffe4 update hofmod-cli to avoid go vendor dir 4ea1966 write initial readme

    Docker images

    • docker pull hofstadter/cuetils:v0.0.1-scratch
    • docker pull hofstadter/cuetils:v0.0-scratch
    • docker pull hofstadter/cuetils:v0-scratch
    • docker pull hofstadter/cuetils:latest-scratch
    • docker pull hofstadter/cuetils:v0.0.1
    • docker pull hofstadter/cuetils:v0.0
    • docker pull hofstadter/cuetils:v0
    • docker pull hofstadter/cuetils:latest
    • docker pull hofstadter/cuetils:v0.0.1-debian
    • docker pull hofstadter/cuetils:v0.0-debian
    • docker pull hofstadter/cuetils:v0-debian
    • docker pull hofstadter/cuetils:latest-debian
    Source code(tar.gz)
    Source code(zip)
    cuetils.exe_0.0.1_Windows_x86_64.exe(11.22 MB)
    cuetils_0.0.1_checksums.txt(382 bytes)
    cuetils_0.0.1_Darwin_x86_64(11.78 MB)
    cuetils_0.0.1_Linux_arm64(10.81 MB)
    cuetils_0.0.1_Linux_x86_64(10.95 MB)
Owner
_Hofstadter
Developing new ways to develop
_Hofstadter
GoLang-based client-side circuit breakers and helpers

Overview Example library for circuit breaking in GoLang. Written to support a blog post on https://www.wojno.com. Use this library in your SDK's to pr

Chris Wojno 0 Dec 5, 2021
Helpers for making the use of reflection easier

go-xray This is a Golang library with reflection related functions which I use in my different projects. KeyValue This type is used to construct a key

Pieter Claerhout 25 Oct 24, 2022
Raw ANSI sequence helpers

Raw ANSI sequence helpers

Christian Muehlhaeuser 17 Oct 23, 2022
Goety - Generics based Go utilities

goety General purpose Go utilities. Package channel Utilities to work with chann

Joa Ebert 4 May 16, 2022
Utilities and immutable collections for functional programming in Golang

Utilities and immutable collections for functional programming in Golang. This is an experimental library to play with the new Generics Feature in Go 1.18.

Peter Zeller 9 Sep 1, 2022
Utilities for rounding and truncating floating point numbers.

Rounders Provides utilities for rounding and truncating floating point numbers. Example: rounders.RoundToDecimals(12.48881, 2)

Konnor Klashinsky 0 Jan 6, 2022
Go-path - A helper package that provides utilities for parsing and using ipfs paths

go-path is a helper package that provides utilities for parsing and using ipfs paths

y 0 Jan 18, 2022
A collection of small Go utilities to make life easier.

The simplego package provides a collection of Go utilities for common tasks.

John Wang 28 Nov 19, 2022
Utilities to generate (reference) documentation for the docker CLI

About This is a library containing utilities to generate (reference) documentation for the docker CLI on docs.docker.com. Disclaimer This library is i

Docker 15 Oct 30, 2022
Utilities for interacting with Dockerfiles

go-dockerfile Golang utilities for interacting with Dockerfiles. This is not a place of honor. No esteemed source code is commemorated here. Don't tak

Jake Sanders 15 Apr 6, 2022
Simple utilities for creating ascii text in Go

Simple utilities for creating ascii text in Go

Reinaldy Rafli 3 Oct 30, 2021
golden provides utilities for golden file tests.

golden provides utilities for golden file tests.

Takuya Ueda 20 Nov 23, 2022
Source Repo for utilities used in Atlas

Atlas-Utilities Source Repo for utilities used in Atlas filepicker Simple file picker in Go using go-common-file-dialog This returns the path of a fil

AtlasOS 38 Nov 22, 2022
List-Utils - 🔧 Utilities for maintaining the list of repost sites

SMR List Utils This is a Go CLI tool that helps with managing the StopModReposts blacklist. Install Use GitHub Releases and download binary. Linux Qui

Stop Mod Reposts 0 Jan 3, 2022
Utilities for processing Wikipedia dumps in Go

Utilities for processing Wikipedia dumps in Go A Go package providing utilities for processing Wikipedia dumps. Features: Supports Wikidata entities J

null 5 Oct 13, 2022
Go-Utils is a library containing a collection of Golang utilities

Go-Utils is a library containing a collection of Golang utilities

Skillz 0 Jun 2, 2022
This project provides some working examples using Go and Hotwire Turbo.

hotwire-golang-website This project provides some working examples using Go the hotwire/turbo library published by basecamp.

Mark Wolfe 151 Nov 10, 2022
tool for working with numbers and units

tool for working with numbers and units

null 36 Nov 26, 2022
Payload is a simple tool for working with production data in your local environment.

Payload Payload is a simple tool for working with production data in your local environment. What problem does it solve? You're working with Cloud SQL

Ivan Vanderbyl 1 Oct 13, 2021