diff --git a/commands/docs/abbr.md b/commands/docs/abbr.md index a1e299c438a..e193d27ea40 100644 --- a/commands/docs/abbr.md +++ b/commands/docs/abbr.md @@ -2,7 +2,7 @@ title: abbr categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Abbreviations related commands. usage: | diff --git a/commands/docs/abbr_list.md b/commands/docs/abbr_list.md index 3d9f0f4ab66..1393dfdf89d 100644 --- a/commands/docs/abbr_list.md +++ b/commands/docs/abbr_list.md @@ -2,7 +2,7 @@ title: abbr list categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | List all defined abbreviations. usage: | diff --git a/commands/docs/alias.md b/commands/docs/alias.md index caae4682831..0e802a3ddd1 100644 --- a/commands/docs/alias.md +++ b/commands/docs/alias.md @@ -2,7 +2,7 @@ title: alias categories: | core -version: 0.114.0 +version: 0.115.0 core: | Alias a command (with optional flags) to a new name. usage: | diff --git a/commands/docs/all.md b/commands/docs/all.md index a6fbf0d514b..5e6da29de87 100644 --- a/commands/docs/all.md +++ b/commands/docs/all.md @@ -2,7 +2,7 @@ title: all categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Test if every element of the input fulfills a predicate expression. usage: | @@ -22,7 +22,7 @@ contributors: false ## Parameters - - `predicate`: A closure that must evaluate to a boolean. + - `predicate`: Row condition or closure that evaluates to a boolean. ## Input/output types: @@ -46,7 +46,7 @@ true Check that each item is a string. ```nu -> [foo bar 2 baz] | all {|| ($in | describe) == 'string' } +> [foo bar 2 baz] | all ($it | describe) == 'string' false ``` diff --git a/commands/docs/ansi.md b/commands/docs/ansi.md index a84b5db354d..b59f774911a 100644 --- a/commands/docs/ansi.md +++ b/commands/docs/ansi.md @@ -2,7 +2,7 @@ title: ansi categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Output ANSI codes to change color and style of text. usage: | diff --git a/commands/docs/ansi_gradient.md b/commands/docs/ansi_gradient.md index 328305d2233..691f3e5d6e0 100644 --- a/commands/docs/ansi_gradient.md +++ b/commands/docs/ansi_gradient.md @@ -2,7 +2,7 @@ title: ansi gradient categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Add a color gradient (using ANSI color codes) to the given string. usage: | diff --git a/commands/docs/ansi_link.md b/commands/docs/ansi_link.md index 298f24e901b..351dbf53973 100644 --- a/commands/docs/ansi_link.md +++ b/commands/docs/ansi_link.md @@ -2,7 +2,7 @@ title: ansi link categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Add a link (using OSC 8 escape sequence) to the given string. usage: | diff --git a/commands/docs/ansi_strip.md b/commands/docs/ansi_strip.md index 4e0596a968c..024837fdc94 100644 --- a/commands/docs/ansi_strip.md +++ b/commands/docs/ansi_strip.md @@ -2,7 +2,7 @@ title: ansi strip categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Strip ANSI escape sequences from a string. usage: | diff --git a/commands/docs/any.md b/commands/docs/any.md index 68dcd4ecbad..7bd2d8d0384 100644 --- a/commands/docs/any.md +++ b/commands/docs/any.md @@ -2,7 +2,7 @@ title: any categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Tests if any element of the input fulfills a predicate expression. usage: | @@ -22,7 +22,7 @@ contributors: false ## Parameters - - `predicate`: A closure that must evaluate to a boolean. + - `predicate`: Row condition or closure that evaluates to a boolean. ## Input/output types: @@ -40,7 +40,7 @@ true Check if any row's status is the string 'DOWN'. ```nu -> [[status]; [UP] [DOWN] [UP]] | any {|el| $el.status == DOWN } +> [[status]; [UP] [DOWN] [UP]] | any status == DOWN true ``` @@ -52,7 +52,7 @@ false Check if any value is equal to twice its own index. ```nu -> [9 8 7 6] | enumerate | any {|i| $i.item == $i.index * 2 } +> [9 8 7 6] | enumerate | any item == index * 2 true ``` diff --git a/commands/docs/append.md b/commands/docs/append.md index ad8458fc301..2cbe659530f 100644 --- a/commands/docs/append.md +++ b/commands/docs/append.md @@ -2,7 +2,7 @@ title: append categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Append any number of rows to a table. usage: | diff --git a/commands/docs/ast.md b/commands/docs/ast.md index 4716ba7f91f..447f9827707 100644 --- a/commands/docs/ast.md +++ b/commands/docs/ast.md @@ -2,7 +2,7 @@ title: ast categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Print the abstract syntax tree (ast) for a pipeline. usage: | diff --git a/commands/docs/attr.md b/commands/docs/attr.md index 6ea81930948..79e0022f64c 100644 --- a/commands/docs/attr.md +++ b/commands/docs/attr.md @@ -2,7 +2,7 @@ title: attr categories: | core -version: 0.114.0 +version: 0.115.0 core: | Various attributes for custom commands. usage: | diff --git a/commands/docs/attr_category.md b/commands/docs/attr_category.md index b93f28dd8ff..fea32eeb391 100644 --- a/commands/docs/attr_category.md +++ b/commands/docs/attr_category.md @@ -2,7 +2,7 @@ title: attr category categories: | core -version: 0.114.0 +version: 0.115.0 core: | Attribute for adding a category to custom commands. usage: | diff --git a/commands/docs/attr_complete.md b/commands/docs/attr_complete.md index 82b2b45b13f..8963ddcd29e 100644 --- a/commands/docs/attr_complete.md +++ b/commands/docs/attr_complete.md @@ -2,7 +2,7 @@ title: attr complete categories: | core -version: 0.114.0 +version: 0.115.0 core: | Attribute for using another command as a completion source for all arguments. usage: | diff --git a/commands/docs/attr_complete_external.md b/commands/docs/attr_complete_external.md index a7d5fb403a8..17181c1a78e 100644 --- a/commands/docs/attr_complete_external.md +++ b/commands/docs/attr_complete_external.md @@ -2,7 +2,7 @@ title: attr complete external categories: | core -version: 0.114.0 +version: 0.115.0 core: | Attribute for enabling use of the external completer for internal commands. usage: | diff --git a/commands/docs/attr_deprecated.md b/commands/docs/attr_deprecated.md index f7f715f9736..b1758131583 100644 --- a/commands/docs/attr_deprecated.md +++ b/commands/docs/attr_deprecated.md @@ -2,7 +2,7 @@ title: attr deprecated categories: | core -version: 0.114.0 +version: 0.115.0 core: | Attribute for marking a command or flag as deprecated. usage: | diff --git a/commands/docs/attr_example.md b/commands/docs/attr_example.md index 1941328c939..e05425d3ad7 100644 --- a/commands/docs/attr_example.md +++ b/commands/docs/attr_example.md @@ -2,7 +2,7 @@ title: attr example categories: | core -version: 0.114.0 +version: 0.115.0 core: | Attribute for adding examples to custom commands. usage: | diff --git a/commands/docs/attr_search-terms.md b/commands/docs/attr_search-terms.md index 1ee9dfbcaa9..95087ec3631 100644 --- a/commands/docs/attr_search-terms.md +++ b/commands/docs/attr_search-terms.md @@ -2,7 +2,7 @@ title: attr search-terms categories: | core -version: 0.114.0 +version: 0.115.0 core: | Attribute for adding search terms to custom commands. usage: | diff --git a/commands/docs/banner.md b/commands/docs/banner.md index 07b0bea1358..9e697125182 100644 --- a/commands/docs/banner.md +++ b/commands/docs/banner.md @@ -2,7 +2,7 @@ title: banner categories: | default -version: 0.114.0 +version: 0.115.0 default: | Print a banner for Nushell with information about the project usage: | diff --git a/commands/docs/bits.md b/commands/docs/bits.md index 546fb76a956..8b3bbc5a4e8 100644 --- a/commands/docs/bits.md +++ b/commands/docs/bits.md @@ -2,7 +2,7 @@ title: bits categories: | bits -version: 0.114.0 +version: 0.115.0 bits: | Various commands for working with bits. usage: | diff --git a/commands/docs/bits_and.md b/commands/docs/bits_and.md index f2fb0b34f12..6741534bddf 100644 --- a/commands/docs/bits_and.md +++ b/commands/docs/bits_and.md @@ -2,7 +2,7 @@ title: bits and categories: | bits -version: 0.114.0 +version: 0.115.0 bits: | Performs bitwise and for ints or binary values. usage: | diff --git a/commands/docs/bits_not.md b/commands/docs/bits_not.md index 898ee63be62..6ace59194db 100644 --- a/commands/docs/bits_not.md +++ b/commands/docs/bits_not.md @@ -2,7 +2,7 @@ title: bits not categories: | bits -version: 0.114.0 +version: 0.115.0 bits: | Performs logical negation on each bit. usage: | diff --git a/commands/docs/bits_or.md b/commands/docs/bits_or.md index 28d0e8fa194..17df40608d9 100644 --- a/commands/docs/bits_or.md +++ b/commands/docs/bits_or.md @@ -2,7 +2,7 @@ title: bits or categories: | bits -version: 0.114.0 +version: 0.115.0 bits: | Performs bitwise or for ints or binary values. usage: | diff --git a/commands/docs/bits_rol.md b/commands/docs/bits_rol.md index 6d6f54d700a..4f3e9e339ce 100644 --- a/commands/docs/bits_rol.md +++ b/commands/docs/bits_rol.md @@ -2,7 +2,7 @@ title: bits rol categories: | bits -version: 0.114.0 +version: 0.115.0 bits: | Bitwise rotate left for ints or binary values. usage: | diff --git a/commands/docs/bits_ror.md b/commands/docs/bits_ror.md index 85f478e617f..124ee799260 100644 --- a/commands/docs/bits_ror.md +++ b/commands/docs/bits_ror.md @@ -2,7 +2,7 @@ title: bits ror categories: | bits -version: 0.114.0 +version: 0.115.0 bits: | Bitwise rotate right for ints or binary values. usage: | diff --git a/commands/docs/bits_shl.md b/commands/docs/bits_shl.md index ae3bc13b57d..084552eefe0 100644 --- a/commands/docs/bits_shl.md +++ b/commands/docs/bits_shl.md @@ -2,7 +2,7 @@ title: bits shl categories: | bits -version: 0.114.0 +version: 0.115.0 bits: | Bitwise shift left for ints or binary values. usage: | diff --git a/commands/docs/bits_shr.md b/commands/docs/bits_shr.md index 47ac012528d..cf3d7d9c1bc 100644 --- a/commands/docs/bits_shr.md +++ b/commands/docs/bits_shr.md @@ -2,7 +2,7 @@ title: bits shr categories: | bits -version: 0.114.0 +version: 0.115.0 bits: | Bitwise shift right for ints or binary values. usage: | diff --git a/commands/docs/bits_xor.md b/commands/docs/bits_xor.md index 96fda2ee789..5b7634d91aa 100644 --- a/commands/docs/bits_xor.md +++ b/commands/docs/bits_xor.md @@ -2,7 +2,7 @@ title: bits xor categories: | bits -version: 0.114.0 +version: 0.115.0 bits: | Performs bitwise xor for ints or binary values. usage: | diff --git a/commands/docs/break.md b/commands/docs/break.md index 4c5aa3b4d45..541e1784e33 100644 --- a/commands/docs/break.md +++ b/commands/docs/break.md @@ -2,7 +2,7 @@ title: break categories: | core -version: 0.114.0 +version: 0.115.0 core: | Break a loop. usage: | diff --git a/commands/docs/bytes.md b/commands/docs/bytes.md index aead3c92a6f..617b682403a 100644 --- a/commands/docs/bytes.md +++ b/commands/docs/bytes.md @@ -2,7 +2,7 @@ title: bytes categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Various commands for working with byte data. usage: | diff --git a/commands/docs/bytes_add.md b/commands/docs/bytes_add.md index 52098536988..d2e3bb8d5ba 100644 --- a/commands/docs/bytes_add.md +++ b/commands/docs/bytes_add.md @@ -2,7 +2,7 @@ title: bytes add categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Add specified bytes to the binary input. usage: | diff --git a/commands/docs/bytes_at.md b/commands/docs/bytes_at.md index 6b6ebc1d272..d51f6092d25 100644 --- a/commands/docs/bytes_at.md +++ b/commands/docs/bytes_at.md @@ -2,7 +2,7 @@ title: bytes at categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Get bytes from the input defined by a range. usage: | diff --git a/commands/docs/bytes_build.md b/commands/docs/bytes_build.md index e044f67e159..80717a5c506 100644 --- a/commands/docs/bytes_build.md +++ b/commands/docs/bytes_build.md @@ -2,7 +2,7 @@ title: bytes build categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Create a binary value from the provided arguments. usage: | diff --git a/commands/docs/bytes_collect.md b/commands/docs/bytes_collect.md index c78be4ee0d0..72e8910371f 100644 --- a/commands/docs/bytes_collect.md +++ b/commands/docs/bytes_collect.md @@ -2,7 +2,7 @@ title: bytes collect categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Concatenate multiple binary into a single binary, with an optional separator between each. usage: | diff --git a/commands/docs/bytes_ends-with.md b/commands/docs/bytes_ends-with.md index f4f136a97bc..79fa4142c1c 100644 --- a/commands/docs/bytes_ends-with.md +++ b/commands/docs/bytes_ends-with.md @@ -2,7 +2,7 @@ title: bytes ends-with categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Check if binary data ends with a pattern. usage: | diff --git a/commands/docs/bytes_index-of.md b/commands/docs/bytes_index-of.md index 9fccd905071..221555e4dcc 100644 --- a/commands/docs/bytes_index-of.md +++ b/commands/docs/bytes_index-of.md @@ -2,7 +2,7 @@ title: bytes index-of categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Returns start index of first occurrence of pattern in bytes, or -1 if no match. usage: | diff --git a/commands/docs/bytes_length.md b/commands/docs/bytes_length.md index d17c77eec14..19286915865 100644 --- a/commands/docs/bytes_length.md +++ b/commands/docs/bytes_length.md @@ -2,7 +2,7 @@ title: bytes length categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Output the length of any bytes in the pipeline. usage: | diff --git a/commands/docs/bytes_remove.md b/commands/docs/bytes_remove.md index 5e38192495b..10c08878ab6 100644 --- a/commands/docs/bytes_remove.md +++ b/commands/docs/bytes_remove.md @@ -2,7 +2,7 @@ title: bytes remove categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Remove specified bytes from the input. usage: | diff --git a/commands/docs/bytes_replace.md b/commands/docs/bytes_replace.md index ccd085654cd..80470464bf8 100644 --- a/commands/docs/bytes_replace.md +++ b/commands/docs/bytes_replace.md @@ -2,7 +2,7 @@ title: bytes replace categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Find and replace bytes in binary data. usage: | diff --git a/commands/docs/bytes_reverse.md b/commands/docs/bytes_reverse.md index 5660ea29b5e..ae8a798b0b4 100644 --- a/commands/docs/bytes_reverse.md +++ b/commands/docs/bytes_reverse.md @@ -2,7 +2,7 @@ title: bytes reverse categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Reverse the bytes in the pipeline. usage: | diff --git a/commands/docs/bytes_split.md b/commands/docs/bytes_split.md index d9627d32525..169ec91d252 100644 --- a/commands/docs/bytes_split.md +++ b/commands/docs/bytes_split.md @@ -2,7 +2,7 @@ title: bytes split categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Split input into multiple items using a separator. usage: | diff --git a/commands/docs/bytes_starts-with.md b/commands/docs/bytes_starts-with.md index a222b9eb400..a39e6fbdf2e 100644 --- a/commands/docs/bytes_starts-with.md +++ b/commands/docs/bytes_starts-with.md @@ -2,7 +2,7 @@ title: bytes starts-with categories: | bytes -version: 0.114.0 +version: 0.115.0 bytes: | Check if binary data starts with a pattern. usage: | diff --git a/commands/docs/cal.md b/commands/docs/cal.md index 2e88c523e3c..8fdd0c8e430 100644 --- a/commands/docs/cal.md +++ b/commands/docs/cal.md @@ -2,7 +2,7 @@ title: cal categories: | generators -version: 0.114.0 +version: 0.115.0 generators: | Display a calendar. usage: | diff --git a/commands/docs/cd.md b/commands/docs/cd.md index a3a6b06cfd6..2e50d8b0318 100644 --- a/commands/docs/cd.md +++ b/commands/docs/cd.md @@ -2,7 +2,7 @@ title: cd categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Change the current working directory. usage: | diff --git a/commands/docs/char.md b/commands/docs/char.md index f2261c3ce70..57fa4638e70 100644 --- a/commands/docs/char.md +++ b/commands/docs/char.md @@ -2,7 +2,7 @@ title: char categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Output special characters (e.g., 'newline'). usage: | diff --git a/commands/docs/chunk-by.md b/commands/docs/chunk-by.md index dec58bf9579..d993fbf7084 100644 --- a/commands/docs/chunk-by.md +++ b/commands/docs/chunk-by.md @@ -2,7 +2,7 @@ title: chunk-by categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Divides a sequence into sub-sequences based on a closure. usage: | diff --git a/commands/docs/chunks.md b/commands/docs/chunks.md index 94a444fa1f0..30a253d8a6e 100644 --- a/commands/docs/chunks.md +++ b/commands/docs/chunks.md @@ -2,11 +2,11 @@ title: chunks categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | - Divide a list, table or binary input into chunks of `chunk_size`. + Divide a list, table or binary input into chunks of `chunk_size`. For binary input, `chunk_size` can also be specified as a filesize. usage: | - Divide a list, table or binary input into chunks of `chunk_size`. + Divide a list, table or binary input into chunks of `chunk_size`. For binary input, `chunk_size` can also be specified as a filesize. editLink: false contributors: false --- @@ -14,7 +14,7 @@ contributors: false # `chunks` for [filters](/commands/categories/filters.md) -
Divide a list, table or binary input into chunks of `chunk_size`.
+
Divide a list, table or binary input into chunks of `chunk_size`. For binary input, `chunk_size` can also be specified as a filesize.
## Signature @@ -82,5 +82,11 @@ Chunk the bytes of a binary into triplets ``` +Open a binary file and make 8 kibibyte chunks +```nu +> open --raw foo.bin | chunks 8kib + +``` + ## Notes This command will error if `chunk_size` is negative or zero. \ No newline at end of file diff --git a/commands/docs/clear.md b/commands/docs/clear.md index facdbf25c2b..40f2a7691bb 100644 --- a/commands/docs/clear.md +++ b/commands/docs/clear.md @@ -2,7 +2,7 @@ title: clear categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Clear the terminal screen. usage: | diff --git a/commands/docs/collect.md b/commands/docs/collect.md index 9d472e5b7bd..0bc63b34b0a 100644 --- a/commands/docs/collect.md +++ b/commands/docs/collect.md @@ -2,7 +2,7 @@ title: collect categories: | core -version: 0.114.0 +version: 0.115.0 core: | Collect a stream into a value. usage: | diff --git a/commands/docs/columns.md b/commands/docs/columns.md index fcbb72f92db..c4bbf82f453 100644 --- a/commands/docs/columns.md +++ b/commands/docs/columns.md @@ -2,7 +2,7 @@ title: columns categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Given a record or table, produce a list of its columns' names. usage: | diff --git a/commands/docs/combinations.md b/commands/docs/combinations.md index b307062a2e4..b116317a304 100644 --- a/commands/docs/combinations.md +++ b/commands/docs/combinations.md @@ -2,7 +2,7 @@ title: combinations categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Generates all combinations of size k from the input list. usage: | diff --git a/commands/docs/commandline.md b/commands/docs/commandline.md index 1672d594526..9f1b318e5b4 100644 --- a/commands/docs/commandline.md +++ b/commands/docs/commandline.md @@ -2,7 +2,7 @@ title: commandline categories: | core -version: 0.114.0 +version: 0.115.0 core: | View the current command line input buffer. usage: | @@ -29,9 +29,10 @@ contributors: false ## Subcommands: -| name | description | type | -| -------------------------------------------------------------------- | ------------------------------------------------ | -------- | -| [`commandline complete`](/commands/docs/commandline_complete.md) | Complete a string using the default completions. | built-in | -| [`commandline edit`](/commands/docs/commandline_edit.md) | Modify the current command line input buffer. | built-in | -| [`commandline get-cursor`](/commands/docs/commandline_get-cursor.md) | Get the current cursor position. | built-in | -| [`commandline set-cursor`](/commands/docs/commandline_set-cursor.md) | Set the current cursor position. | built-in | \ No newline at end of file +| name | description | type | +| -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -------- | +| [`commandline complete`](/commands/docs/commandline_complete.md) | Complete a string using the default completions. | built-in | +| [`commandline edit`](/commands/docs/commandline_edit.md) | Modify the current command line input buffer. | built-in | +| [`commandline get-cursor`](/commands/docs/commandline_get-cursor.md) | Get the current cursor position. | built-in | +| [`commandline set-cursor`](/commands/docs/commandline_set-cursor.md) | Set the current cursor position. | built-in | +| [`commandline set-prompt`](/commands/docs/commandline_set-prompt.md) | Replace the current prompt and repaint it in place, without disturbing the line being edited. | built-in | \ No newline at end of file diff --git a/commands/docs/commandline_complete.md b/commands/docs/commandline_complete.md index 723204b6c75..de07c974a68 100644 --- a/commands/docs/commandline_complete.md +++ b/commands/docs/commandline_complete.md @@ -2,7 +2,7 @@ title: commandline complete categories: | core -version: 0.114.0 +version: 0.115.0 core: | Complete a string using the default completions. usage: | diff --git a/commands/docs/commandline_edit.md b/commands/docs/commandline_edit.md index fbe4b5b7d29..03a97e5cc2e 100644 --- a/commands/docs/commandline_edit.md +++ b/commands/docs/commandline_edit.md @@ -2,7 +2,7 @@ title: commandline edit categories: | core -version: 0.114.0 +version: 0.115.0 core: | Modify the current command line input buffer. usage: | diff --git a/commands/docs/commandline_get-cursor.md b/commands/docs/commandline_get-cursor.md index c53ec7de951..20cc96fc05b 100644 --- a/commands/docs/commandline_get-cursor.md +++ b/commands/docs/commandline_get-cursor.md @@ -2,7 +2,7 @@ title: commandline get-cursor categories: | core -version: 0.114.0 +version: 0.115.0 core: | Get the current cursor position. usage: | diff --git a/commands/docs/commandline_set-cursor.md b/commands/docs/commandline_set-cursor.md index 564e097f31b..d4aa89e18fc 100644 --- a/commands/docs/commandline_set-cursor.md +++ b/commands/docs/commandline_set-cursor.md @@ -2,7 +2,7 @@ title: commandline set-cursor categories: | core -version: 0.114.0 +version: 0.115.0 core: | Set the current cursor position. usage: | diff --git a/commands/docs/commandline_set-prompt.md b/commands/docs/commandline_set-prompt.md new file mode 100644 index 00000000000..1cf20eb9143 --- /dev/null +++ b/commands/docs/commandline_set-prompt.md @@ -0,0 +1,97 @@ +--- +title: commandline set-prompt +categories: | + core +version: 0.115.0 +core: | + Replace the current prompt and repaint it in place, without disturbing the line being edited. +usage: | + Replace the current prompt and repaint it in place, without disturbing the line being edited. +editLink: false +contributors: false +--- + + +# `commandline set-prompt` for [core](/commands/categories/core.md) + +
Replace the current prompt and repaint it in place, without disturbing the line being edited.
+ +## Signature + +```> commandline set-prompt {flags} (prompt)``` + +## Flags + + - `--right, -r {string}`: Text for the right prompt, i.e. `$env.PROMPT_COMMAND_RIGHT`. + - `--indicator, -i {string}`: Text for the prompt indicator in the default/emacs edit mode, i.e. `$env.PROMPT_INDICATOR`. + - `--vi-insert {string}`: Text for the prompt indicator in vi insert mode, i.e. `$env.PROMPT_INDICATOR_VI_INSERT`. + - `--vi-normal {string}`: Text for the prompt indicator in vi normal mode, i.e. `$env.PROMPT_INDICATOR_VI_NORMAL`. + - `--multiline, -m {string}`: Text for the multiline continuation indicator, i.e. `$env.PROMPT_MULTILINE_INDICATOR`. + +## Parameters + + - `prompt`: The rendered prompt text to display, i.e. `$env.PROMPT_COMMAND`. If left-out, we read from pipeline input. + + +## Input/output types: + +| input | output | +| ------- | ------- | +| nothing | nothing | +| string | nothing | +## Examples + +Replace the left prompt with a freshly rendered string. +```nu +> job spawn { sleep 1sec; commandline set-prompt $"(ansi green)me> (ansi reset)" } + +``` + +Replace the right prompt. +```nu +> job spawn { sleep 1sec; commandline set-prompt --right $"right (date now | format date '%H:%M:%S')" } + +``` + +Replace the default/emacs indicator. +```nu +> job spawn { sleep 1sec; commandline set-prompt --indicator $" (char prompt)" } + +``` + +Replace the vi insert and normal mode indicators independently. +```nu +> job spawn { sleep 1sec; commandline set-prompt --vi-insert ": " --vi-normal "n " } + +``` + +Replace the multiline continuation indicator. +```nu +> job spawn { sleep 1sec; commandline set-prompt --multiline "... " } + +``` + +Replace multiple prompt segments in one call. +```nu +> job spawn { sleep 1sec; commandline set-prompt --right "67" --indicator "69" } + +``` + +Stream a slow prompt segment in from a background job. +```nu +> job spawn { sleep 1sec; commandline set-prompt $"(git branch --show-current) > " } + +``` + +## Notes +This is meant to be called from a background job (see `job spawn`) to build +streaming prompts: we render the prompt as we know it up front, and each +`commandline set-prompt` updates our idea of what the prompt "is" for the +segments that have finished computing. The line and cursor are preserved. + +`--indicator` sets only the default/emacs indicator. Use `--vi-insert` and +`--vi-normal` to set the vi mode indicators independently. + +The pushed prompt lasts only until the next prompt is drawn. + +meant for REPL sessions only \ No newline at end of file diff --git a/commands/docs/compact.md b/commands/docs/compact.md index 1059ab01bc9..fffdfcbd13d 100644 --- a/commands/docs/compact.md +++ b/commands/docs/compact.md @@ -2,7 +2,7 @@ title: compact categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Creates a table with non-empty rows. usage: | diff --git a/commands/docs/complete.md b/commands/docs/complete.md index 576305dce66..ff81f4646f4 100644 --- a/commands/docs/complete.md +++ b/commands/docs/complete.md @@ -2,7 +2,7 @@ title: complete categories: | system -version: 0.114.0 +version: 0.115.0 system: | Capture the outputs and exit code from an external piped in command in a nushell table. usage: | diff --git a/commands/docs/config.md b/commands/docs/config.md index b528777acc7..3359bc42eac 100644 --- a/commands/docs/config.md +++ b/commands/docs/config.md @@ -2,7 +2,7 @@ title: config categories: | env -version: 0.114.0 +version: 0.115.0 env: | Edit nushell configuration files. usage: | diff --git a/commands/docs/config_env.md b/commands/docs/config_env.md index 08bfb45873c..be29c41321b 100644 --- a/commands/docs/config_env.md +++ b/commands/docs/config_env.md @@ -2,7 +2,7 @@ title: config env categories: | env -version: 0.114.0 +version: 0.115.0 env: | Edit nu environment configurations. usage: | diff --git a/commands/docs/config_flatten.md b/commands/docs/config_flatten.md index e128b84fd06..7109539b704 100644 --- a/commands/docs/config_flatten.md +++ b/commands/docs/config_flatten.md @@ -2,7 +2,7 @@ title: config flatten categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Show the current configuration in a flattened form. usage: | diff --git a/commands/docs/config_nu.md b/commands/docs/config_nu.md index 2a1c7923fed..451b8cd82a1 100644 --- a/commands/docs/config_nu.md +++ b/commands/docs/config_nu.md @@ -2,7 +2,7 @@ title: config nu categories: | env -version: 0.114.0 +version: 0.115.0 env: | Edit nu configurations. usage: | diff --git a/commands/docs/config_reset.md b/commands/docs/config_reset.md index fa62176132c..4ebeaf0b58c 100644 --- a/commands/docs/config_reset.md +++ b/commands/docs/config_reset.md @@ -2,7 +2,7 @@ title: config reset categories: | env -version: 0.114.0 +version: 0.115.0 env: | Reset nushell environment configurations to default, and saves old config files in the config location as oldconfig.nu and oldenv.nu. usage: | diff --git a/commands/docs/config_use-colors.md b/commands/docs/config_use-colors.md index 1679aa70f65..bbcc9307aa7 100644 --- a/commands/docs/config_use-colors.md +++ b/commands/docs/config_use-colors.md @@ -2,7 +2,7 @@ title: config use-colors categories: | env -version: 0.114.0 +version: 0.115.0 env: | Get the configuration for color output. usage: | diff --git a/commands/docs/const.md b/commands/docs/const.md index 269388875ab..bec50fb771f 100644 --- a/commands/docs/const.md +++ b/commands/docs/const.md @@ -2,7 +2,7 @@ title: const categories: | core -version: 0.114.0 +version: 0.115.0 core: | Create a parse-time constant. usage: | diff --git a/commands/docs/continue.md b/commands/docs/continue.md index c02a1b9bc33..276c3f698b9 100644 --- a/commands/docs/continue.md +++ b/commands/docs/continue.md @@ -2,7 +2,7 @@ title: continue categories: | core -version: 0.114.0 +version: 0.115.0 core: | Continue a loop from the next iteration. usage: | diff --git a/commands/docs/cp.md b/commands/docs/cp.md index 516cbd8f201..a6bc8f9ddf9 100644 --- a/commands/docs/cp.md +++ b/commands/docs/cp.md @@ -2,7 +2,7 @@ title: cp categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Copy files using uutils/coreutils cp. usage: | diff --git a/commands/docs/date.md b/commands/docs/date.md index 60b3c4abdbb..4cf97fc9de5 100644 --- a/commands/docs/date.md +++ b/commands/docs/date.md @@ -2,7 +2,7 @@ title: date categories: | date -version: 0.114.0 +version: 0.115.0 date: | Date-related commands. usage: | diff --git a/commands/docs/date_format.md b/commands/docs/date_format.md index 4dc2b2bc7d3..fe9037a1dd4 100644 --- a/commands/docs/date_format.md +++ b/commands/docs/date_format.md @@ -2,7 +2,7 @@ title: date format categories: | removed -version: 0.114.0 +version: 0.115.0 removed: | Removed command: use `format date` instead. usage: | diff --git a/commands/docs/date_from-human.md b/commands/docs/date_from-human.md index f22db5c3546..b3faccc45b8 100644 --- a/commands/docs/date_from-human.md +++ b/commands/docs/date_from-human.md @@ -2,7 +2,7 @@ title: date from-human categories: | date -version: 0.114.0 +version: 0.115.0 date: | Convert a human readable datetime string to a datetime. usage: | @@ -27,10 +27,12 @@ contributors: false ## Input/output types: -| input | output | -| ------- | -------- | -| string | datetime | -| nothing | table | +| input | output | +| -------------- | -------------- | +| string | datetime | +| nothing | table | +| list<datetime> | list<datetime> | +| list<string> | list<datetime> | ## Examples Parsing human readable datetime. @@ -56,3 +58,9 @@ Show human-readable datetime parsing examples. > date from-human --list ``` + +Convert a list of human-readable datetime strings to datetimes. +```nu +> ["Today at 18:30", "Tomorrow at 09:00"] | date from-human + +``` diff --git a/commands/docs/date_humanize.md b/commands/docs/date_humanize.md index 6eeb8cddea8..a0e7c5c0c23 100644 --- a/commands/docs/date_humanize.md +++ b/commands/docs/date_humanize.md @@ -2,7 +2,7 @@ title: date humanize categories: | date -version: 0.114.0 +version: 0.115.0 date: | Print a 'humanized' format for the date, relative to now. usage: | @@ -23,10 +23,12 @@ contributors: false ## Input/output types: -| input | output | -| -------- | ------ | -| datetime | string | -| string | string | +| input | output | +| -------------- | ------------ | +| datetime | string | +| string | string | +| list<datetime> | list<string> | +| list<string> | list<string> | ## Examples Print a 'humanized' format for the date, relative to now. @@ -34,3 +36,15 @@ Print a 'humanized' format for the date, relative to now. > "2021-10-22 20:00:12 +01:00" | date humanize ``` + +Humanize a list of datetimes. +```nu +> [2021-10-22T20:00:12+01:00, 2021-10-23T20:00:00+01:00] | date humanize + +``` + +Humanize a list of date strings. +```nu +> ["2021-10-22 20:00:12 +01:00", "2021-10-22 21:00:00 +01:00"] | date humanize + +``` diff --git a/commands/docs/date_list-timezone.md b/commands/docs/date_list-timezone.md index 8a55f2b6518..e068aee7424 100644 --- a/commands/docs/date_list-timezone.md +++ b/commands/docs/date_list-timezone.md @@ -2,7 +2,7 @@ title: date list-timezone categories: | date -version: 0.114.0 +version: 0.115.0 date: | List supported time zones. usage: | diff --git a/commands/docs/date_now.md b/commands/docs/date_now.md index cd68f729c49..1cf68b59a4a 100644 --- a/commands/docs/date_now.md +++ b/commands/docs/date_now.md @@ -2,7 +2,7 @@ title: date now categories: | date -version: 0.114.0 +version: 0.115.0 date: | Get the current date. usage: | diff --git a/commands/docs/date_to-timezone.md b/commands/docs/date_to-timezone.md index 54363908559..1ef185501fe 100644 --- a/commands/docs/date_to-timezone.md +++ b/commands/docs/date_to-timezone.md @@ -2,7 +2,7 @@ title: date to-timezone categories: | date -version: 0.114.0 +version: 0.115.0 date: | Convert a date to a given time zone. usage: | @@ -27,10 +27,12 @@ contributors: false ## Input/output types: -| input | output | -| -------- | -------- | -| datetime | datetime | -| string | datetime | +| input | output | +| -------------- | -------------- | +| datetime | datetime | +| string | datetime | +| list<datetime> | list<datetime> | +| list<string> | list<datetime> | ## Examples Get the current date in UTC+05:00. @@ -63,5 +65,25 @@ Get a date in a different time zone, from a datetime. Sat, 10 Oct 2020 13:00:00 +0500 (5 years ago) ``` +Convert a list of datetimes to a given time zone. +```nu +> [2021-10-22T10:00:00+02:00, 2021-10-23T10:00:00+02:00] | date to-timezone "+0500" +╭───┬─────────────╮ +│ 0 │ 4 years ago │ +│ 1 │ 4 years ago │ +╰───┴─────────────╯ + +``` + +Convert a list of date strings to a given time zone. +```nu +> ["2020-10-10 10:00:00 +02:00", "2020-10-10 12:00:00 +02:00"] | date to-timezone "+0500" +╭───┬─────────────╮ +│ 0 │ 5 years ago │ +│ 1 │ 5 years ago │ +╰───┴─────────────╯ + +``` + ## Notes Use 'date list-timezone' to list all supported time zones. \ No newline at end of file diff --git a/commands/docs/debug.md b/commands/docs/debug.md index fe2b2d25400..16affae35ed 100644 --- a/commands/docs/debug.md +++ b/commands/docs/debug.md @@ -2,7 +2,7 @@ title: debug categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Debug print the value(s) piped in. usage: | diff --git a/commands/docs/debug_env.md b/commands/docs/debug_env.md index 246f0308bb9..2259aad8f63 100644 --- a/commands/docs/debug_env.md +++ b/commands/docs/debug_env.md @@ -2,7 +2,7 @@ title: debug env categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Show environment variables as external commands would get it. usage: | diff --git a/commands/docs/debug_experimental-options.md b/commands/docs/debug_experimental-options.md index 63959e4d5b9..94bddfaaf89 100644 --- a/commands/docs/debug_experimental-options.md +++ b/commands/docs/debug_experimental-options.md @@ -2,7 +2,7 @@ title: debug experimental-options categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Show all experimental options. usage: | diff --git a/commands/docs/debug_info.md b/commands/docs/debug_info.md index 05ab71016f1..5ae231497f8 100644 --- a/commands/docs/debug_info.md +++ b/commands/docs/debug_info.md @@ -2,7 +2,7 @@ title: debug info categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | View process memory info. usage: | diff --git a/commands/docs/debug_profile.md b/commands/docs/debug_profile.md index 75f3386caad..62778723d54 100644 --- a/commands/docs/debug_profile.md +++ b/commands/docs/debug_profile.md @@ -2,7 +2,7 @@ title: debug profile categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Profile pipeline elements in a closure. usage: | diff --git a/commands/docs/decode.md b/commands/docs/decode.md index a8805e861fb..715ab8b704e 100644 --- a/commands/docs/decode.md +++ b/commands/docs/decode.md @@ -2,7 +2,7 @@ title: decode categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Decode bytes into a string. usage: | diff --git a/commands/docs/decode_base32.md b/commands/docs/decode_base32.md index 0321f1fb8a1..67a18035a94 100644 --- a/commands/docs/decode_base32.md +++ b/commands/docs/decode_base32.md @@ -2,7 +2,7 @@ title: decode base32 categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Decode a Base32-encoded value. usage: | diff --git a/commands/docs/decode_base32hex.md b/commands/docs/decode_base32hex.md index a86da7dc3a6..63b8dd80ec0 100644 --- a/commands/docs/decode_base32hex.md +++ b/commands/docs/decode_base32hex.md @@ -2,7 +2,7 @@ title: decode base32hex categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Encode a base32hex value. usage: | diff --git a/commands/docs/decode_base64.md b/commands/docs/decode_base64.md index 8688e6b4975..01f30a4476d 100644 --- a/commands/docs/decode_base64.md +++ b/commands/docs/decode_base64.md @@ -2,7 +2,7 @@ title: decode base64 categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Decode a Base64-encoded value. usage: | diff --git a/commands/docs/decode_hex.md b/commands/docs/decode_hex.md index 7068105a130..35c5b8dacaa 100644 --- a/commands/docs/decode_hex.md +++ b/commands/docs/decode_hex.md @@ -2,7 +2,7 @@ title: decode hex categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Decode a hex-encoded value. usage: | diff --git a/commands/docs/def.md b/commands/docs/def.md index 48d92c107e0..1d92ba1cf02 100644 --- a/commands/docs/def.md +++ b/commands/docs/def.md @@ -2,7 +2,7 @@ title: def categories: | core -version: 0.114.0 +version: 0.115.0 core: | Define a custom command. usage: | diff --git a/commands/docs/default.md b/commands/docs/default.md index c06f972bbdb..73b45029b25 100644 --- a/commands/docs/default.md +++ b/commands/docs/default.md @@ -2,7 +2,7 @@ title: default categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Sets a default value if a row's column is missing or null. usage: | diff --git a/commands/docs/describe.md b/commands/docs/describe.md index 96d192f8727..3395fed95b2 100644 --- a/commands/docs/describe.md +++ b/commands/docs/describe.md @@ -2,7 +2,7 @@ title: describe categories: | core -version: 0.114.0 +version: 0.115.0 core: | Describe the type and structure of the value(s) piped in. usage: | diff --git a/commands/docs/detect.md b/commands/docs/detect.md index 11c18ab0e9c..aec60c0a337 100644 --- a/commands/docs/detect.md +++ b/commands/docs/detect.md @@ -2,7 +2,7 @@ title: detect categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Various commands for detecting things. usage: | diff --git a/commands/docs/detect_columns.md b/commands/docs/detect_columns.md index ea1692c44b7..684c196ed08 100644 --- a/commands/docs/detect_columns.md +++ b/commands/docs/detect_columns.md @@ -2,7 +2,7 @@ title: detect columns categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Attempt to automatically split text into multiple columns. usage: | diff --git a/commands/docs/detect_type.md b/commands/docs/detect_type.md index 42603073fe5..2ebf0ead75e 100644 --- a/commands/docs/detect_type.md +++ b/commands/docs/detect_type.md @@ -2,7 +2,7 @@ title: detect type categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Infer Nushell datatype from a string. usage: | @@ -109,7 +109,7 @@ Thu, 2 Jan 2025 00:00:00 +0800 (2 years ago) Prefer DMY for ambiguous dates ```nu > '01/02/2025' | detect type --prefer-dmy -Sat, 1 Feb 2025 00:00:00 +0800 (a year ago) +Sat, 1 Feb 2025 00:00:00 +0800 (2 years ago) ``` Unknown stays a string diff --git a/commands/docs/difference.md b/commands/docs/difference.md index 6077c6880a7..589d61b6696 100644 --- a/commands/docs/difference.md +++ b/commands/docs/difference.md @@ -2,7 +2,7 @@ title: difference categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Returns a list of unique elements in the input that are not present in the other list. usage: | diff --git a/commands/docs/do.md b/commands/docs/do.md index 8b56d3f8c9d..06ea62a758b 100644 --- a/commands/docs/do.md +++ b/commands/docs/do.md @@ -2,7 +2,7 @@ title: do categories: | core -version: 0.114.0 +version: 0.115.0 core: | Run a closure, providing it with the pipeline input. usage: | diff --git a/commands/docs/drop.md b/commands/docs/drop.md index 738a54da030..5a19212fc12 100644 --- a/commands/docs/drop.md +++ b/commands/docs/drop.md @@ -2,11 +2,11 @@ title: drop categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | - Remove items/rows from the end of the input list/table. Counterpart of `skip`. Opposite of `last`. + Remove items/rows from the end of the input list/table, or remove bytes from the end of binary data. Counterpart of `skip`. Opposite of `last`. For binary input, `rows` can also be specified as a filesize. usage: | - Remove items/rows from the end of the input list/table. Counterpart of `skip`. Opposite of `last`. + Remove items/rows from the end of the input list/table, or remove bytes from the end of binary data. Counterpart of `skip`. Opposite of `last`. For binary input, `rows` can also be specified as a filesize. editLink: false contributors: false --- @@ -14,7 +14,7 @@ contributors: false # `drop` for [filters](/commands/categories/filters.md) -
Remove items/rows from the end of the input list/table. Counterpart of `skip`. Opposite of `last`.
+
Remove items/rows from the end of the input list/table, or remove bytes from the end of binary data. Counterpart of `skip`. Opposite of `last`. For binary input, `rows` can also be specified as a filesize.
## Signature @@ -31,6 +31,7 @@ contributors: false | --------- | --------- | | table | table | | list<any> | list<any> | +| binary | binary | ## Examples Remove the last item of a list @@ -77,6 +78,14 @@ Remove the last row in a table ``` +Remove the last 2 bytes of a binary value, using a filesize argument +```nu +> 0x[01 23 45] | drop 2b +Length: 1 (0x1) bytes | null_char printable whitespace ascii_other non_ascii +00000000: 01 • + +``` + ## Subcommands: diff --git a/commands/docs/drop_column.md b/commands/docs/drop_column.md index 28e31c884d3..b086dac64cf 100644 --- a/commands/docs/drop_column.md +++ b/commands/docs/drop_column.md @@ -2,7 +2,7 @@ title: drop column categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Remove N columns at the right-hand end of the input table. To remove columns by name, use `reject`. usage: | diff --git a/commands/docs/drop_nth.md b/commands/docs/drop_nth.md index e7972b70930..73ba85c0cde 100644 --- a/commands/docs/drop_nth.md +++ b/commands/docs/drop_nth.md @@ -2,7 +2,7 @@ title: drop nth categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Drop the selected rows. usage: | diff --git a/commands/docs/du.md b/commands/docs/du.md index c20b4182896..0f2455a2af6 100644 --- a/commands/docs/du.md +++ b/commands/docs/du.md @@ -2,7 +2,7 @@ title: du categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Find disk usage sizes of specified items. usage: | diff --git a/commands/docs/each.md b/commands/docs/each.md index 64811a02643..0eb84b97f4c 100644 --- a/commands/docs/each.md +++ b/commands/docs/each.md @@ -2,7 +2,7 @@ title: each categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Run a closure on each row of the input list, creating a new list with the results. usage: | diff --git a/commands/docs/each_while.md b/commands/docs/each_while.md index 3dddef38d7a..e0d83d2f0bf 100644 --- a/commands/docs/each_while.md +++ b/commands/docs/each_while.md @@ -2,7 +2,7 @@ title: each while categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Run a closure on each row of the input list until a null is found, then create a new list with the results. usage: | diff --git a/commands/docs/echo.md b/commands/docs/echo.md index 511a992d409..5dfab3f1cd6 100644 --- a/commands/docs/echo.md +++ b/commands/docs/echo.md @@ -2,7 +2,7 @@ title: echo categories: | core -version: 0.114.0 +version: 0.115.0 core: | Returns its arguments, ignoring the piped-in value. usage: | diff --git a/commands/docs/encode.md b/commands/docs/encode.md index a2a49f85d1c..e6e8cedcda7 100644 --- a/commands/docs/encode.md +++ b/commands/docs/encode.md @@ -2,7 +2,7 @@ title: encode categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Encode a string into bytes. usage: | diff --git a/commands/docs/encode_base32.md b/commands/docs/encode_base32.md index c0154c580a8..c1c36c92387 100644 --- a/commands/docs/encode_base32.md +++ b/commands/docs/encode_base32.md @@ -2,7 +2,7 @@ title: encode base32 categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Encode a string or binary value using Base32. usage: | diff --git a/commands/docs/encode_base32hex.md b/commands/docs/encode_base32hex.md index 125a8655b22..0d25a169599 100644 --- a/commands/docs/encode_base32hex.md +++ b/commands/docs/encode_base32hex.md @@ -2,7 +2,7 @@ title: encode base32hex categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Encode a binary value or a string using base32hex. usage: | diff --git a/commands/docs/encode_base64.md b/commands/docs/encode_base64.md index 459b4c51ce1..2dab1d21c84 100644 --- a/commands/docs/encode_base64.md +++ b/commands/docs/encode_base64.md @@ -2,7 +2,7 @@ title: encode base64 categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Encode a string or binary value using Base64. usage: | diff --git a/commands/docs/encode_hex.md b/commands/docs/encode_hex.md index bbd76732287..5ee704ef378 100644 --- a/commands/docs/encode_hex.md +++ b/commands/docs/encode_hex.md @@ -2,7 +2,7 @@ title: encode hex categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Hex encode a binary value or a string. usage: | diff --git a/commands/docs/enumerate.md b/commands/docs/enumerate.md index c402dee8db9..1f1c5352491 100644 --- a/commands/docs/enumerate.md +++ b/commands/docs/enumerate.md @@ -2,7 +2,7 @@ title: enumerate categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Enumerate the elements in a stream. usage: | diff --git a/commands/docs/error.md b/commands/docs/error.md index 1d959c717ef..b2c1afd4031 100644 --- a/commands/docs/error.md +++ b/commands/docs/error.md @@ -2,7 +2,7 @@ title: error categories: | core -version: 0.114.0 +version: 0.115.0 core: | Various commands for working with errors. usage: | diff --git a/commands/docs/error_make.md b/commands/docs/error_make.md index 15724fdd41a..b9827eb4bcb 100644 --- a/commands/docs/error_make.md +++ b/commands/docs/error_make.md @@ -2,7 +2,7 @@ title: error make categories: | core -version: 0.114.0 +version: 0.115.0 core: | Create an error. usage: | diff --git a/commands/docs/every.md b/commands/docs/every.md index e41ab307e82..cff5d8a212c 100644 --- a/commands/docs/every.md +++ b/commands/docs/every.md @@ -2,7 +2,7 @@ title: every categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Show (or skip) every n-th row, starting from the first one. usage: | diff --git a/commands/docs/exec.md b/commands/docs/exec.md index 557d94af711..8d7d773f7e3 100644 --- a/commands/docs/exec.md +++ b/commands/docs/exec.md @@ -2,7 +2,7 @@ title: exec categories: | system -version: 0.114.0 +version: 0.115.0 system: | Execute a command, replacing or exiting the current process, depending on platform. usage: | diff --git a/commands/docs/exit.md b/commands/docs/exit.md index 7dbd91cdbe0..c47f89725ad 100644 --- a/commands/docs/exit.md +++ b/commands/docs/exit.md @@ -2,7 +2,7 @@ title: exit categories: | shells -version: 0.114.0 +version: 0.115.0 shells: | Exit Nu. usage: | diff --git a/commands/docs/explain.md b/commands/docs/explain.md index e4edbf65b7d..9138885f5b0 100644 --- a/commands/docs/explain.md +++ b/commands/docs/explain.md @@ -2,7 +2,7 @@ title: explain categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Explain closure contents. usage: | diff --git a/commands/docs/explore.md b/commands/docs/explore.md index 530c265ffd8..875cceffc2d 100644 --- a/commands/docs/explore.md +++ b/commands/docs/explore.md @@ -2,7 +2,7 @@ title: explore categories: | viewers -version: 0.114.0 +version: 0.115.0 viewers: | Explore acts as a table pager, just like `less` does for text. usage: | diff --git a/commands/docs/explore_config.md b/commands/docs/explore_config.md index dc7da6ab717..01d70a659a2 100644 --- a/commands/docs/explore_config.md +++ b/commands/docs/explore_config.md @@ -2,7 +2,7 @@ title: explore config categories: | viewers -version: 0.114.0 +version: 0.115.0 viewers: | Launch a TUI to view and edit the nushell configuration interactively. usage: | diff --git a/commands/docs/explore_regex.md b/commands/docs/explore_regex.md index b72caef3107..50726f70667 100644 --- a/commands/docs/explore_regex.md +++ b/commands/docs/explore_regex.md @@ -2,7 +2,7 @@ title: explore regex categories: | viewers -version: 0.114.0 +version: 0.115.0 viewers: | Launch a TUI to create and explore regular expressions interactively. usage: | diff --git a/commands/docs/export-env.md b/commands/docs/export-env.md index a443d10b776..562dec7e7e7 100644 --- a/commands/docs/export-env.md +++ b/commands/docs/export-env.md @@ -2,7 +2,7 @@ title: export-env categories: | env -version: 0.114.0 +version: 0.115.0 env: | Run a block and preserve its environment in a current scope. usage: | diff --git a/commands/docs/export.md b/commands/docs/export.md index c93ed2f4c0f..8e62ba9c4aa 100644 --- a/commands/docs/export.md +++ b/commands/docs/export.md @@ -2,7 +2,7 @@ title: export categories: | core -version: 0.114.0 +version: 0.115.0 core: | Export definitions or environment variables from a module. usage: | diff --git a/commands/docs/export_alias.md b/commands/docs/export_alias.md index b1b39c09e16..2f7b5d07a67 100644 --- a/commands/docs/export_alias.md +++ b/commands/docs/export_alias.md @@ -2,7 +2,7 @@ title: export alias categories: | core -version: 0.114.0 +version: 0.115.0 core: | Alias a command (with optional flags) to a new name and export it from a module. usage: | diff --git a/commands/docs/export_const.md b/commands/docs/export_const.md index b984bd0da2d..927fe9d1a1b 100644 --- a/commands/docs/export_const.md +++ b/commands/docs/export_const.md @@ -2,7 +2,7 @@ title: export const categories: | core -version: 0.114.0 +version: 0.115.0 core: | Use parse-time constant from a module and export them from this module. usage: | diff --git a/commands/docs/export_def.md b/commands/docs/export_def.md index 4f2332e759e..759eda0e8f5 100644 --- a/commands/docs/export_def.md +++ b/commands/docs/export_def.md @@ -2,7 +2,7 @@ title: export def categories: | core -version: 0.114.0 +version: 0.115.0 core: | Define a custom command and export it from a module. usage: | diff --git a/commands/docs/export_extern.md b/commands/docs/export_extern.md index 74cf3be1949..9d09b1646a5 100644 --- a/commands/docs/export_extern.md +++ b/commands/docs/export_extern.md @@ -2,7 +2,7 @@ title: export extern categories: | core -version: 0.114.0 +version: 0.115.0 core: | Define an extern and export it from a module. usage: | diff --git a/commands/docs/export_module.md b/commands/docs/export_module.md index 1da2e650b42..a69bc2adcab 100644 --- a/commands/docs/export_module.md +++ b/commands/docs/export_module.md @@ -2,7 +2,7 @@ title: export module categories: | core -version: 0.114.0 +version: 0.115.0 core: | Export a custom module from a module. usage: | diff --git a/commands/docs/export_use.md b/commands/docs/export_use.md index e6bfc900b6b..dc9c9747644 100644 --- a/commands/docs/export_use.md +++ b/commands/docs/export_use.md @@ -2,7 +2,7 @@ title: export use categories: | core -version: 0.114.0 +version: 0.115.0 core: | Use definitions from a module and export them from this module. usage: | diff --git a/commands/docs/extern.md b/commands/docs/extern.md index 7df04e67612..1fc007e3e96 100644 --- a/commands/docs/extern.md +++ b/commands/docs/extern.md @@ -2,7 +2,7 @@ title: extern categories: | core -version: 0.114.0 +version: 0.115.0 core: | Define a signature for an external command. usage: | diff --git a/commands/docs/fill.md b/commands/docs/fill.md index 14ba77a6295..7f9aa5f5297 100644 --- a/commands/docs/fill.md +++ b/commands/docs/fill.md @@ -2,7 +2,7 @@ title: fill categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Fill and align text in columns. usage: | diff --git a/commands/docs/filter.md b/commands/docs/filter.md index f2167e4ebd0..2f7c9ca79cb 100644 --- a/commands/docs/filter.md +++ b/commands/docs/filter.md @@ -2,7 +2,7 @@ title: filter categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Filter values based on a predicate closure. usage: | diff --git a/commands/docs/find.md b/commands/docs/find.md index c37284cd477..4d4fb883318 100644 --- a/commands/docs/find.md +++ b/commands/docs/find.md @@ -2,7 +2,7 @@ title: find categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Search for terms in the input data. usage: | diff --git a/commands/docs/first.md b/commands/docs/first.md index b1bcbf7155f..f7cbb2d1eef 100644 --- a/commands/docs/first.md +++ b/commands/docs/first.md @@ -2,11 +2,11 @@ title: first categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | - Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`. + Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`. For binary input, rows can also be specified as a filesize. usage: | - Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`. + Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`. For binary input, rows can also be specified as a filesize. editLink: false contributors: false --- @@ -14,7 +14,7 @@ contributors: false # `first` for [filters](/commands/categories/filters.md) -
Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`.
+
Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`. For binary input, rows can also be specified as a filesize.
## Signature @@ -67,3 +67,11 @@ Return the first item of a range. > 1..3 | first 1 ``` + +Return the first 2 bytes of a binary value, using a filesize argument. +```nu +> 0x[01 23 45] | first 2b +Length: 2 (0x2) bytes | null_char printable whitespace ascii_other non_ascii +00000000: 01 23 •# + +``` diff --git a/commands/docs/flatten.md b/commands/docs/flatten.md index 235fd029b7f..2a3f5ecdfab 100644 --- a/commands/docs/flatten.md +++ b/commands/docs/flatten.md @@ -2,7 +2,7 @@ title: flatten categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Flatten a table by extracting nested values. usage: | diff --git a/commands/docs/for.md b/commands/docs/for.md index f29f8de07d3..b3f5f23d989 100644 --- a/commands/docs/for.md +++ b/commands/docs/for.md @@ -2,7 +2,7 @@ title: for categories: | core -version: 0.114.0 +version: 0.115.0 core: | Loop over a range. usage: | diff --git a/commands/docs/format.md b/commands/docs/format.md index 1af53697033..3c12c081406 100644 --- a/commands/docs/format.md +++ b/commands/docs/format.md @@ -2,7 +2,7 @@ title: format categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Various commands for formatting data. usage: | diff --git a/commands/docs/format_bits.md b/commands/docs/format_bits.md index fe04bd4b353..96635866b41 100644 --- a/commands/docs/format_bits.md +++ b/commands/docs/format_bits.md @@ -2,7 +2,7 @@ title: format bits categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert value to a string of binary data represented by 0 and 1. usage: | diff --git a/commands/docs/format_date.md b/commands/docs/format_date.md index ad7eabc5def..033d5781151 100644 --- a/commands/docs/format_date.md +++ b/commands/docs/format_date.md @@ -2,7 +2,7 @@ title: format date categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Format a given date using a format string. usage: | @@ -31,12 +31,14 @@ contributors: false ## Input/output types: -| input | output | -| -------- | ------ | -| datetime | string | -| string | string | -| nothing | table | -| any | table | +| input | output | +| -------------- | ------------ | +| datetime | string | +| string | string | +| nothing | table | +| any | table | +| list<datetime> | list<string> | +| list<string> | list<string> | ## Examples Format a given date-time using the default format (RFC 2822). @@ -74,3 +76,23 @@ Format a given date using a given format string. > "2021-10-22 20:00:12 +01:00" | format date "%Y-%m-%d" 2021-10-22 ``` + +Format a list of date strings using a given format string. +```nu +> ["2021-10-22 20:00:12 +01:00", "2021-10-23 20:00:12 +01:00"] | format date "%Y-%m-%d" +╭───┬────────────╮ +│ 0 │ 2021-10-22 │ +│ 1 │ 2021-10-23 │ +╰───┴────────────╯ + +``` + +Format a list of datetimes using a given format string. +```nu +> [2021-10-22T20:00:12+01:00, 2021-10-23T20:00:12+01:00] | format date "%Y-%m-%d" +╭───┬────────────╮ +│ 0 │ 2021-10-22 │ +│ 1 │ 2021-10-23 │ +╰───┴────────────╯ + +``` diff --git a/commands/docs/format_duration.md b/commands/docs/format_duration.md index 750b98e533a..d7dda11275b 100644 --- a/commands/docs/format_duration.md +++ b/commands/docs/format_duration.md @@ -2,7 +2,7 @@ title: format duration categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Outputs duration with a specified unit of time. usage: | diff --git a/commands/docs/format_filesize.md b/commands/docs/format_filesize.md index d3395e5d4e1..b42d7ac7400 100644 --- a/commands/docs/format_filesize.md +++ b/commands/docs/format_filesize.md @@ -2,7 +2,7 @@ title: format filesize categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Converts a column of filesizes to some specified format. usage: | diff --git a/commands/docs/format_number.md b/commands/docs/format_number.md index 7e4a3cc8acf..f61c10bcb51 100644 --- a/commands/docs/format_number.md +++ b/commands/docs/format_number.md @@ -2,7 +2,7 @@ title: format number categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Format a number. usage: | diff --git a/commands/docs/format_pattern.md b/commands/docs/format_pattern.md index 5a62f04f92f..b43141e92b7 100644 --- a/commands/docs/format_pattern.md +++ b/commands/docs/format_pattern.md @@ -2,7 +2,7 @@ title: format pattern categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Format columns into a string using a simple pattern. usage: | diff --git a/commands/docs/from.md b/commands/docs/from.md index 858857ba399..3911e8a38f9 100644 --- a/commands/docs/from.md +++ b/commands/docs/from.md @@ -2,7 +2,7 @@ title: from categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse a string or binary data into structured data. usage: | diff --git a/commands/docs/from_csv.md b/commands/docs/from_csv.md index 8ca732287ff..c993d20d2b8 100644 --- a/commands/docs/from_csv.md +++ b/commands/docs/from_csv.md @@ -2,7 +2,7 @@ title: from csv categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse text as .csv and create table. usage: | diff --git a/commands/docs/from_eml.md b/commands/docs/from_eml.md index 45b04f3584b..32fdb7c6f86 100644 --- a/commands/docs/from_eml.md +++ b/commands/docs/from_eml.md @@ -2,7 +2,7 @@ title: from eml categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse text as .eml and create record. usage: | diff --git a/commands/docs/from_ics.md b/commands/docs/from_ics.md index 7b9e2a26bf8..cce8d496fdf 100644 --- a/commands/docs/from_ics.md +++ b/commands/docs/from_ics.md @@ -2,7 +2,7 @@ title: from ics categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse text as .ics and create table. usage: | diff --git a/commands/docs/from_ini.md b/commands/docs/from_ini.md index 5e5affdbc87..6874ba34323 100644 --- a/commands/docs/from_ini.md +++ b/commands/docs/from_ini.md @@ -2,7 +2,7 @@ title: from ini categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse text as .ini and create table. usage: | diff --git a/commands/docs/from_json.md b/commands/docs/from_json.md index 37835409dfd..1b569554fe9 100644 --- a/commands/docs/from_json.md +++ b/commands/docs/from_json.md @@ -2,7 +2,7 @@ title: from json categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert JSON text into structured data. usage: | diff --git a/commands/docs/from_kdl.md b/commands/docs/from_kdl.md index 82d75a108f1..db815761afb 100644 --- a/commands/docs/from_kdl.md +++ b/commands/docs/from_kdl.md @@ -2,7 +2,7 @@ title: from kdl categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert KDL text into structured data. usage: | @@ -20,6 +20,12 @@ contributors: false ```> from kdl {flags} ``` +## Flags + + - `--spec {int}`: KDL language version (1 or 2 (default)). + - `--format {string}`: Data model: 'nodes' (default) for KDL AST rows, or 'jik' for JSON-in-KDL values. + - `--ignore-types`: Ignore type annotations (return base KDL types only). + ## Input/output types: @@ -28,7 +34,7 @@ contributors: false | string | any | ## Examples -Converts KDL formatted string to canonical node rows. +Convert KDL to node rows (default format, KDL v2). ```nu > "node attr=1 attr2=#true {bloc}" | from kdl ╭───┬──────┬────────────────┬──────────────────┬─────────────────────────────────────────────────────────────╮ @@ -45,7 +51,7 @@ Converts KDL formatted string to canonical node rows. ``` -Converts KDL formatted string to canonical node rows. +Parse a package-style KDL document into node rows. ```nu > 'package { name nu; version 0.1; description "new type of shell" }' | from kdl ╭───┬─────────┬────────────────┬───────────────────┬─────────────────────────────────────────────────────────╮ @@ -117,6 +123,81 @@ Converts KDL formatted string to canonical node rows. ``` +Parse JSON-in-KDL (v2 keywords use #true / #null). +```nu +> '- a=1 b=#true' | from kdl --format jik +╭───┬──────╮ +│ a │ 1 │ +│ b │ true │ +╰───┴──────╯ +``` + +Parse KDL v2 keyword arguments with --spec 2 (default). +```nu +> "node #true #false #null" | from kdl --spec 2 +╭───┬──────┬───────────────┬───────────────────┬────────────────╮ +│ # │ name │ args │ props │ children │ +├───┼──────┼───────────────┼───────────────────┼────────────────┤ +│ 0 │ node │ ╭───┬───────╮ │ {record 0 fields} │ [list 0 items] │ +│ │ │ │ 0 │ true │ │ │ │ +│ │ │ │ 1 │ false │ │ │ │ +│ │ │ │ 2 │ │ │ │ │ +│ │ │ ╰───┴───────╯ │ │ │ +╰───┴──────┴───────────────┴───────────────────┴────────────────╯ + +``` + +Parse KDL v1 keyword arguments with --spec 1 (bare true/false/null). +```nu +> "node true false null" | from kdl --spec 1 +╭───┬──────┬───────────────┬───────────────────┬────────────────╮ +│ # │ name │ args │ props │ children │ +├───┼──────┼───────────────┼───────────────────┼────────────────┤ +│ 0 │ node │ ╭───┬───────╮ │ {record 0 fields} │ [list 0 items] │ +│ │ │ │ 0 │ true │ │ │ │ +│ │ │ │ 1 │ false │ │ │ │ +│ │ │ │ 2 │ │ │ │ │ +│ │ │ ╰───┴───────╯ │ │ │ +╰───┴──────┴───────────────┴───────────────────┴────────────────╯ + +``` + +Parse a KDL v1 property boolean with --spec 1. +```nu +> "item 1 enabled=true" | from kdl --spec 1 +╭───┬──────┬───────────┬────────────────────┬────────────────╮ +│ # │ name │ args │ props │ children │ +├───┼──────┼───────────┼────────────────────┼────────────────┤ +│ 0 │ item │ ╭───┬───╮ │ ╭─────────┬──────╮ │ [list 0 items] │ +│ │ │ │ 0 │ 1 │ │ │ enabled │ true │ │ │ +│ │ │ ╰───┴───╯ │ ╰─────────┴──────╯ │ │ +╰───┴──────┴───────────┴────────────────────┴────────────────╯ + +``` + +Parse a KDL v2 property boolean with --spec 2. +```nu +> "item 1 enabled=#true" | from kdl --spec 2 +╭───┬──────┬───────────┬────────────────────┬────────────────╮ +│ # │ name │ args │ props │ children │ +├───┼──────┼───────────┼────────────────────┼────────────────┤ +│ 0 │ item │ ╭───┬───╮ │ ╭─────────┬──────╮ │ [list 0 items] │ +│ │ │ │ 0 │ 1 │ │ │ enabled │ true │ │ │ +│ │ │ ╰───┴───╯ │ ╰─────────┴──────╯ │ │ +╰───┴──────┴───────────┴────────────────────┴────────────────╯ + +``` + +Parse JSON-in-KDL written in KDL v1 keyword style. +```nu +> '- a=1 b=true c=null' | from kdl --format jik --spec 1 +╭───┬──────╮ +│ a │ 1 │ +│ b │ true │ +│ c │ │ +╰───┴──────╯ +``` + Duplicate sibling node names are preserved in-order. ```nu > "node one; node two" | from kdl @@ -132,3 +213,83 @@ Duplicate sibling node names are preserved in-order. ╰───┴──────┴─────────────┴───────────────────┴────────────────╯ ``` + +Promote Nushell type annotations on node arguments (filesize, duration). +```nu +> "node (filesize)1024 (duration)5000000000" | from kdl +╭───┬──────┬────────────────┬───────────────────┬────────────────╮ +│ # │ name │ args │ props │ children │ +├───┼──────┼────────────────┼───────────────────┼────────────────┤ +│ 0 │ node │ ╭───┬────────╮ │ {record 0 fields} │ [list 0 items] │ +│ │ │ │ 0 │ 1.0 kB │ │ │ │ +│ │ │ │ 1 │ 5sec │ │ │ │ +│ │ │ ╰───┴────────╯ │ │ │ +╰───┴──────┴────────────────┴───────────────────┴────────────────╯ + +``` + +Parse JSON-in-KDL with filesize, duration, and datetime (timestamp) annotations. +```nu +> '- size=(filesize)1024 wait=(duration)5000000000 when=(timestamp)"2020-01-02T03:04:05+00:00"' | from kdl --format jik +╭──────┬─────────────╮ +│ size │ 1.0 kB │ +│ wait │ 5sec │ +│ when │ 6 years ago │ +╰──────┴─────────────╯ +``` + +Accept (datetime) as an alias for (timestamp) when parsing. +```nu +> '- when=(datetime)"2020-01-02T03:04:05+00:00"' | from kdl --format jik +╭──────┬─────────────╮ +│ when │ 6 years ago │ +╰──────┴─────────────╯ +``` + +Parse cell-path, range, glob, and binary type annotations. +```nu +> '- path=(cell-path)$.1.abc span=(range)"1..3" pat=(glob)*.rs blob=(binary)AQID' | from kdl --format jik +╭──────┬───────────╮ +│ path │ $.1.abc │ +│ span │ 1..3 │ +│ pat │ *.rs │ +│ blob │ [1, 2, 3] │ +╰──────┴───────────╯ +``` + +Ignore type annotations and keep base KDL types with --ignore-types. +```nu +> '- size=(filesize)1024' | from kdl --format jik --ignore-types +╭──────┬──────╮ +│ size │ 1024 │ +╰──────┴──────╯ +``` + +JiK: multiple '-' children are a list, not an object with duplicate keys. +```nu +> '- { - a=1; - a=2 }' | from kdl --format jik +╭───┬───╮ +│ # │ a │ +├───┼───┤ +│ 0 │ 1 │ +│ 1 │ 2 │ +╰───┴───╯ + +``` + +JiK: a sole '-' child is still a one-element list unless annotated (object). +```nu +> '- { - 1 }' | from kdl --format jik +╭───┬───╮ +│ 0 │ 1 │ +╰───┴───╯ + +``` + +JiK: object with key '-' must use the (object) annotation. +```nu +> '(object)- { - 1 }' | from kdl --format jik +╭───┬───╮ +│ - │ 1 │ +╰───┴───╯ +``` diff --git a/commands/docs/from_md.md b/commands/docs/from_md.md index 24e2701cd82..cd6cbf3acd0 100644 --- a/commands/docs/from_md.md +++ b/commands/docs/from_md.md @@ -2,7 +2,7 @@ title: from md categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert markdown text into human-friendly structured rows. Use --verbose for the full AST. usage: | diff --git a/commands/docs/from_msgpack.md b/commands/docs/from_msgpack.md index fc4d02b9acc..5f52a043b46 100644 --- a/commands/docs/from_msgpack.md +++ b/commands/docs/from_msgpack.md @@ -2,7 +2,7 @@ title: from msgpack categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert MessagePack data into Nu values. usage: | @@ -61,7 +61,7 @@ Read a table from MessagePack. ╭───┬──────────────────────┬──────────────╮ │ # │ event_name │ time │ ├───┼──────────────────────┼──────────────┤ -│ 0 │ Apollo 11 Landing │ 56 years ago │ +│ 0 │ Apollo 11 Landing │ 57 years ago │ │ 1 │ Nushell first commit │ 7 years ago │ ╰───┴──────────────────────┴──────────────╯ diff --git a/commands/docs/from_msgpackz.md b/commands/docs/from_msgpackz.md index 4a275edd9b3..db8cfee68e0 100644 --- a/commands/docs/from_msgpackz.md +++ b/commands/docs/from_msgpackz.md @@ -2,7 +2,7 @@ title: from msgpackz categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert brotli-compressed MessagePack data into Nu values. usage: | diff --git a/commands/docs/from_nuon.md b/commands/docs/from_nuon.md index 85c2bd81b63..21b7e1fa938 100644 --- a/commands/docs/from_nuon.md +++ b/commands/docs/from_nuon.md @@ -2,7 +2,7 @@ title: from nuon categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert from nuon to structured data. usage: | diff --git a/commands/docs/from_ods.md b/commands/docs/from_ods.md index a3cf9a21014..5ffd3d71b50 100644 --- a/commands/docs/from_ods.md +++ b/commands/docs/from_ods.md @@ -2,7 +2,7 @@ title: from ods categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse OpenDocument Spreadsheet(.ods) data and create table. usage: | diff --git a/commands/docs/from_plist.md b/commands/docs/from_plist.md index 8eb028a3079..a2eaab3aac5 100644 --- a/commands/docs/from_plist.md +++ b/commands/docs/from_plist.md @@ -2,7 +2,7 @@ title: from plist categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert plist to Nushell values usage: | diff --git a/commands/docs/from_ssv.md b/commands/docs/from_ssv.md index 89fd7a13c11..bebd70cbb16 100644 --- a/commands/docs/from_ssv.md +++ b/commands/docs/from_ssv.md @@ -2,7 +2,7 @@ title: from ssv categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2. usage: | diff --git a/commands/docs/from_toml.md b/commands/docs/from_toml.md index 28d6d47044a..9b3cda7dddd 100644 --- a/commands/docs/from_toml.md +++ b/commands/docs/from_toml.md @@ -2,7 +2,7 @@ title: from toml categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse text as .toml and create record. usage: | diff --git a/commands/docs/from_tsv.md b/commands/docs/from_tsv.md index a34852a7e96..00719629e59 100644 --- a/commands/docs/from_tsv.md +++ b/commands/docs/from_tsv.md @@ -2,7 +2,7 @@ title: from tsv categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse text as .tsv and create table. usage: | diff --git a/commands/docs/from_url.md b/commands/docs/from_url.md index 56c251ab7eb..3600090beab 100644 --- a/commands/docs/from_url.md +++ b/commands/docs/from_url.md @@ -2,7 +2,7 @@ title: from url categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse url-encoded string as a record. usage: | diff --git a/commands/docs/from_vcf.md b/commands/docs/from_vcf.md index 0c9a7751c64..64e15f2a195 100644 --- a/commands/docs/from_vcf.md +++ b/commands/docs/from_vcf.md @@ -2,7 +2,7 @@ title: from vcf categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse text as .vcf and create table. usage: | diff --git a/commands/docs/from_xlsx.md b/commands/docs/from_xlsx.md index 876349d80de..4fe2249574e 100644 --- a/commands/docs/from_xlsx.md +++ b/commands/docs/from_xlsx.md @@ -2,7 +2,7 @@ title: from xlsx categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse binary Excel(.xlsx) data and create table. usage: | diff --git a/commands/docs/from_xml.md b/commands/docs/from_xml.md index c6d70435f40..6bbe2e14864 100644 --- a/commands/docs/from_xml.md +++ b/commands/docs/from_xml.md @@ -2,7 +2,7 @@ title: from xml categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse text as .xml and create record. usage: | diff --git a/commands/docs/from_yaml.md b/commands/docs/from_yaml.md index 2f80543e319..e1de23635fc 100644 --- a/commands/docs/from_yaml.md +++ b/commands/docs/from_yaml.md @@ -2,7 +2,7 @@ title: from yaml categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse text as .yaml/.yml and create table. usage: | @@ -20,6 +20,13 @@ contributors: false ```> from yaml {flags} ``` +## Flags + + - `--spec {string}`: YAML spec version ('1.1' or '1.2' (default)). + - `--multiple {string}`: Handle multiple documents ('auto', 'list', 'single'). + - `--ignore-tags`: Ignore any tags + - `--key-resolution {string}`: Handle plain scalar keys ('strict' (default), 'verbatim'). + ## Input/output types: @@ -28,7 +35,7 @@ contributors: false | string | any | ## Examples -Converts yaml formatted string to table. +Converts YAML formatted string to table. ```nu > 'a: 1' | from yaml ╭───┬───╮ @@ -36,7 +43,7 @@ Converts yaml formatted string to table. ╰───┴───╯ ``` -Converts yaml formatted string to table. +Converts YAML formatted string to table. ```nu > '[ a: 1, b: [1, 2] ]' | from yaml ╭───┬────┬───────────╮ @@ -50,3 +57,9 @@ Converts yaml formatted string to table. ╰───┴────┴───────────╯ ``` + +Convert nushell values from YAML. +```nu +> '!cell-path $.1.abc?.def!' | from yaml +$.1.abc?.def! +``` diff --git a/commands/docs/from_yml.md b/commands/docs/from_yml.md index 607697678a8..fccfa2fd1d2 100644 --- a/commands/docs/from_yml.md +++ b/commands/docs/from_yml.md @@ -2,7 +2,7 @@ title: from yml categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Parse text as .yaml/.yml and create table. usage: | @@ -20,6 +20,13 @@ contributors: false ```> from yml {flags} ``` +## Flags + + - `--spec {string}`: YAML spec version ('1.1' or '1.2' (default)). + - `--multiple {string}`: Handle multiple documents ('auto', 'list', 'single'). + - `--ignore-tags`: Ignore any tags + - `--key-resolution {string}`: Handle plain scalar keys ('strict' (default), 'verbatim'). + ## Input/output types: @@ -28,7 +35,7 @@ contributors: false | string | any | ## Examples -Converts yaml formatted string to table. +Converts YAML formatted string to table. ```nu > 'a: 1' | from yml ╭───┬───╮ @@ -36,7 +43,7 @@ Converts yaml formatted string to table. ╰───┴───╯ ``` -Converts yaml formatted string to table. +Converts YAML formatted string to table. ```nu > '[ a: 1, b: [1, 2] ]' | from yml ╭───┬────┬───────────╮ @@ -50,3 +57,9 @@ Converts yaml formatted string to table. ╰───┴────┴───────────╯ ``` + +Convert nushell values from YAML. +```nu +> '!cell-path $.1.abc?.def!' | from yml +$.1.abc?.def! +``` diff --git a/commands/docs/generate.md b/commands/docs/generate.md index 9c5ae7b4d41..8ba4df0baa7 100644 --- a/commands/docs/generate.md +++ b/commands/docs/generate.md @@ -2,7 +2,7 @@ title: generate categories: | generators -version: 0.114.0 +version: 0.115.0 generators: | Generate a list of values by successively invoking a closure. usage: | diff --git a/commands/docs/get.md b/commands/docs/get.md index fe225bc6fd4..74b7f1db36e 100644 --- a/commands/docs/get.md +++ b/commands/docs/get.md @@ -2,7 +2,7 @@ title: get categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Extract data using a cell path. usage: | diff --git a/commands/docs/glob.md b/commands/docs/glob.md index 59be6429e10..14392e97df6 100644 --- a/commands/docs/glob.md +++ b/commands/docs/glob.md @@ -2,7 +2,7 @@ title: glob categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Creates a list of files and/or folders based on the glob pattern provided. usage: | diff --git a/commands/docs/grid.md b/commands/docs/grid.md index f76b994f991..ca209981e4c 100644 --- a/commands/docs/grid.md +++ b/commands/docs/grid.md @@ -2,7 +2,7 @@ title: grid categories: | viewers -version: 0.114.0 +version: 0.115.0 viewers: | Renders the output to a textual terminal grid. usage: | diff --git a/commands/docs/group-by.md b/commands/docs/group-by.md index 1dfab40522b..e732594f3a2 100644 --- a/commands/docs/group-by.md +++ b/commands/docs/group-by.md @@ -2,7 +2,7 @@ title: group-by categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Splits a list or table into groups, and returns a record containing those groups. usage: | @@ -213,4 +213,5 @@ the group-by command makes some assumptions: - if the input data is not a string, the grouper will convert the key to string but the values will remain in their original format. e.g. with bools, "true" and true would be in the same group (see example). - datetime is formatted based on your configuration setting. use `format date` to change the format. - filesize is formatted based on your configuration setting. use `format filesize` to change the format. - - some nushell values are not supported, such as closures. \ No newline at end of file + - some nushell values are not supported, such as closures. + - null group keys are never mapped to the empty string. The default record output omits null groups (records cannot use null as a key); use --to-table to include them as null values. Optional cell paths (e.g. `foo?`) still ignore rows where access yields null. \ No newline at end of file diff --git a/commands/docs/gstat.md b/commands/docs/gstat.md index ce8edee6631..79b55959820 100644 --- a/commands/docs/gstat.md +++ b/commands/docs/gstat.md @@ -2,7 +2,7 @@ title: gstat categories: | prompt -version: 0.114.0 +version: 0.115.0 prompt: | Get the git status of a repo usage: | diff --git a/commands/docs/hash.md b/commands/docs/hash.md index 759bf73f1f8..0f2133d0761 100644 --- a/commands/docs/hash.md +++ b/commands/docs/hash.md @@ -2,7 +2,7 @@ title: hash categories: | hash -version: 0.114.0 +version: 0.115.0 hash: | Apply hash function. usage: | diff --git a/commands/docs/hash_md5.md b/commands/docs/hash_md5.md index 9a82a493438..db87e154701 100644 --- a/commands/docs/hash_md5.md +++ b/commands/docs/hash_md5.md @@ -2,7 +2,7 @@ title: hash md5 categories: | hash -version: 0.114.0 +version: 0.115.0 hash: | Hash a value using the md5 hash algorithm. usage: | @@ -31,12 +31,14 @@ contributors: false ## Input/output types: -| input | output | -| ------ | --------------------- | -| string | oneof<string, binary> | -| binary | oneof<string, binary> | -| table | table | -| record | record | +| input | output | +| ------------ | --------------------------- | +| string | oneof<string, binary> | +| binary | oneof<string, binary> | +| list<string> | list<oneof<string, binary>> | +| list<binary> | list<oneof<string, binary>> | +| table | table | +| record | record | ## Examples Return the md5 hash of a string, hex-encoded @@ -64,3 +66,14 @@ Return the md5 hash of a file's contents > open ./nu_0_24_1_windows.zip | hash md5 ``` + +Return the md5 hash of a list of strings +```nu +> [abc def ghi] | hash md5 +╭───┬──────────────────────────────────╮ +│ 0 │ 900150983cd24fb0d6963f7d28e17f72 │ +│ 1 │ 4ed9407630eb1000c0f6b63842defa7d │ +│ 2 │ 826bbc5d0522f5f20a1da4b60fa8c871 │ +╰───┴──────────────────────────────────╯ + +``` diff --git a/commands/docs/hash_sha256.md b/commands/docs/hash_sha256.md index 2e3801e9465..bd4dc11bfd8 100644 --- a/commands/docs/hash_sha256.md +++ b/commands/docs/hash_sha256.md @@ -2,7 +2,7 @@ title: hash sha256 categories: | hash -version: 0.114.0 +version: 0.115.0 hash: | Hash a value using the sha256 hash algorithm. usage: | @@ -31,12 +31,14 @@ contributors: false ## Input/output types: -| input | output | -| ------ | --------------------- | -| string | oneof<string, binary> | -| binary | oneof<string, binary> | -| table | table | -| record | record | +| input | output | +| ------------ | --------------------------- | +| string | oneof<string, binary> | +| binary | oneof<string, binary> | +| list<string> | list<oneof<string, binary>> | +| list<binary> | list<oneof<string, binary>> | +| table | table | +| record | record | ## Examples Return the sha256 hash of a string, hex-encoded @@ -65,3 +67,14 @@ Return the sha256 hash of a file's contents > open ./nu_0_24_1_windows.zip | hash sha256 ``` + +Return the sha256 hash of a list of strings +```nu +> [abc def ghi] | hash sha256 +╭───┬──────────────────────────────────────────────────────────────────╮ +│ 0 │ ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad │ +│ 1 │ cb8379ac2098aa165029e3938a51da0bcecfc008fd6795f401178647f96c5b34 │ +│ 2 │ 50ae61e841fac4e8f9e40baf2ad36ec868922ea48368c18f9535e47db56dd7fb │ +╰───┴──────────────────────────────────────────────────────────────────╯ + +``` diff --git a/commands/docs/headers.md b/commands/docs/headers.md index ad443de68ae..6ea155e77ae 100644 --- a/commands/docs/headers.md +++ b/commands/docs/headers.md @@ -2,7 +2,7 @@ title: headers categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Use the first row of the table as column names. usage: | diff --git a/commands/docs/help.md b/commands/docs/help.md index 20df505b20f..b9e0ae3611e 100644 --- a/commands/docs/help.md +++ b/commands/docs/help.md @@ -2,7 +2,7 @@ title: help categories: | core -version: 0.114.0 +version: 0.115.0 core: | Display help information about different parts of Nushell. usage: | diff --git a/commands/docs/help_aliases.md b/commands/docs/help_aliases.md index 17b5dc33120..ae3f88d33e5 100644 --- a/commands/docs/help_aliases.md +++ b/commands/docs/help_aliases.md @@ -2,7 +2,7 @@ title: help aliases categories: | core -version: 0.114.0 +version: 0.115.0 core: | Show help on nushell aliases. usage: | diff --git a/commands/docs/help_commands.md b/commands/docs/help_commands.md index 7c0b993c24e..bea1ce20267 100644 --- a/commands/docs/help_commands.md +++ b/commands/docs/help_commands.md @@ -2,7 +2,7 @@ title: help commands categories: | core -version: 0.114.0 +version: 0.115.0 core: | Show help on nushell commands. usage: | diff --git a/commands/docs/help_escapes.md b/commands/docs/help_escapes.md index e14166b4861..bb4a759c609 100644 --- a/commands/docs/help_escapes.md +++ b/commands/docs/help_escapes.md @@ -2,7 +2,7 @@ title: help escapes categories: | core -version: 0.114.0 +version: 0.115.0 core: | Show help on nushell string escapes. usage: | diff --git a/commands/docs/help_externs.md b/commands/docs/help_externs.md index b16578b5642..9f0d8a31830 100644 --- a/commands/docs/help_externs.md +++ b/commands/docs/help_externs.md @@ -2,7 +2,7 @@ title: help externs categories: | core -version: 0.114.0 +version: 0.115.0 core: | Show help on nushell externs. usage: | diff --git a/commands/docs/help_modules.md b/commands/docs/help_modules.md index f943cdc3c34..6d286695534 100644 --- a/commands/docs/help_modules.md +++ b/commands/docs/help_modules.md @@ -2,7 +2,7 @@ title: help modules categories: | core -version: 0.114.0 +version: 0.115.0 core: | Show help on nushell modules. usage: | diff --git a/commands/docs/help_operators.md b/commands/docs/help_operators.md index 57b5c4e60a7..b4be4deceeb 100644 --- a/commands/docs/help_operators.md +++ b/commands/docs/help_operators.md @@ -2,7 +2,7 @@ title: help operators categories: | core -version: 0.114.0 +version: 0.115.0 core: | Show help on nushell operators. usage: | diff --git a/commands/docs/help_pipe-and-redirect.md b/commands/docs/help_pipe-and-redirect.md index ffefe7a2e36..58b12b8138b 100644 --- a/commands/docs/help_pipe-and-redirect.md +++ b/commands/docs/help_pipe-and-redirect.md @@ -2,7 +2,7 @@ title: help pipe-and-redirect categories: | core -version: 0.114.0 +version: 0.115.0 core: | Show help on nushell pipes and redirects. usage: | diff --git a/commands/docs/hide-env.md b/commands/docs/hide-env.md index 34545081d5c..4bd3456b38c 100644 --- a/commands/docs/hide-env.md +++ b/commands/docs/hide-env.md @@ -2,7 +2,7 @@ title: hide-env categories: | core -version: 0.114.0 +version: 0.115.0 core: | Hide environment variables in the current scope. usage: | diff --git a/commands/docs/hide.md b/commands/docs/hide.md index bb51917e935..766d09c0b98 100644 --- a/commands/docs/hide.md +++ b/commands/docs/hide.md @@ -2,7 +2,7 @@ title: hide categories: | core -version: 0.114.0 +version: 0.115.0 core: | Hide definitions in the current scope. usage: | diff --git a/commands/docs/histogram.md b/commands/docs/histogram.md index d110bccf230..d5b84a40a30 100644 --- a/commands/docs/histogram.md +++ b/commands/docs/histogram.md @@ -2,7 +2,7 @@ title: histogram categories: | chart -version: 0.114.0 +version: 0.115.0 chart: | Creates a new table with a histogram based on the column name passed in. usage: | diff --git a/commands/docs/history.md b/commands/docs/history.md index df0e8298b48..b8373b53776 100644 --- a/commands/docs/history.md +++ b/commands/docs/history.md @@ -2,7 +2,7 @@ title: history categories: | history -version: 0.114.0 +version: 0.115.0 history: | Get the command history. usage: | diff --git a/commands/docs/history_import.md b/commands/docs/history_import.md index 4e6774c8613..a3dea002be8 100644 --- a/commands/docs/history_import.md +++ b/commands/docs/history_import.md @@ -2,7 +2,7 @@ title: history import categories: | history -version: 0.114.0 +version: 0.115.0 history: | Import command line history. usage: | diff --git a/commands/docs/history_session.md b/commands/docs/history_session.md index 6fbd7d7a7a0..70b5024bb46 100644 --- a/commands/docs/history_session.md +++ b/commands/docs/history_session.md @@ -2,7 +2,7 @@ title: history session categories: | history -version: 0.114.0 +version: 0.115.0 history: | Get the command history session. usage: | diff --git a/commands/docs/http.md b/commands/docs/http.md index e0c4090845d..b6e783fe48b 100644 --- a/commands/docs/http.md +++ b/commands/docs/http.md @@ -2,7 +2,7 @@ title: http categories: | network -version: 0.114.0 +version: 0.115.0 network: | Various commands for working with http methods. usage: | diff --git a/commands/docs/http_delete.md b/commands/docs/http_delete.md index 0631980fa6b..7fe67de7d52 100644 --- a/commands/docs/http_delete.md +++ b/commands/docs/http_delete.md @@ -2,7 +2,7 @@ title: http delete categories: | network -version: 0.114.0 +version: 0.115.0 network: | Delete the specified resource. usage: | diff --git a/commands/docs/http_get.md b/commands/docs/http_get.md index 22b67fe3a22..61a9db94c9a 100644 --- a/commands/docs/http_get.md +++ b/commands/docs/http_get.md @@ -2,7 +2,7 @@ title: http get categories: | network -version: 0.114.0 +version: 0.115.0 network: | Fetch the contents from a URL. usage: | diff --git a/commands/docs/http_head.md b/commands/docs/http_head.md index bf727cfe2f7..149d2bc2898 100644 --- a/commands/docs/http_head.md +++ b/commands/docs/http_head.md @@ -2,7 +2,7 @@ title: http head categories: | network -version: 0.114.0 +version: 0.115.0 network: | Get the headers from a URL. usage: | diff --git a/commands/docs/http_options.md b/commands/docs/http_options.md index 35cbd08f583..6c94ac70f60 100644 --- a/commands/docs/http_options.md +++ b/commands/docs/http_options.md @@ -2,7 +2,7 @@ title: http options categories: | network -version: 0.114.0 +version: 0.115.0 network: | Requests permitted communication options for a given URL. usage: | diff --git a/commands/docs/http_patch.md b/commands/docs/http_patch.md index 8a2d19a2eac..dca68dd96ef 100644 --- a/commands/docs/http_patch.md +++ b/commands/docs/http_patch.md @@ -2,7 +2,7 @@ title: http patch categories: | network -version: 0.114.0 +version: 0.115.0 network: | Send a PATCH request to a URL with a request body. usage: | diff --git a/commands/docs/http_pool.md b/commands/docs/http_pool.md index 0154073830d..f0109b42c14 100644 --- a/commands/docs/http_pool.md +++ b/commands/docs/http_pool.md @@ -2,7 +2,7 @@ title: http pool categories: | network -version: 0.114.0 +version: 0.115.0 network: | Configure and reset builtin http connection pool. usage: | diff --git a/commands/docs/http_post.md b/commands/docs/http_post.md index e5f633d7c70..ca78c669ade 100644 --- a/commands/docs/http_post.md +++ b/commands/docs/http_post.md @@ -2,7 +2,7 @@ title: http post categories: | network -version: 0.114.0 +version: 0.115.0 network: | Send a POST request to a URL with a request body. usage: | diff --git a/commands/docs/http_put.md b/commands/docs/http_put.md index 22c8929b0d8..d8f994e0c3d 100644 --- a/commands/docs/http_put.md +++ b/commands/docs/http_put.md @@ -2,7 +2,7 @@ title: http put categories: | network -version: 0.114.0 +version: 0.115.0 network: | Send a PUT request to a URL with a request body. usage: | diff --git a/commands/docs/idx.md b/commands/docs/idx.md index f9cf534f351..15a55c9b050 100644 --- a/commands/docs/idx.md +++ b/commands/docs/idx.md @@ -2,7 +2,7 @@ title: idx categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Manage in-memory file index state. usage: | @@ -27,7 +27,7 @@ contributors: false | ------- | ------ | | nothing | string | ## Notes -Use one of the subcommands: init, status, find, search, export, import, drop, dirs, files. Watch mode keeps the index warm as files change; disable it when you only need a snapshot of the current tree. +Use one of the subcommands: init, status, find, search, watch, drop, dirs, files. By default `idx init` enables filesystem watching so the index updates as files change; pass `--no-watch` for a static index. Use `idx watch` to stream change events from that live index into a pipeline. ## Subcommands: @@ -35,10 +35,9 @@ Use one of the subcommands: init, status, find, search, export, import, drop, di | -------------------------------------------- | ----------------------------------------------------------------------- | -------- | | [`idx dirs`](/commands/docs/idx_dirs.md) | List indexed directories, or fuzzy-match directories by query. | built-in | | [`idx drop`](/commands/docs/idx_drop.md) | Drop the current idx runtime from memory. | built-in | -| [`idx export`](/commands/docs/idx_export.md) | Persist idx state to disk. | built-in | | [`idx files`](/commands/docs/idx_files.md) | List indexed files, or fuzzy-match files by query. | built-in | | [`idx find`](/commands/docs/idx_find.md) | Search idx with fuzzy matching across files and directories by default. | built-in | -| [`idx import`](/commands/docs/idx_import.md) | Import idx state from disk. | built-in | | [`idx init`](/commands/docs/idx_init.md) | Initialize the in-memory idx index for a path. | built-in | | [`idx search`](/commands/docs/idx_search.md) | Search indexed file contents. | built-in | -| [`idx status`](/commands/docs/idx_status.md) | Show status information for the global in-memory idx runtime. | built-in | \ No newline at end of file +| [`idx status`](/commands/docs/idx_status.md) | Show status information for the global in-memory idx runtime. | built-in | +| [`idx watch`](/commands/docs/idx_watch.md) | Stream filesystem change events from the live idx index. | built-in | \ No newline at end of file diff --git a/commands/docs/idx_dirs.md b/commands/docs/idx_dirs.md index 5ce55328a79..9195894ff8f 100644 --- a/commands/docs/idx_dirs.md +++ b/commands/docs/idx_dirs.md @@ -2,7 +2,7 @@ title: idx dirs categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | List indexed directories, or fuzzy-match directories by query. usage: | diff --git a/commands/docs/idx_drop.md b/commands/docs/idx_drop.md index d76a0bd3f7b..efc6587a33e 100644 --- a/commands/docs/idx_drop.md +++ b/commands/docs/idx_drop.md @@ -2,7 +2,7 @@ title: idx drop categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Drop the current idx runtime from memory. usage: | @@ -27,4 +27,4 @@ contributors: false | ------- | ------ | | nothing | record | ## Notes -Use this when you want to free the in-memory index completely before reinitializing or restoring a different snapshot. \ No newline at end of file +Use this when you want to free the in-memory index completely before reinitializing it. \ No newline at end of file diff --git a/commands/docs/idx_export.md b/commands/docs/idx_export.md deleted file mode 100644 index a64ffc9e4fe..00000000000 --- a/commands/docs/idx_export.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: idx export -categories: | - filesystem -version: 0.114.0 -filesystem: | - Persist idx state to disk. -usage: | - Persist idx state to disk. -editLink: false -contributors: false ---- - - -# `idx export` for [filesystem](/commands/categories/filesystem.md) - -
Persist idx state to disk.
- -## Signature - -```> idx export {flags} (filepath)``` - -## Parameters - - - `filepath`: Path where idx snapshot should be stored. - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | record | -## Examples - -Save the current idx index to disk. -```nu -> idx export ~/my-index.db - -``` - -## Notes -The snapshot is stored as a SQLite database. Use `idx import` to reload it. \ No newline at end of file diff --git a/commands/docs/idx_files.md b/commands/docs/idx_files.md index 7d8f83db514..106fa1f5062 100644 --- a/commands/docs/idx_files.md +++ b/commands/docs/idx_files.md @@ -2,7 +2,7 @@ title: idx files categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | List indexed files, or fuzzy-match files by query. usage: | diff --git a/commands/docs/idx_find.md b/commands/docs/idx_find.md index 252e5a17c3f..94704272d80 100644 --- a/commands/docs/idx_find.md +++ b/commands/docs/idx_find.md @@ -2,7 +2,7 @@ title: idx find categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Search idx with fuzzy matching across files and directories by default. usage: | diff --git a/commands/docs/idx_import.md b/commands/docs/idx_import.md deleted file mode 100644 index 2710a67b2f7..00000000000 --- a/commands/docs/idx_import.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: idx import -categories: | - filesystem -version: 0.114.0 -filesystem: | - Import idx state from disk. -usage: | - Import idx state from disk. -editLink: false -contributors: false ---- - - -# `idx import` for [filesystem](/commands/categories/filesystem.md) - -
Import idx state from disk.
- -## Signature - -```> idx import {flags} (filepath)``` - -## Flags - - - `--no-watch`: Disable filesystem watching after import (watching is enabled by default). - -## Parameters - - - `filepath`: Path to a stored idx snapshot. - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | record | -## Examples - -Restore an idx index from a snapshot on disk. -```nu -> idx import ~/my-index.db - -``` - -## Notes -Reads a SQLite snapshot created by `idx export` and auto-initializes idx runtime for immediate queries. \ No newline at end of file diff --git a/commands/docs/idx_init.md b/commands/docs/idx_init.md index 1b9f24d1cbb..0588bba0ede 100644 --- a/commands/docs/idx_init.md +++ b/commands/docs/idx_init.md @@ -2,7 +2,7 @@ title: idx init categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Initialize the in-memory idx index for a path. usage: | @@ -58,4 +58,4 @@ Initialize idx without filesystem watching. ``` ## Notes -By default idx init returns immediately and indexing continues in the background. Use `idx status` to check when scanning completes. Pass `--wait` to block until the initial scan finishes. Filesystem watching is enabled by default; pass `--no-watch` to disable it. \ No newline at end of file +By default idx init returns immediately and indexing continues in the background. Use `idx status` to check when scanning completes. Pass `--wait` to block until the initial scan finishes. Filesystem watching is enabled by default so the index stays warm and `idx watch` can stream events; pass `--no-watch` to disable both. \ No newline at end of file diff --git a/commands/docs/idx_search.md b/commands/docs/idx_search.md index dc4cc37f2ab..986865652d5 100644 --- a/commands/docs/idx_search.md +++ b/commands/docs/idx_search.md @@ -2,7 +2,7 @@ title: idx search categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Search indexed file contents. usage: | @@ -59,7 +59,7 @@ Search with multiple patterns simultaneously. Include 2 lines of context before and 5 lines after each match. ```nu -> idx search error -2..5 +> idx search --context -2..5 error ``` diff --git a/commands/docs/idx_status.md b/commands/docs/idx_status.md index 410d8f4b50f..ccf5a06c6a6 100644 --- a/commands/docs/idx_status.md +++ b/commands/docs/idx_status.md @@ -2,7 +2,7 @@ title: idx status categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Show status information for the global in-memory idx runtime. usage: | diff --git a/commands/docs/idx_watch.md b/commands/docs/idx_watch.md new file mode 100644 index 00000000000..d702c0bff74 --- /dev/null +++ b/commands/docs/idx_watch.md @@ -0,0 +1,72 @@ +--- +title: idx watch +categories: | + filesystem +version: 0.115.0 +filesystem: | + Stream filesystem change events from the live idx index. +usage: | + Stream filesystem change events from the live idx index. +editLink: false +contributors: false +--- + + +# `idx watch` for [filesystem](/commands/categories/filesystem.md) + +
Stream filesystem change events from the live idx index.
+ +## Signature + +```> idx watch {flags} (pattern)``` + +## Flags + + - `--ignore, -i {list}`: List of globs or path-prefixes to exclude. + - `--timeout, -t {duration}`: Stop streaming after this duration. + - `--max-events, -n {int}`: Stop after emitting this many events. + +## Parameters + + - `pattern`: Base-relative glob, path, or directory to watch. Omit or pass empty to watch the whole indexed tree. + + +## Input/output types: + +| input | output | +| ------- | --------------------------------- | +| nothing | table<kind: string, path: string> | +## Examples + +Watch the whole indexed tree after initializing idx. +```nu +> idx init .; idx watch + +``` + +Watch only Rust files, ignoring a vendor-style path prefix. +```nu +> idx watch "**/*.rs" --ignore [target] + +``` + +Take action on modified files in a pipeline. +```nu +> idx watch | where kind == "modified" | each { |e| print $"changed: ($e.path)" } + +``` + +Stop after a single event (useful in scripts). +```nu +> idx watch --max-events 1 + +``` + +Stop after a duration if no more events are needed. +```nu +> idx watch --timeout 5sec + +``` + +## Notes +Requires a live runtime initialized without `--no-watch`. Events are debounced by fff-search and emitted as records with `kind` (`created`, `modified`, `removed`, `rescan`) and absolute `path`. Gitignored and other index-ignored files do not produce events. Patterns must be inside the indexed base path. Use plain `watch` for ad-hoc path watching without an index. \ No newline at end of file diff --git a/commands/docs/if.md b/commands/docs/if.md index 389b8279e1c..9b5b6f00a9b 100644 --- a/commands/docs/if.md +++ b/commands/docs/if.md @@ -2,7 +2,7 @@ title: if categories: | core -version: 0.114.0 +version: 0.115.0 core: | Conditionally run a block. usage: | diff --git a/commands/docs/ignore.md b/commands/docs/ignore.md index 82e89575dda..6fcba1a8259 100644 --- a/commands/docs/ignore.md +++ b/commands/docs/ignore.md @@ -2,7 +2,7 @@ title: ignore categories: | core -version: 0.114.0 +version: 0.115.0 core: | Ignore selected output streams from the previous command in the pipeline. usage: | diff --git a/commands/docs/inc.md b/commands/docs/inc.md index 44cd95ccd6b..5415525fb3f 100644 --- a/commands/docs/inc.md +++ b/commands/docs/inc.md @@ -2,7 +2,7 @@ title: inc categories: | default -version: 0.114.0 +version: 0.115.0 default: | Increment a value or version. Optionally use the column of a table. usage: | diff --git a/commands/docs/input.md b/commands/docs/input.md index d9eaea758be..ebbde075288 100644 --- a/commands/docs/input.md +++ b/commands/docs/input.md @@ -2,7 +2,7 @@ title: input categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Get input from the user via the terminal. usage: | diff --git a/commands/docs/input_list.md b/commands/docs/input_list.md index d8e01c59c2c..b63654f6866 100644 --- a/commands/docs/input_list.md +++ b/commands/docs/input_list.md @@ -2,7 +2,7 @@ title: input list categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Display an interactive list for user selection. usage: | diff --git a/commands/docs/input_listen.md b/commands/docs/input_listen.md index 1bde52e8126..56a4359a0cd 100644 --- a/commands/docs/input_listen.md +++ b/commands/docs/input_listen.md @@ -2,7 +2,7 @@ title: input listen categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Listen for user interface events. usage: | @@ -29,9 +29,9 @@ contributors: false ## Input/output types: -| input | output | -| ------- | ------------------------------------------------ | -| nothing | record<keycode: string, modifiers: list<string>> | +| input | output | +| ------- | ----------------------------------------------------------------------------- | +| nothing | record<type: string, key_type: string, code: string, modifiers: list<string>> | ## Examples Listen for a keyboard shortcut and find out how nu receives it. diff --git a/commands/docs/insert.md b/commands/docs/insert.md index f0f0ff3139b..45652d8dffd 100644 --- a/commands/docs/insert.md +++ b/commands/docs/insert.md @@ -2,7 +2,7 @@ title: insert categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Insert a new column, using an expression or closure to create each row's values. usage: | diff --git a/commands/docs/inspect.md b/commands/docs/inspect.md index a949f7ef9c3..0d7c77984cb 100644 --- a/commands/docs/inspect.md +++ b/commands/docs/inspect.md @@ -2,7 +2,7 @@ title: inspect categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Inspect pipeline results while running a pipeline. usage: | diff --git a/commands/docs/interleave.md b/commands/docs/interleave.md index 4d4016ab76c..9da97fb9981 100644 --- a/commands/docs/interleave.md +++ b/commands/docs/interleave.md @@ -2,7 +2,7 @@ title: interleave categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Read multiple streams in parallel and combine them into one stream. usage: | diff --git a/commands/docs/intersect.md b/commands/docs/intersect.md index 74fc8522ee7..def127ba191 100644 --- a/commands/docs/intersect.md +++ b/commands/docs/intersect.md @@ -2,7 +2,7 @@ title: intersect categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Returns a list of unique elements present in both the input and the provided list. usage: | diff --git a/commands/docs/into.md b/commands/docs/into.md index 1f7b2d06e50..f41396db3a7 100644 --- a/commands/docs/into.md +++ b/commands/docs/into.md @@ -2,7 +2,7 @@ title: into categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Commands to convert data from one type to another. usage: | @@ -31,20 +31,21 @@ You must use one of the following subcommands. Using this command as-is will onl ## Subcommands: -| name | description | type | -| ---------------------------------------------------------- | ------------------------------------------ | -------- | -| [`into binary`](/commands/docs/into_binary.md) | Convert value to a binary primitive. | built-in | -| [`into bool`](/commands/docs/into_bool.md) | Convert value to a boolean. | built-in | -| [`into cell-path`](/commands/docs/into_cell-path.md) | Convert value to a cell-path. | built-in | -| [`into datetime`](/commands/docs/into_datetime.md) | Convert text or timestamp into a datetime. | built-in | -| [`into duration`](/commands/docs/into_duration.md) | Convert value to a duration. | built-in | -| [`into filesize`](/commands/docs/into_filesize.md) | Convert value to a filesize. | built-in | -| [`into float`](/commands/docs/into_float.md) | Convert data into floating point number. | built-in | -| [`into glob`](/commands/docs/into_glob.md) | Convert value to a glob pattern. | built-in | -| [`into int`](/commands/docs/into_int.md) | Convert value to an integer. | built-in | -| [`into record`](/commands/docs/into_record.md) | Convert value to a record. | built-in | -| [`into semver`](/commands/docs/into_semver.md) | Convert a value to a semantic version. | built-in | -| [`into semver-range`](/commands/docs/into_semver-range.md) | Convert a string to a semver range. | built-in | -| [`into sqlite`](/commands/docs/into_sqlite.md) | Convert table into a SQLite database. | built-in | -| [`into string`](/commands/docs/into_string.md) | Convert value to a string. | built-in | -| [`into value`](/commands/docs/into_value.md) | Convert custom values into base values. | built-in | \ No newline at end of file +| name | description | type | +| ---------------------------------------------------------- | ------------------------------------------------------------------ | -------- | +| [`into binary`](/commands/docs/into_binary.md) | Convert value to a binary primitive. | built-in | +| [`into bool`](/commands/docs/into_bool.md) | Convert value to a boolean. | built-in | +| [`into cell-path`](/commands/docs/into_cell-path.md) | Convert value to a cell-path. | built-in | +| [`into datetime`](/commands/docs/into_datetime.md) | Convert text or timestamp into a datetime. | built-in | +| [`into duration`](/commands/docs/into_duration.md) | Convert value to a duration. | built-in | +| [`into filesize`](/commands/docs/into_filesize.md) | Convert value to a filesize. | built-in | +| [`into float`](/commands/docs/into_float.md) | Convert data into floating point number. | built-in | +| [`into glob`](/commands/docs/into_glob.md) | Convert value to a glob pattern. | built-in | +| [`into int`](/commands/docs/into_int.md) | Convert value to an integer. | built-in | +| [`into matrix`](/commands/docs/into_matrix.md) | Convert a nushell table or list of lists into a matrix. | built-in | +| [`into record`](/commands/docs/into_record.md) | Convert value to a record. | built-in | +| [`into semver`](/commands/docs/into_semver.md) | Convert a value (string, record, or semver) to a semantic version. | built-in | +| [`into semver-range`](/commands/docs/into_semver-range.md) | Convert a string to a semver range. | built-in | +| [`into sqlite`](/commands/docs/into_sqlite.md) | Convert table into a SQLite database. | built-in | +| [`into string`](/commands/docs/into_string.md) | Convert value to a string. | built-in | +| [`into value`](/commands/docs/into_value.md) | Convert custom values into base values. | built-in | \ No newline at end of file diff --git a/commands/docs/into_binary.md b/commands/docs/into_binary.md index 6aa95c62558..11e657d6fe4 100644 --- a/commands/docs/into_binary.md +++ b/commands/docs/into_binary.md @@ -2,7 +2,7 @@ title: into binary categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert value to a binary primitive. usage: | @@ -40,6 +40,7 @@ contributors: false | string | binary | | bool | binary | | filesize | binary | +| duration | binary | | datetime | binary | | table | table | | record | record | @@ -115,3 +116,11 @@ Length: 1 (0x1) bytes | null_char printable whitespace ascii_other non_ascii 00000000: 0a _ ``` + +convert a duration to a nushell binary primitive. +```nu +> 1sec | into binary +Length: 8 (0x8) bytes | null_char printable whitespace ascii_other non_ascii +00000000: 00 ca 9a 3b 00 00 00 00 0××;0000 + +``` diff --git a/commands/docs/into_bool.md b/commands/docs/into_bool.md index 9d61322a5bf..fa78a3ca6f4 100644 --- a/commands/docs/into_bool.md +++ b/commands/docs/into_bool.md @@ -2,7 +2,7 @@ title: into bool categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert value to a boolean. usage: | diff --git a/commands/docs/into_cell-path.md b/commands/docs/into_cell-path.md index f4da650ce9f..35a81e50cf0 100644 --- a/commands/docs/into_cell-path.md +++ b/commands/docs/into_cell-path.md @@ -2,7 +2,7 @@ title: into cell-path categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert value to a cell-path. usage: | diff --git a/commands/docs/into_datetime.md b/commands/docs/into_datetime.md index 7952f76b439..77e028b1646 100644 --- a/commands/docs/into_datetime.md +++ b/commands/docs/into_datetime.md @@ -2,7 +2,7 @@ title: into datetime categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert text or timestamp into a datetime. usage: | @@ -34,17 +34,18 @@ contributors: false ## Input/output types: -| input | output | -| ------------ | -------------- | -| datetime | datetime | -| int | datetime | -| string | datetime | -| list<string> | list<datetime> | -| table | table | -| nothing | table | -| record | record | -| record | datetime | -| any | table | +| input | output | +| -------------- | -------------- | +| datetime | datetime | +| int | datetime | +| string | datetime | +| list<string> | list<datetime> | +| list<datetime> | list<datetime> | +| table | table | +| nothing | table | +| record | record | +| record | datetime | +| any | table | ## Examples Convert timestamp string to datetime with timezone offset. @@ -105,3 +106,13 @@ Convert list of timestamps to datetimes. ╰───┴─────────────╯ ``` + +Passing a list of datetimes through is a no-op. +```nu +> [2023-03-30T10:10:07-05:00, 2023-05-05T13:43:49-05:00] | into datetime +╭───┬─────────────╮ +│ 0 │ 3 years ago │ +│ 1 │ 3 years ago │ +╰───┴─────────────╯ + +``` diff --git a/commands/docs/into_duration.md b/commands/docs/into_duration.md index bdd9a4924f6..61f18900059 100644 --- a/commands/docs/into_duration.md +++ b/commands/docs/into_duration.md @@ -2,7 +2,7 @@ title: into duration categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert value to a duration. usage: | diff --git a/commands/docs/into_filesize.md b/commands/docs/into_filesize.md index 88361532872..3908f7ebd1f 100644 --- a/commands/docs/into_filesize.md +++ b/commands/docs/into_filesize.md @@ -2,7 +2,7 @@ title: into filesize categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert value to a filesize. usage: | diff --git a/commands/docs/into_float.md b/commands/docs/into_float.md index 3f29a831b2f..efe0d548e11 100644 --- a/commands/docs/into_float.md +++ b/commands/docs/into_float.md @@ -2,7 +2,7 @@ title: into float categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert data into floating point number. usage: | diff --git a/commands/docs/into_glob.md b/commands/docs/into_glob.md index 75d9c6956d9..3dc4df48438 100644 --- a/commands/docs/into_glob.md +++ b/commands/docs/into_glob.md @@ -2,7 +2,7 @@ title: into glob categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert value to a glob pattern. usage: | diff --git a/commands/docs/into_int.md b/commands/docs/into_int.md index 4f38489b436..d6f2107c862 100644 --- a/commands/docs/into_int.md +++ b/commands/docs/into_int.md @@ -2,7 +2,7 @@ title: into int categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert value to an integer. usage: | diff --git a/commands/docs/into_matrix.md b/commands/docs/into_matrix.md new file mode 100644 index 00000000000..f39bf726d74 --- /dev/null +++ b/commands/docs/into_matrix.md @@ -0,0 +1,42 @@ +--- +title: into matrix +categories: | + conversions +version: 0.115.0 +conversions: | + Convert a nushell table or list of lists into a matrix. +usage: | + Convert a nushell table or list of lists into a matrix. +editLink: false +contributors: false +--- + + +# `into matrix` for [conversions](/commands/categories/conversions.md) + +
Convert a nushell table or list of lists into a matrix.
+ +## Signature + +```> into matrix {flags} ``` + + +## Input/output types: + +| input | output | +| ------------------ | ------ | +| table | matrix | +| list<list<number>> | matrix | +## Examples + +Convert a list of lists to a matrix +```nu +> [[1 2 3] [4 5 6]] | into matrix | matrix into-nu | to nuon +[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]] +``` + +Convert a list of records to a matrix +```nu +> [{a: 1 b: 2} {a: 3 b: 4}] | into matrix | matrix into-nu | to nuon +[[1.0, 2.0], [3.0, 4.0]] +``` diff --git a/commands/docs/into_record.md b/commands/docs/into_record.md index 9ffbbd95bff..c7375c3e570 100644 --- a/commands/docs/into_record.md +++ b/commands/docs/into_record.md @@ -2,7 +2,7 @@ title: into record categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert value to a record. usage: | diff --git a/commands/docs/into_semver-range.md b/commands/docs/into_semver-range.md index 0ef6362d546..99a48a6c921 100644 --- a/commands/docs/into_semver-range.md +++ b/commands/docs/into_semver-range.md @@ -2,7 +2,7 @@ title: into semver-range categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert a string to a semver range. usage: | @@ -20,6 +20,10 @@ contributors: false ```> into semver-range {flags} ``` +## Flags + + - `--loose, -l`: Allow common non-strict version prefixes such as v1.2.3, v.1.2.3, v:1.2.3, v-1.2.3, or v_1.2.3 inside the range + ## Input/output types: @@ -40,3 +44,9 @@ Convert a complex range > '^1.2.3' | into semver-range ``` + +Parse a range with a leading v on the version +```nu +> '>=v1.0.0' | into semver-range --loose + +``` diff --git a/commands/docs/into_semver.md b/commands/docs/into_semver.md index a1f16d0efd3..2bf40096eb3 100644 --- a/commands/docs/into_semver.md +++ b/commands/docs/into_semver.md @@ -2,11 +2,11 @@ title: into semver categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | - Convert a value to a semantic version. + Convert a value (string, record, or semver) to a semantic version. usage: | - Convert a value to a semantic version. + Convert a value (string, record, or semver) to a semantic version. editLink: false contributors: false --- @@ -14,20 +14,34 @@ contributors: false # `into semver` for [conversions](/commands/categories/conversions.md) -
Convert a value to a semantic version.
+
Convert a value (string, record, or semver) to a semantic version.
## Signature -```> into semver {flags} ``` +```> into semver {flags} ...rest``` + +## Flags + + - `--loose, -l`: Allow common non-strict prefixes such as v1.2.3, v.1.2.3, v:1.2.3, v-1.2.3, or v_1.2.3 + +## Parameters + + - `...rest`: For a data structure input, convert data at the given cell paths. ## Input/output types: -| input | output | -| ------ | ------ | -| string | semver | -| semver | semver | -| record | semver | +| input | output | +| ------------ | ------------ | +| string | semver | +| semver | semver | +| record | semver | +| record | record | +| table | table | +| list<string> | list<semver> | +| list<semver> | list<semver> | +| table | list<semver> | +| any | semver | ## Examples Convert a string to a semver value @@ -47,3 +61,18 @@ Convert a record to a semver value > {major: 1, minor: 2, patch: 3} | into semver ``` + +Parse a version with a common leading v prefix +```nu +> 'v1.2.3' | into semver --loose + +``` + +Parse versions like v.1.2.3, v:1.2.3, v-1.2.3, or v_1.2.3 +```nu +> ['v.1.2.3' 'v:2.0.0' 'v-3.0.0' 'v_4.0.0'] | into semver --loose + +``` + +## Notes +From a record: major/minor/patch are required; pre, build, and prefix are optional. prefix is display-only metadata (e.g. "v"); re-parsing from text with --loose only accepts recognized loose prefixes (v/V with optional . : - _). \ No newline at end of file diff --git a/commands/docs/into_sqlite.md b/commands/docs/into_sqlite.md index 4d297139caf..37f47d737ea 100644 --- a/commands/docs/into_sqlite.md +++ b/commands/docs/into_sqlite.md @@ -2,7 +2,7 @@ title: into sqlite categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert table into a SQLite database. usage: | diff --git a/commands/docs/into_string.md b/commands/docs/into_string.md index 38183ed54b4..dda1680b435 100644 --- a/commands/docs/into_string.md +++ b/commands/docs/into_string.md @@ -2,7 +2,7 @@ title: into string categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert value to a string. usage: | diff --git a/commands/docs/into_value.md b/commands/docs/into_value.md index e6cb3701241..157c17d73e5 100644 --- a/commands/docs/into_value.md +++ b/commands/docs/into_value.md @@ -2,7 +2,7 @@ title: into value categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Convert custom values into base values. usage: | diff --git a/commands/docs/is-admin.md b/commands/docs/is-admin.md index 6ec6b51ae9d..e1906ab383b 100644 --- a/commands/docs/is-admin.md +++ b/commands/docs/is-admin.md @@ -2,7 +2,7 @@ title: is-admin categories: | core -version: 0.114.0 +version: 0.115.0 core: | Check if nushell is running with administrator or root privileges. usage: | diff --git a/commands/docs/is-empty.md b/commands/docs/is-empty.md index 55973e69846..a1b86d027e6 100644 --- a/commands/docs/is-empty.md +++ b/commands/docs/is-empty.md @@ -2,7 +2,7 @@ title: is-empty categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Check for empty values. usage: | diff --git a/commands/docs/is-not-empty.md b/commands/docs/is-not-empty.md index 4f998658fb5..701d1bd118e 100644 --- a/commands/docs/is-not-empty.md +++ b/commands/docs/is-not-empty.md @@ -2,7 +2,7 @@ title: is-not-empty categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Check for non-empty values. usage: | diff --git a/commands/docs/is-redirected.md b/commands/docs/is-redirected.md new file mode 100644 index 00000000000..36a235438a1 --- /dev/null +++ b/commands/docs/is-redirected.md @@ -0,0 +1,71 @@ +--- +title: is-redirected +categories: | + platform +version: 0.115.0 +platform: | + Check if the current custom command's return value is redirected away from display. +usage: | + Check if the current custom command's return value is redirected away from display. +editLink: false +contributors: false +--- + + +# `is-redirected` for [platform](/commands/categories/platform.md) + +
Check if the current custom command's return value is redirected away from display.
+ +## Signature + +```> is-redirected {flags} ``` + + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | bool | +## Examples + +Inside a custom command, report if the call's return value is redirected (works in `if`). +```nu +> def pipetest [] { if (is-redirected) { "piped" } else { "display" } }; pipetest + +``` + +Return true when the custom command is piped to another command. +```nu +> def pipetest [] { is-redirected }; pipetest | $in +true +``` + +Return true when the custom command result is collected into a variable. +```nu +> def pipetest [] { is-redirected }; let x = (pipetest); $x +true +``` + +## Notes +This is a Nushell pipeline-destination check, not an OS TTY check. + +Inside a custom command, `is-redirected` reports if that command's return +value will be piped to another command, collected into a value (`let`, +subexpression), written to a file, or discarded — as opposed to being printed +via the normal display path. + +Unlike looking at process stdout, this is stable for the entire command body, so +it works inside `if (...)` and `let x = (...)`. + +To test if process stdout is a terminal (scripts: `./script | cat`), use +`is-terminal --stdout` instead. + +Typical pattern for pretty-vs-data custom commands: + + def mycmd [] { + if (is-terminal --stdout) and not (is-redirected) { + # human-friendly formatting + } else { + # structured data for pipelines + } + } diff --git a/commands/docs/is-terminal.md b/commands/docs/is-terminal.md index 1ca60ecbe26..73b1624bfb7 100644 --- a/commands/docs/is-terminal.md +++ b/commands/docs/is-terminal.md @@ -2,11 +2,11 @@ title: is-terminal categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | - Check if stdin, stdout, or stderr is a terminal. + Check if the process stdin, stdout, or stderr is attached to a terminal device. usage: | - Check if stdin, stdout, or stderr is a terminal. + Check if the process stdin, stdout, or stderr is attached to a terminal device. editLink: false contributors: false --- @@ -14,7 +14,7 @@ contributors: false # `is-terminal` for [platform](/commands/categories/platform.md) -
Check if stdin, stdout, or stderr is a terminal.
+
Check if the process stdin, stdout, or stderr is attached to a terminal device.
## Signature @@ -40,20 +40,22 @@ Check if stdout is a terminal (default when no flag is specified). ``` -Return false when output is piped to another command. +Return "terminal attached" if standard input is attached to a terminal, and "no terminal" if not. ```nu -> is-terminal | to text -false +> if (is-terminal --stdin) { "terminal attached" } else { "no terminal" } +terminal attached ``` -Return false when output is collected into a variable. +Choose formatting based on process stdout being a TTY (works inside `if`). ```nu -> let x = (is-terminal); $x -false -``` +> if (is-terminal --stdout) { "human" } else { "piped" } -Return "terminal attached" if standard input is attached to a terminal, and "no terminal" if not. -```nu -> if (is-terminal --stdin) { "terminal attached" } else { "no terminal" } -terminal attached ``` + +## Notes +This is an operating-system level check (like bash `test -t`), not a Nushell +pipeline check. It reports if the process file descriptor is a TTY, which is +what scripts need for `./script.nu | cat` vs running on a terminal. + +To detect if a custom command's return value is piped or collected inside +Nushell (pretty output vs structured data), use `is-redirected` instead. \ No newline at end of file diff --git a/commands/docs/items.md b/commands/docs/items.md index b6ba44a20fb..ad22e04bec8 100644 --- a/commands/docs/items.md +++ b/commands/docs/items.md @@ -2,7 +2,7 @@ title: items categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Given a record, iterate on each pair of column name and associated value. usage: | diff --git a/commands/docs/job.md b/commands/docs/job.md index 02ba03c357b..66ea7d1728f 100644 --- a/commands/docs/job.md +++ b/commands/docs/job.md @@ -2,7 +2,7 @@ title: job categories: | experimental -version: 0.114.0 +version: 0.115.0 experimental: | Various commands for working with background jobs. usage: | diff --git a/commands/docs/job_describe.md b/commands/docs/job_describe.md index 1b9168fe9e4..eacf178c5e3 100644 --- a/commands/docs/job_describe.md +++ b/commands/docs/job_describe.md @@ -2,7 +2,7 @@ title: job describe categories: | experimental -version: 0.114.0 +version: 0.115.0 experimental: | Add a description to a background job. usage: | diff --git a/commands/docs/job_flush.md b/commands/docs/job_flush.md index a6bb59cb799..80e5685c612 100644 --- a/commands/docs/job_flush.md +++ b/commands/docs/job_flush.md @@ -2,7 +2,7 @@ title: job flush categories: | experimental -version: 0.114.0 +version: 0.115.0 experimental: | Clear this job's mailbox. usage: | diff --git a/commands/docs/job_id.md b/commands/docs/job_id.md index f631dd87484..67b954b8a9c 100644 --- a/commands/docs/job_id.md +++ b/commands/docs/job_id.md @@ -2,7 +2,7 @@ title: job id categories: | experimental -version: 0.114.0 +version: 0.115.0 experimental: | Get id of current job. usage: | diff --git a/commands/docs/job_kill.md b/commands/docs/job_kill.md index 99702bc6bf1..4af27ed2fb3 100644 --- a/commands/docs/job_kill.md +++ b/commands/docs/job_kill.md @@ -2,7 +2,7 @@ title: job kill categories: | experimental -version: 0.114.0 +version: 0.115.0 experimental: | Kill a background job. usage: | diff --git a/commands/docs/job_list.md b/commands/docs/job_list.md index 359dfe8d913..6eb4407701d 100644 --- a/commands/docs/job_list.md +++ b/commands/docs/job_list.md @@ -2,7 +2,7 @@ title: job list categories: | experimental -version: 0.114.0 +version: 0.115.0 experimental: | List background jobs. usage: | diff --git a/commands/docs/job_recv.md b/commands/docs/job_recv.md index f99b543d55f..2dd717bf835 100644 --- a/commands/docs/job_recv.md +++ b/commands/docs/job_recv.md @@ -2,7 +2,7 @@ title: job recv categories: | experimental -version: 0.114.0 +version: 0.115.0 experimental: | Read a message from a job's mailbox. usage: | diff --git a/commands/docs/job_send.md b/commands/docs/job_send.md index a81cb038a9a..a66548a427c 100644 --- a/commands/docs/job_send.md +++ b/commands/docs/job_send.md @@ -2,7 +2,7 @@ title: job send categories: | experimental -version: 0.114.0 +version: 0.115.0 experimental: | Send a message to the mailbox of a job. usage: | diff --git a/commands/docs/job_spawn.md b/commands/docs/job_spawn.md index bf179345b3b..d3d02f4b1cd 100644 --- a/commands/docs/job_spawn.md +++ b/commands/docs/job_spawn.md @@ -2,7 +2,7 @@ title: job spawn categories: | experimental -version: 0.114.0 +version: 0.115.0 experimental: | Spawn a background job and retrieve its ID. usage: | diff --git a/commands/docs/job_unfreeze.md b/commands/docs/job_unfreeze.md index aef58efbcf8..5de57154cf9 100644 --- a/commands/docs/job_unfreeze.md +++ b/commands/docs/job_unfreeze.md @@ -2,7 +2,7 @@ title: job unfreeze categories: | experimental -version: 0.114.0 +version: 0.115.0 experimental: | Unfreeze a frozen process job in foreground. usage: | diff --git a/commands/docs/join.md b/commands/docs/join.md index 16b8c2c1022..db160640b79 100644 --- a/commands/docs/join.md +++ b/commands/docs/join.md @@ -2,7 +2,7 @@ title: join categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Join two tables. usage: | diff --git a/commands/docs/keybindings.md b/commands/docs/keybindings.md index e311cac3926..584fa26fc13 100644 --- a/commands/docs/keybindings.md +++ b/commands/docs/keybindings.md @@ -2,7 +2,7 @@ title: keybindings categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Keybindings related commands. usage: | diff --git a/commands/docs/keybindings_default.md b/commands/docs/keybindings_default.md index 794a9c871d0..4cefd42f98a 100644 --- a/commands/docs/keybindings_default.md +++ b/commands/docs/keybindings_default.md @@ -2,7 +2,7 @@ title: keybindings default categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | List default keybindings. usage: | diff --git a/commands/docs/keybindings_list.md b/commands/docs/keybindings_list.md index f6b78d04b5e..e2816a6e9b9 100644 --- a/commands/docs/keybindings_list.md +++ b/commands/docs/keybindings_list.md @@ -2,7 +2,7 @@ title: keybindings list categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | List available options that can be used to create keybindings. usage: | diff --git a/commands/docs/keybindings_listen.md b/commands/docs/keybindings_listen.md index 81a559d802d..cf0b0d23c65 100644 --- a/commands/docs/keybindings_listen.md +++ b/commands/docs/keybindings_listen.md @@ -2,7 +2,7 @@ title: keybindings listen categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Get input from the user. usage: | diff --git a/commands/docs/kill.md b/commands/docs/kill.md index e947bc6d233..5c37484dc35 100644 --- a/commands/docs/kill.md +++ b/commands/docs/kill.md @@ -2,7 +2,7 @@ title: kill categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Kill a process using its process ID. usage: | diff --git a/commands/docs/last.md b/commands/docs/last.md index 3dda0b89cf5..e9e67310136 100644 --- a/commands/docs/last.md +++ b/commands/docs/last.md @@ -2,11 +2,11 @@ title: last categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | - Return only the last several rows of the input. Counterpart of `first`. Opposite of `drop`. + Return only the last several rows of the input. Counterpart of `first`. Opposite of `drop`. For binary input, rows can also be specified as a filesize. usage: | - Return only the last several rows of the input. Counterpart of `first`. Opposite of `drop`. + Return only the last several rows of the input. Counterpart of `first`. Opposite of `drop`. For binary input, rows can also be specified as a filesize. editLink: false contributors: false --- @@ -14,7 +14,7 @@ contributors: false # `last` for [filters](/commands/categories/filters.md) -
Return only the last several rows of the input. Counterpart of `first`. Opposite of `drop`.
+
Return only the last several rows of the input. Counterpart of `first`. Opposite of `drop`. For binary input, rows can also be specified as a filesize.
## Signature @@ -67,3 +67,11 @@ Return the last item of a range. > 1..3 | last 3 ``` + +Return the last 2 bytes of a binary value, using a filesize argument. +```nu +> 0x[01 23 45] | last 2b +Length: 2 (0x2) bytes | null_char printable whitespace ascii_other non_ascii +00000000: 23 45 #E + +``` diff --git a/commands/docs/length.md b/commands/docs/length.md index 1b1e22cbe14..837314371df 100644 --- a/commands/docs/length.md +++ b/commands/docs/length.md @@ -2,7 +2,7 @@ title: length categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Count the number of items in an input list, rows in a table, or bytes in binary data. usage: | diff --git a/commands/docs/let-env.md b/commands/docs/let-env.md index 0cce8162b0f..5a756393b79 100644 --- a/commands/docs/let-env.md +++ b/commands/docs/let-env.md @@ -2,7 +2,7 @@ title: let-env categories: | removed -version: 0.114.0 +version: 0.115.0 removed: | `let-env FOO = ...` has been removed, use `$env.FOO = ...` instead. usage: | diff --git a/commands/docs/let.md b/commands/docs/let.md index d2505745459..66ff524d1c4 100644 --- a/commands/docs/let.md +++ b/commands/docs/let.md @@ -2,7 +2,7 @@ title: let categories: | core -version: 0.114.0 +version: 0.115.0 core: | Create a variable and give it a value. usage: | diff --git a/commands/docs/lines.md b/commands/docs/lines.md index dcfb8eef7b1..996c8cc05b4 100644 --- a/commands/docs/lines.md +++ b/commands/docs/lines.md @@ -2,7 +2,7 @@ title: lines categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Converts input to lines. usage: | diff --git a/commands/docs/load-env.md b/commands/docs/load-env.md index b67085888da..73d75f9fb71 100644 --- a/commands/docs/load-env.md +++ b/commands/docs/load-env.md @@ -2,7 +2,7 @@ title: load-env categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Loads an environment update from a record. usage: | diff --git a/commands/docs/loop.md b/commands/docs/loop.md index 5ff024f70f3..3b87874b59c 100644 --- a/commands/docs/loop.md +++ b/commands/docs/loop.md @@ -2,7 +2,7 @@ title: loop categories: | core -version: 0.114.0 +version: 0.115.0 core: | Run a block in a loop. usage: | diff --git a/commands/docs/ls.md b/commands/docs/ls.md index fc7fa8810bc..ed6c956cee4 100644 --- a/commands/docs/ls.md +++ b/commands/docs/ls.md @@ -2,7 +2,7 @@ title: ls categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | List the filenames, sizes, and modification times of items in a directory. usage: | diff --git a/commands/docs/match.md b/commands/docs/match.md index c7c41d3b93b..875de918c80 100644 --- a/commands/docs/match.md +++ b/commands/docs/match.md @@ -2,7 +2,7 @@ title: match categories: | core -version: 0.114.0 +version: 0.115.0 core: | Conditionally run a block on a matched value. usage: | @@ -51,6 +51,12 @@ Match on a value in range. yes! ``` +Match on a constant expression. +```nu +> match 42 { (40 + 2) => 'yes!' } +yes! +``` + Match on a field in a record. ```nu > match {a: 100} { {a: $my_value} => { $my_value } } diff --git a/commands/docs/math.md b/commands/docs/math.md index ca278fab359..6eade8fc269 100644 --- a/commands/docs/math.md +++ b/commands/docs/math.md @@ -2,7 +2,7 @@ title: math categories: | math -version: 0.114.0 +version: 0.115.0 math: | Use mathematical functions as aggregate functions on a list of numbers or tables. usage: | diff --git a/commands/docs/math_abs.md b/commands/docs/math_abs.md index ca219ad26c8..d564ef8f441 100644 --- a/commands/docs/math_abs.md +++ b/commands/docs/math_abs.md @@ -2,7 +2,7 @@ title: math abs categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the absolute value of a number. usage: | @@ -18,7 +18,11 @@ contributors: false ## Signature -```> math abs {flags} ``` +```> math abs {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: @@ -27,9 +31,12 @@ contributors: false | -------------- | -------------- | | number | number | | duration | duration | +| filesize | filesize | | list<number> | list<number> | | list<duration> | list<duration> | +| list<filesize> | list<filesize> | | range | list<number> | +| record | record | ## Examples Compute absolute value of each number in a list of numbers. @@ -42,3 +49,35 @@ Compute absolute value of each number in a list of numbers. ╰───┴────────╯ ``` + +Compute the absolute value of list-valued columns in a record. +```nu +> {alice: [-1 -2 -3], bob: [-4 -5]} | math abs +╭───────┬───────────╮ +│ │ ╭───┬───╮ │ +│ alice │ │ 0 │ 1 │ │ +│ │ │ 1 │ 2 │ │ +│ │ │ 2 │ 3 │ │ +│ │ ╰───┴───╯ │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 4 │ │ +│ │ │ 1 │ 5 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` + +Compute the absolute value of a single column using a cell path. +```nu +> {alice: [-1 -2 -3], bob: [-4 -5]} | math abs alice +╭───────┬────────────╮ +│ │ ╭───┬───╮ │ +│ alice │ │ 0 │ 1 │ │ +│ │ │ 1 │ 2 │ │ +│ │ │ 2 │ 3 │ │ +│ │ ╰───┴───╯ │ +│ │ ╭───┬────╮ │ +│ bob │ │ 0 │ -4 │ │ +│ │ │ 1 │ -5 │ │ +│ │ ╰───┴────╯ │ +╰───────┴────────────╯ +``` diff --git a/commands/docs/math_arccos.md b/commands/docs/math_arccos.md index 584098277a3..9756e3199c4 100644 --- a/commands/docs/math_arccos.md +++ b/commands/docs/math_arccos.md @@ -2,7 +2,7 @@ title: math arccos categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the arccosine of the number. usage: | diff --git a/commands/docs/math_arccosh.md b/commands/docs/math_arccosh.md index 03829b586f3..ab2ac771d32 100644 --- a/commands/docs/math_arccosh.md +++ b/commands/docs/math_arccosh.md @@ -2,7 +2,7 @@ title: math arccosh categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the inverse of the hyperbolic cosine function. usage: | diff --git a/commands/docs/math_arcsin.md b/commands/docs/math_arcsin.md index 59554d99287..124dedcb455 100644 --- a/commands/docs/math_arcsin.md +++ b/commands/docs/math_arcsin.md @@ -2,7 +2,7 @@ title: math arcsin categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the arcsine of the number. usage: | diff --git a/commands/docs/math_arcsinh.md b/commands/docs/math_arcsinh.md index 5e9dc6fd156..1cc0360e9f5 100644 --- a/commands/docs/math_arcsinh.md +++ b/commands/docs/math_arcsinh.md @@ -2,7 +2,7 @@ title: math arcsinh categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the inverse of the hyperbolic sine function. usage: | diff --git a/commands/docs/math_arctan.md b/commands/docs/math_arctan.md index bee7f29b011..660e7d7a79f 100644 --- a/commands/docs/math_arctan.md +++ b/commands/docs/math_arctan.md @@ -2,7 +2,7 @@ title: math arctan categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the arctangent of the number. usage: | diff --git a/commands/docs/math_arctanh.md b/commands/docs/math_arctanh.md index fde57dc20de..4fea1cd5455 100644 --- a/commands/docs/math_arctanh.md +++ b/commands/docs/math_arctanh.md @@ -2,7 +2,7 @@ title: math arctanh categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the inverse of the hyperbolic tangent function. usage: | diff --git a/commands/docs/math_avg.md b/commands/docs/math_avg.md index b2ab1ae328a..7dd68d8a1fc 100644 --- a/commands/docs/math_avg.md +++ b/commands/docs/math_avg.md @@ -2,7 +2,7 @@ title: math avg categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the average of a list of numbers. usage: | @@ -18,7 +18,11 @@ contributors: false ## Signature -```> math avg {flags} ``` +```> math avg {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: @@ -56,3 +60,25 @@ Compute the average of each column in a table. │ b │ 3 │ ╰───┴───╯ ``` + +Compute the average of list-valued columns in a record. +```nu +> {alice: [1 2 3], bob: [4 5 6]} | math avg +╭───────┬───╮ +│ alice │ 2 │ +│ bob │ 5 │ +╰───────┴───╯ +``` + +Compute the average of a single column using a cell path. +```nu +> {alice: [1 2 3], bob: [4 5 6]} | math avg alice +╭───────┬───────────╮ +│ alice │ 2 │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 4 │ │ +│ │ │ 1 │ 5 │ │ +│ │ │ 2 │ 6 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` diff --git a/commands/docs/math_cbrt.md b/commands/docs/math_cbrt.md index b88bd1402fb..03bb336763d 100644 --- a/commands/docs/math_cbrt.md +++ b/commands/docs/math_cbrt.md @@ -2,7 +2,7 @@ title: math cbrt categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the real-valued cube root of the input number. usage: | @@ -18,7 +18,11 @@ contributors: false ## Signature -```> math cbrt {flags} ``` +```> math cbrt {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: @@ -28,6 +32,7 @@ contributors: false | number | float | | list<number> | list<float> | | range | list<number> | +| record | record | ## Examples Compute the cube root of each number in a list. @@ -39,3 +44,35 @@ Compute the cube root of each number in a list. ╰───┴───────╯ ``` + +Compute the cube root of list-valued columns in a record. +```nu +> {alice: [8 27 64], bob: [125 216]} | math cbrt +╭───────┬──────────────╮ +│ │ ╭───┬──────╮ │ +│ alice │ │ 0 │ 2.00 │ │ +│ │ │ 1 │ 3.00 │ │ +│ │ │ 2 │ 4.00 │ │ +│ │ ╰───┴──────╯ │ +│ │ ╭───┬──────╮ │ +│ bob │ │ 0 │ 5.00 │ │ +│ │ │ 1 │ 6.00 │ │ +│ │ ╰───┴──────╯ │ +╰───────┴──────────────╯ +``` + +Compute the cube root of a single column using a cell path. +```nu +> {alice: [8 27 64], bob: [125 216]} | math cbrt alice +╭───────┬──────────────╮ +│ │ ╭───┬──────╮ │ +│ alice │ │ 0 │ 2.00 │ │ +│ │ │ 1 │ 3.00 │ │ +│ │ │ 2 │ 4.00 │ │ +│ │ ╰───┴──────╯ │ +│ │ ╭───┬─────╮ │ +│ bob │ │ 0 │ 125 │ │ +│ │ │ 1 │ 216 │ │ +│ │ ╰───┴─────╯ │ +╰───────┴──────────────╯ +``` diff --git a/commands/docs/math_ceil.md b/commands/docs/math_ceil.md index b4a95cf3806..565a813b1e8 100644 --- a/commands/docs/math_ceil.md +++ b/commands/docs/math_ceil.md @@ -2,7 +2,7 @@ title: math ceil categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the ceil of a number (smallest integer greater than or equal to that number). usage: | @@ -18,16 +18,25 @@ contributors: false ## Signature -```> math ceil {flags} ``` +```> math ceil {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: -| input | output | -| ------------ | ------------ | -| number | int | -| list<number> | list<int> | -| range | list<number> | +| input | output | +| -------------- | -------------- | +| number | int | +| duration | duration | +| filesize | filesize | +| list<number> | list<int> | +| list<duration> | list<duration> | +| list<filesize> | list<filesize> | +| range | list<number> | +| record | record | ## Examples Apply the ceil function to a list of numbers. @@ -40,3 +49,44 @@ Apply the ceil function to a list of numbers. ╰───┴────╯ ``` + +Apply ceiling to list-valued columns in a record. +```nu +> {alice: [1.2 2.7 3.5], bob: [4.1 5.9]} | math ceil +╭───────┬───────────╮ +│ │ ╭───┬───╮ │ +│ alice │ │ 0 │ 2 │ │ +│ │ │ 1 │ 3 │ │ +│ │ │ 2 │ 4 │ │ +│ │ ╰───┴───╯ │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 5 │ │ +│ │ │ 1 │ 6 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` + +Apply ceiling to a single column using a cell path. +```nu +> {alice: [1.2 2.7 3.5], bob: [4.1 5.9]} | math ceil alice +╭───────┬──────────────╮ +│ │ ╭───┬───╮ │ +│ alice │ │ 0 │ 2 │ │ +│ │ │ 1 │ 3 │ │ +│ │ │ 2 │ 4 │ │ +│ │ ╰───┴───╯ │ +│ │ ╭───┬──────╮ │ +│ bob │ │ 0 │ 4.10 │ │ +│ │ │ 1 │ 5.90 │ │ +│ │ ╰───┴──────╯ │ +╰───────┴──────────────╯ +``` + +Filesize values are already whole bytes, so ceiling is a no-op. +```nu +> 2.1KB | math ceil +2.1 kB +``` + +## Notes +Filesize and duration values are stored as integers in base units (bytes and nanoseconds). With no display unit to round against, `math ceil` is the identity function for those types. \ No newline at end of file diff --git a/commands/docs/math_cos.md b/commands/docs/math_cos.md index e02b55025a4..2d2e41dd445 100644 --- a/commands/docs/math_cos.md +++ b/commands/docs/math_cos.md @@ -2,7 +2,7 @@ title: math cos categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the cosine of the number. usage: | diff --git a/commands/docs/math_cosh.md b/commands/docs/math_cosh.md index a781ce614ab..5aed75426b9 100644 --- a/commands/docs/math_cosh.md +++ b/commands/docs/math_cosh.md @@ -2,7 +2,7 @@ title: math cosh categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the hyperbolic cosine of the number. usage: | diff --git a/commands/docs/math_exp.md b/commands/docs/math_exp.md index 0b12f7cf40a..5de04af8c4a 100644 --- a/commands/docs/math_exp.md +++ b/commands/docs/math_exp.md @@ -2,7 +2,7 @@ title: math exp categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns e raised to the power of x. usage: | diff --git a/commands/docs/math_floor.md b/commands/docs/math_floor.md index 22b94c78523..8bc6eaf3ec4 100644 --- a/commands/docs/math_floor.md +++ b/commands/docs/math_floor.md @@ -2,7 +2,7 @@ title: math floor categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the floor of a number (largest integer less than or equal to that number). usage: | @@ -18,16 +18,25 @@ contributors: false ## Signature -```> math floor {flags} ``` +```> math floor {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: -| input | output | -| ------------ | ------------ | -| number | int | -| list<number> | list<int> | -| range | list<number> | +| input | output | +| -------------- | -------------- | +| number | int | +| duration | duration | +| filesize | filesize | +| list<number> | list<int> | +| list<duration> | list<duration> | +| list<filesize> | list<filesize> | +| range | list<number> | +| record | record | ## Examples Apply the floor function to a list of numbers. @@ -40,3 +49,44 @@ Apply the floor function to a list of numbers. ╰───┴────╯ ``` + +Apply the floor function to list-valued columns in a record. +```nu +> {alice: [1.2 2.7 3.5], bob: [4.1 5.9]} | math floor +╭───────┬───────────╮ +│ │ ╭───┬───╮ │ +│ alice │ │ 0 │ 1 │ │ +│ │ │ 1 │ 2 │ │ +│ │ │ 2 │ 3 │ │ +│ │ ╰───┴───╯ │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 4 │ │ +│ │ │ 1 │ 5 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` + +Apply the floor function to a single column using a cell path. +```nu +> {alice: [1.2 2.7 3.5], bob: [4.1 5.9]} | math floor alice +╭───────┬──────────────╮ +│ │ ╭───┬───╮ │ +│ alice │ │ 0 │ 1 │ │ +│ │ │ 1 │ 2 │ │ +│ │ │ 2 │ 3 │ │ +│ │ ╰───┴───╯ │ +│ │ ╭───┬──────╮ │ +│ bob │ │ 0 │ 4.10 │ │ +│ │ │ 1 │ 5.90 │ │ +│ │ ╰───┴──────╯ │ +╰───────┴──────────────╯ +``` + +Filesize values are already whole bytes, so flooring is a no-op. +```nu +> 2.1KB | math floor +2.1 kB +``` + +## Notes +Filesize and duration values are stored as integers in base units (bytes and nanoseconds). With no display unit to round against, `math floor` is the identity function for those types. \ No newline at end of file diff --git a/commands/docs/math_ln.md b/commands/docs/math_ln.md index f20d688f959..0b30b813948 100644 --- a/commands/docs/math_ln.md +++ b/commands/docs/math_ln.md @@ -2,7 +2,7 @@ title: math ln categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the natural logarithm. Base: (math e). usage: | diff --git a/commands/docs/math_log.md b/commands/docs/math_log.md index 88b9439fe59..b714539cf17 100644 --- a/commands/docs/math_log.md +++ b/commands/docs/math_log.md @@ -2,7 +2,7 @@ title: math log categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the logarithm for an arbitrary base. usage: | @@ -18,11 +18,12 @@ contributors: false ## Signature -```> math log {flags} (base)``` +```> math log {flags} (base) ...rest``` ## Parameters - `base`: Base for which the logarithm should be computed. + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: @@ -32,6 +33,7 @@ contributors: false | number | float | | list<number> | list<float> | | range | list<number> | +| record | record | ## Examples Get the logarithm of 100 to the base 10. @@ -50,3 +52,35 @@ Get the log2 of a list of values. ╰───┴──────╯ ``` + +Compute the log base 10 of list-valued columns in a record. +```nu +> {alice: [1 10 100], bob: [1000 10000]} | math log 10 +╭───────┬──────────────╮ +│ │ ╭───┬──────╮ │ +│ alice │ │ 0 │ 0.00 │ │ +│ │ │ 1 │ 1.00 │ │ +│ │ │ 2 │ 2.00 │ │ +│ │ ╰───┴──────╯ │ +│ │ ╭───┬──────╮ │ +│ bob │ │ 0 │ 3.00 │ │ +│ │ │ 1 │ 4.00 │ │ +│ │ ╰───┴──────╯ │ +╰───────┴──────────────╯ +``` + +Compute the log base 10 of a single column using a cell path. +```nu +> {alice: [1 10 100], bob: [1000 10000]} | math log 10 alice +╭───────┬───────────────╮ +│ │ ╭───┬──────╮ │ +│ alice │ │ 0 │ 0.00 │ │ +│ │ │ 1 │ 1.00 │ │ +│ │ │ 2 │ 2.00 │ │ +│ │ ╰───┴──────╯ │ +│ │ ╭───┬───────╮ │ +│ bob │ │ 0 │ 1000 │ │ +│ │ │ 1 │ 10000 │ │ +│ │ ╰───┴───────╯ │ +╰───────┴───────────────╯ +``` diff --git a/commands/docs/math_max.md b/commands/docs/math_max.md index 39dded1aa16..06717ebcf1c 100644 --- a/commands/docs/math_max.md +++ b/commands/docs/math_max.md @@ -2,7 +2,7 @@ title: math max categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the maximum of a list of values, or of columns in a table. usage: | @@ -18,7 +18,11 @@ contributors: false ## Signature -```> math max {flags} ``` +```> math max {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: @@ -54,3 +58,25 @@ Find the maximum of a list of dates. > [2022-02-02 2022-12-30 2012-12-12] | math max Fri, 30 Dec 2022 00:00:00 +0000 (3 years ago) ``` + +Find the maximum of list-valued columns in a record. +```nu +> {alice: [1 5 3], bob: [4 5 6]} | math max +╭───────┬───╮ +│ alice │ 5 │ +│ bob │ 6 │ +╰───────┴───╯ +``` + +Find the maximum of a single column using a cell path. +```nu +> {alice: [1 5 3], bob: [4 5 6]} | math max alice +╭───────┬───────────╮ +│ alice │ 5 │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 4 │ │ +│ │ │ 1 │ 5 │ │ +│ │ │ 2 │ 6 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` diff --git a/commands/docs/math_median.md b/commands/docs/math_median.md index e7f5ff8db2b..0e4462a7e45 100644 --- a/commands/docs/math_median.md +++ b/commands/docs/math_median.md @@ -2,7 +2,7 @@ title: math median categories: | math -version: 0.114.0 +version: 0.115.0 math: | Computes the median of a list of numbers. usage: | @@ -18,7 +18,11 @@ contributors: false ## Signature -```> math median {flags} ``` +```> math median {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: @@ -53,3 +57,25 @@ Find the median of a list of file sizes. > [5KB 10MB 200B] | math median 5.0 kB ``` + +Compute the median of list-valued columns in a record. +```nu +> {alice: [3 1 2], bob: [4 5 6]} | math median +╭───────┬───╮ +│ alice │ 2 │ +│ bob │ 5 │ +╰───────┴───╯ +``` + +Compute the median of a single column using a cell path. +```nu +> {alice: [3 1 2], bob: [4 5 6]} | math median alice +╭───────┬───────────╮ +│ alice │ 2 │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 4 │ │ +│ │ │ 1 │ 5 │ │ +│ │ │ 2 │ 6 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` diff --git a/commands/docs/math_min.md b/commands/docs/math_min.md index 0ba2d633da1..245519f2b5e 100644 --- a/commands/docs/math_min.md +++ b/commands/docs/math_min.md @@ -2,7 +2,7 @@ title: math min categories: | math -version: 0.114.0 +version: 0.115.0 math: | Finds the minimum within a list of values or tables. usage: | @@ -18,7 +18,11 @@ contributors: false ## Signature -```> math min {flags} ``` +```> math min {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: @@ -54,3 +58,24 @@ Find the minimum of a list of arbitrary values (Warning: Weird). > [-50 'hello' true] | math min true ``` + +Compute the minimum of list-valued columns in a record. +```nu +> {alice: [5 3 9], bob: [2 7]} | math min +╭───────┬───╮ +│ alice │ 3 │ +│ bob │ 2 │ +╰───────┴───╯ +``` + +Compute the minimum of a single column using a cell path. +```nu +> {alice: [5 3 9], bob: [2 7]} | math min alice +╭───────┬───────────╮ +│ alice │ 3 │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 2 │ │ +│ │ │ 1 │ 7 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` diff --git a/commands/docs/math_mode.md b/commands/docs/math_mode.md index ca5b05bb415..4ac296aa831 100644 --- a/commands/docs/math_mode.md +++ b/commands/docs/math_mode.md @@ -2,7 +2,7 @@ title: math mode categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the most frequent element(s) from a list of numbers or tables. usage: | @@ -18,7 +18,11 @@ contributors: false ## Signature -```> math mode {flags} ``` +```> math mode {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: @@ -29,6 +33,7 @@ contributors: false | list<duration> | list<duration> | | list<filesize> | list<filesize> | | table | record | +| record | record | ## Examples Compute the mode(s) of a list of numbers. @@ -55,3 +60,31 @@ Compute the mode(s) of the columns of a table. │ │ ╰───┴────╯ │ ╰───┴────────────╯ ``` + +Compute the mode(s) of list-valued columns in a record. +```nu +> {alice: [1 1 2 3], bob: [5 5 6]} | math mode +╭───────┬───────────╮ +│ │ ╭───┬───╮ │ +│ alice │ │ 0 │ 1 │ │ +│ │ ╰───┴───╯ │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 5 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` + +Compute the mode(s) of a single column using a cell path. +```nu +> {alice: [1 1 2 3], bob: [5 5 6]} | math mode alice +╭───────┬───────────╮ +│ │ ╭───┬───╮ │ +│ alice │ │ 0 │ 1 │ │ +│ │ ╰───┴───╯ │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 5 │ │ +│ │ │ 1 │ 5 │ │ +│ │ │ 2 │ 6 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` diff --git a/commands/docs/math_product.md b/commands/docs/math_product.md index ca935a6c400..01ea6398ed1 100644 --- a/commands/docs/math_product.md +++ b/commands/docs/math_product.md @@ -2,7 +2,7 @@ title: math product categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the product of a list of numbers or the products of each column of a table. usage: | @@ -18,7 +18,11 @@ contributors: false ## Signature -```> math product {flags} ``` +```> math product {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: @@ -45,3 +49,25 @@ Compute the product of each column in a table. │ b │ 8 │ ╰───┴───╯ ``` + +Compute the product of list-valued columns in a record. +```nu +> {alice: [2 3 4], bob: [4 5 6]} | math product +╭───────┬─────╮ +│ alice │ 24 │ +│ bob │ 120 │ +╰───────┴─────╯ +``` + +Compute the product of a single column using a cell path. +```nu +> {alice: [2 3 4], bob: [4 5 6]} | math product alice +╭───────┬───────────╮ +│ alice │ 24 │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 4 │ │ +│ │ │ 1 │ 5 │ │ +│ │ │ 2 │ 6 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` diff --git a/commands/docs/math_round.md b/commands/docs/math_round.md index e4e3b1f9ab1..cf50396b8f7 100644 --- a/commands/docs/math_round.md +++ b/commands/docs/math_round.md @@ -2,7 +2,7 @@ title: math round categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the input number rounded to the specified precision. usage: | @@ -18,20 +18,29 @@ contributors: false ## Signature -```> math round {flags} ``` +```> math round {flags} ...rest``` ## Flags - `--precision, -p {number}`: Digits of precision. +## Parameters + + - `...rest`: The cell-paths/columns to operate on. + ## Input/output types: -| input | output | -| ------------ | ------------ | -| number | number | -| list<number> | list<number> | -| range | list<number> | +| input | output | +| -------------- | -------------- | +| number | number | +| duration | duration | +| filesize | filesize | +| list<number> | list<number> | +| list<duration> | list<duration> | +| list<filesize> | list<filesize> | +| range | list<number> | +| record | record | ## Examples Apply the round function to a list of numbers. @@ -66,3 +75,44 @@ Apply negative precision to a list of numbers. ╰───┴──────╯ ``` + +Apply the round function to list-valued columns in a record. +```nu +> {alice: [1.2 2.7 3.5], bob: [4.1 5.9]} | math round +╭───────┬───────────╮ +│ │ ╭───┬───╮ │ +│ alice │ │ 0 │ 1 │ │ +│ │ │ 1 │ 3 │ │ +│ │ │ 2 │ 4 │ │ +│ │ ╰───┴───╯ │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 4 │ │ +│ │ │ 1 │ 6 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` + +Apply the round function to a single column using a cell path. +```nu +> {alice: [1.2 2.7 3.5], bob: [4.1 5.9]} | math round alice +╭───────┬──────────────╮ +│ │ ╭───┬───╮ │ +│ alice │ │ 0 │ 1 │ │ +│ │ │ 1 │ 3 │ │ +│ │ │ 2 │ 4 │ │ +│ │ ╰───┴───╯ │ +│ │ ╭───┬──────╮ │ +│ bob │ │ 0 │ 4.10 │ │ +│ │ │ 1 │ 5.90 │ │ +│ │ ╰───┴──────╯ │ +╰───────┴──────────────╯ +``` + +Filesize values are already whole bytes, so rounding is a no-op. +```nu +> 2.1KB | math round +2.1 kB +``` + +## Notes +Filesize and duration values are stored as integers in base units (bytes and nanoseconds). With no display unit to round against, `math round` is the identity function for those types. `--precision` is not supported for filesize or duration. \ No newline at end of file diff --git a/commands/docs/math_sin.md b/commands/docs/math_sin.md index 01b9449ebbb..68e618aee2f 100644 --- a/commands/docs/math_sin.md +++ b/commands/docs/math_sin.md @@ -2,7 +2,7 @@ title: math sin categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the sine of the number. usage: | diff --git a/commands/docs/math_sinh.md b/commands/docs/math_sinh.md index 459bb179ed3..e8182880fa3 100644 --- a/commands/docs/math_sinh.md +++ b/commands/docs/math_sinh.md @@ -2,7 +2,7 @@ title: math sinh categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the hyperbolic sine of the number. usage: | diff --git a/commands/docs/math_sqrt.md b/commands/docs/math_sqrt.md index 19e04809b55..54376db1a72 100644 --- a/commands/docs/math_sqrt.md +++ b/commands/docs/math_sqrt.md @@ -2,7 +2,7 @@ title: math sqrt categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the square root of the input number. usage: | @@ -18,7 +18,11 @@ contributors: false ## Signature -```> math sqrt {flags} ``` +```> math sqrt {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: @@ -28,6 +32,7 @@ contributors: false | number | float | | list<number> | list<float> | | range | list<number> | +| record | record | ## Examples Compute the square root of each number in a list. @@ -39,3 +44,37 @@ Compute the square root of each number in a list. ╰───┴──────╯ ``` + +Apply square root to list-valued columns in a record. +```nu +> {alice: [1 4 9], bob: [16 25 36]} | math sqrt +╭───────┬──────────────╮ +│ │ ╭───┬──────╮ │ +│ alice │ │ 0 │ 1.00 │ │ +│ │ │ 1 │ 2.00 │ │ +│ │ │ 2 │ 3.00 │ │ +│ │ ╰───┴──────╯ │ +│ │ ╭───┬──────╮ │ +│ bob │ │ 0 │ 4.00 │ │ +│ │ │ 1 │ 5.00 │ │ +│ │ │ 2 │ 6.00 │ │ +│ │ ╰───┴──────╯ │ +╰───────┴──────────────╯ +``` + +Apply square root to a single column using a cell path. +```nu +> {alice: [1 4 9], bob: [16 25 36]} | math sqrt alice +╭───────┬──────────────╮ +│ │ ╭───┬──────╮ │ +│ alice │ │ 0 │ 1.00 │ │ +│ │ │ 1 │ 2.00 │ │ +│ │ │ 2 │ 3.00 │ │ +│ │ ╰───┴──────╯ │ +│ │ ╭───┬────╮ │ +│ bob │ │ 0 │ 16 │ │ +│ │ │ 1 │ 25 │ │ +│ │ │ 2 │ 36 │ │ +│ │ ╰───┴────╯ │ +╰───────┴──────────────╯ +``` diff --git a/commands/docs/math_stddev.md b/commands/docs/math_stddev.md index 9181e9aede2..6c5d60cf348 100644 --- a/commands/docs/math_stddev.md +++ b/commands/docs/math_stddev.md @@ -2,7 +2,7 @@ title: math stddev categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the standard deviation of a list of numbers, or of each column in a table. usage: | @@ -18,21 +18,27 @@ contributors: false ## Signature -```> math stddev {flags} ``` +```> math stddev {flags} ...rest``` ## Flags - `--sample, -s`: Calculate sample standard deviation (i.e. using N-1 as the denominator). +## Parameters + + - `...rest`: The cell-paths/columns to operate on. + ## Input/output types: -| input | output | -| ------------ | ------ | -| list<number> | number | -| range | number | -| table | record | -| record | record | +| input | output | +| -------------- | -------- | +| list<number> | number | +| list<duration> | duration | +| list<filesize> | filesize | +| range | number | +| table | record | +| record | record | ## Examples Compute the standard deviation of a list of numbers. @@ -50,8 +56,29 @@ Compute the sample standard deviation of a list of numbers. Compute the standard deviation of each column in a table. ```nu > [[a b]; [1 2] [3 4]] | math stddev -╭───┬───╮ -│ a │ 1 │ -│ b │ 1 │ -╰───┴───╯ +╭───┬──────╮ +│ a │ 1.00 │ +│ b │ 1.00 │ +╰───┴──────╯ +``` + +Compute the standard deviation of list-valued columns in a record. +```nu +> {alice: [1 3], bob: [4 6]} | math stddev +╭───────┬──────╮ +│ alice │ 1.00 │ +│ bob │ 1.00 │ +╰───────┴──────╯ +``` + +Compute the standard deviation of a single column using a cell path. +```nu +> {alice: [1 3], bob: [4 6]} | math stddev alice +╭───────┬───────────╮ +│ alice │ 1.00 │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 4 │ │ +│ │ │ 1 │ 6 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ ``` diff --git a/commands/docs/math_sum.md b/commands/docs/math_sum.md index 97001903c71..c72e7ba040d 100644 --- a/commands/docs/math_sum.md +++ b/commands/docs/math_sum.md @@ -2,7 +2,7 @@ title: math sum categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the sum of a list of numbers or of each column in a table. usage: | @@ -18,7 +18,11 @@ contributors: false ## Signature -```> math sum {flags} ``` +```> math sum {flags} ...rest``` + +## Parameters + + - `...rest`: The cell-paths/columns to operate on. ## Input/output types: @@ -53,3 +57,25 @@ Compute the sum of each column in a table. │ b │ 6 │ ╰───┴───╯ ``` + +Sum the values of list-valued columns in a record. +```nu +> {alice: [1 2 3], bob: [4 5 6]} | math sum +╭───────┬────╮ +│ alice │ 6 │ +│ bob │ 15 │ +╰───────┴────╯ +``` + +Sum a single column using a cell path. +```nu +> {alice: [1 2 3], bob: [4 5 6]} | math sum alice +╭───────┬───────────╮ +│ alice │ 6 │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 4 │ │ +│ │ │ 1 │ 5 │ │ +│ │ │ 2 │ 6 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` diff --git a/commands/docs/math_tan.md b/commands/docs/math_tan.md index 5737ae87d9c..e8117313f3b 100644 --- a/commands/docs/math_tan.md +++ b/commands/docs/math_tan.md @@ -2,7 +2,7 @@ title: math tan categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the tangent of the number. usage: | diff --git a/commands/docs/math_tanh.md b/commands/docs/math_tanh.md index b7d14e3ed4b..1ea7196f12c 100644 --- a/commands/docs/math_tanh.md +++ b/commands/docs/math_tanh.md @@ -2,7 +2,7 @@ title: math tanh categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the hyperbolic tangent of the number. usage: | diff --git a/commands/docs/math_variance.md b/commands/docs/math_variance.md index b4b6a498b18..ea50d35c06a 100644 --- a/commands/docs/math_variance.md +++ b/commands/docs/math_variance.md @@ -2,7 +2,7 @@ title: math variance categories: | math -version: 0.114.0 +version: 0.115.0 math: | Returns the variance of a list of numbers or of each column in a table. usage: | @@ -18,21 +18,27 @@ contributors: false ## Signature -```> math variance {flags} ``` +```> math variance {flags} ...rest``` ## Flags - `--sample, -s`: Calculate sample variance (i.e. using N-1 as the denominator). +## Parameters + + - `...rest`: The cell-paths/columns to operate on. + ## Input/output types: -| input | output | -| ------------ | ------ | -| list<number> | number | -| range | number | -| table | record | -| record | record | +| input | output | +| -------------- | ------ | +| list<number> | number | +| list<duration> | number | +| list<filesize> | number | +| range | number | +| table | record | +| record | record | ## Examples Get the variance of a list of numbers. @@ -55,3 +61,33 @@ Compute the variance of each column in a table. │ b │ 1 │ ╰───┴───╯ ``` + +Compute the variance of list-valued columns in a record. +```nu +> {alice: [1 3], bob: [4 6]} | math variance +╭───────┬───╮ +│ alice │ 1 │ +│ bob │ 1 │ +╰───────┴───╯ +``` + +Compute the variance of a single column using a cell path. +```nu +> {alice: [1 3], bob: [4 6]} | math variance alice +╭───────┬───────────╮ +│ alice │ 1 │ +│ │ ╭───┬───╮ │ +│ bob │ │ 0 │ 4 │ │ +│ │ │ 1 │ 6 │ │ +│ │ ╰───┴───╯ │ +╰───────┴───────────╯ +``` + +Variance of filesizes is a number of base units squared (bytes²). +```nu +> [1KB 3KB] | math variance +1000000.0 +``` + +## Notes +For filesize and duration inputs, variance is computed in base units (bytes and nanoseconds) and returned as a plain number. There is no squared unit type in Nushell, so the result is the variance of the underlying byte or nanosecond values (B² or ns²), not of the display unit used when the values were written. \ No newline at end of file diff --git a/commands/docs/matrix.md b/commands/docs/matrix.md new file mode 100644 index 00000000000..ef1def9b43b --- /dev/null +++ b/commands/docs/matrix.md @@ -0,0 +1,53 @@ +--- +title: matrix +categories: | + filters +version: 0.115.0 +filters: | + Various commands for working with matrices. +usage: | + Various commands for working with matrices. +editLink: false +contributors: false +--- + + +# `matrix` for [filters](/commands/categories/filters.md) + +
Various commands for working with matrices.
+ +## Signature + +```> matrix {flags} ``` + + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | string | +## Notes +You must use one of the following subcommands. Using this command as-is will only produce this help message. + +## Subcommands: + +| name | description | type | +| -------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -------- | +| [`matrix add`](/commands/docs/matrix_add.md) | Add a matrix or scalar to a matrix. | built-in | +| [`matrix get-col`](/commands/docs/matrix_get-col.md) | Extract a column from a 2D matrix. | built-in | +| [`matrix get-row`](/commands/docs/matrix_get-row.md) | Extract a row from a matrix. | built-in | +| [`matrix identity`](/commands/docs/matrix_identity.md) | Create an identity matrix of the given size. | built-in | +| [`matrix into-nu`](/commands/docs/matrix_into-nu.md) | Convert a matrix to a nushell table (list of lists by default). | built-in | +| [`matrix map`](/commands/docs/matrix_map.md) | Apply a closure to each element of a matrix and return a new matrix. | built-in | +| [`matrix max`](/commands/docs/matrix_max.md) | Find the maximum value in a matrix, or max along an axis. | built-in | +| [`matrix mean`](/commands/docs/matrix_mean.md) | Compute the mean of all elements in a matrix. | built-in | +| [`matrix multiply`](/commands/docs/matrix_multiply.md) | Multiply two matrices using dot product. | built-in | +| [`matrix reduce`](/commands/docs/matrix_reduce.md) | Reduce all elements of a matrix to a single value. | built-in | +| [`matrix reshape`](/commands/docs/matrix_reshape.md) | Change the dimensions of a matrix. | built-in | +| [`matrix scale`](/commands/docs/matrix_scale.md) | Multiply all elements of a matrix by a scalar. | built-in | +| [`matrix set-col`](/commands/docs/matrix_set-col.md) | Replace a column in a 2D matrix. | built-in | +| [`matrix set-row`](/commands/docs/matrix_set-row.md) | Replace a row in a matrix. | built-in | +| [`matrix subtract`](/commands/docs/matrix_subtract.md) | Subtract a matrix or scalar from a matrix. | built-in | +| [`matrix sum`](/commands/docs/matrix_sum.md) | Sum all elements of a matrix, or sum along an axis. | built-in | +| [`matrix transpose`](/commands/docs/matrix_transpose.md) | Transpose a matrix (swap rows and columns). For n-dimensional arrays, reverses all axes. | built-in | +| [`matrix zeros`](/commands/docs/matrix_zeros.md) | Create a matrix filled with zeros. | built-in | \ No newline at end of file diff --git a/commands/docs/matrix_add.md b/commands/docs/matrix_add.md new file mode 100644 index 00000000000..e5007ebe88c --- /dev/null +++ b/commands/docs/matrix_add.md @@ -0,0 +1,55 @@ +--- +title: matrix add +categories: | + filters +version: 0.115.0 +filters: | + Add a matrix or scalar to a matrix. +usage: | + Add a matrix or scalar to a matrix. +editLink: false +contributors: false +--- + + +# `matrix add` for [filters](/commands/categories/filters.md) + +
Add a matrix or scalar to a matrix.
+ +## Signature + +```> matrix add {flags} (other)``` + +## Flags + + - `--broadcast, -b`: Enable broadcasting to allow compatible shapes + +## Parameters + + - `other`: The other matrix or scalar to add. + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | matrix | +## Examples + +Add a scalar to a matrix +```nu +> matrix zeros 2 2 | matrix add 5 | matrix into-nu | to nuon +[[5.0, 5.0], [5.0, 5.0]] +``` + +Add two matrices element-wise +```nu +> matrix identity 2 | matrix add (matrix identity 2) | matrix into-nu | to nuon +[[2.0, 0.0], [0.0, 2.0]] +``` + +Add with broadcasting a row vector +```nu +> matrix zeros 2 3 | matrix add --broadcast ([[1.0 2.0 3.0]] | into matrix) | matrix into-nu | to nuon +[[1.0, 2.0, 3.0], [1.0, 2.0, 3.0]] +``` diff --git a/commands/docs/matrix_get-col.md b/commands/docs/matrix_get-col.md new file mode 100644 index 00000000000..cd7ec1b7456 --- /dev/null +++ b/commands/docs/matrix_get-col.md @@ -0,0 +1,45 @@ +--- +title: matrix get-col +categories: | + filters +version: 0.115.0 +filters: | + Extract a column from a 2D matrix. +usage: | + Extract a column from a 2D matrix. +editLink: false +contributors: false +--- + + +# `matrix get-col` for [filters](/commands/categories/filters.md) + +
Extract a column from a 2D matrix.
+ +## Signature + +```> matrix get-col {flags} (index)``` + +## Parameters + + - `index`: The column index to extract (0-based). + + +## Input/output types: + +| input | output | +| ------ | ----------- | +| matrix | list<float> | +## Examples + +Get the first column of a 2x3 matrix +```nu +> matrix zeros 2 3 | matrix set-col 0 [1.0 2.0] | matrix get-col 0 | to nuon +[1.0, 2.0] +``` + +Get the second column of a 2x2 identity matrix +```nu +> matrix identity 2 | matrix get-col 1 | to nuon +[0.0, 1.0] +``` diff --git a/commands/docs/matrix_get-row.md b/commands/docs/matrix_get-row.md new file mode 100644 index 00000000000..f356159850a --- /dev/null +++ b/commands/docs/matrix_get-row.md @@ -0,0 +1,45 @@ +--- +title: matrix get-row +categories: | + filters +version: 0.115.0 +filters: | + Extract a row from a matrix. +usage: | + Extract a row from a matrix. +editLink: false +contributors: false +--- + + +# `matrix get-row` for [filters](/commands/categories/filters.md) + +
Extract a row from a matrix.
+ +## Signature + +```> matrix get-row {flags} (index)``` + +## Parameters + + - `index`: The row index to extract (0-based). + + +## Input/output types: + +| input | output | +| ------ | ----------- | +| matrix | list<float> | +## Examples + +Get the first row of a 2x3 matrix +```nu +> matrix zeros 2 3 | matrix set-row 0 [1.0 2.0 3.0] | matrix get-row 0 | to nuon +[1.0, 2.0, 3.0] +``` + +Get the second row of a 2x2 identity matrix +```nu +> matrix identity 2 | matrix get-row 1 | to nuon +[0.0, 1.0] +``` diff --git a/commands/docs/matrix_identity.md b/commands/docs/matrix_identity.md new file mode 100644 index 00000000000..a7e1970dd34 --- /dev/null +++ b/commands/docs/matrix_identity.md @@ -0,0 +1,45 @@ +--- +title: matrix identity +categories: | + filters +version: 0.115.0 +filters: | + Create an identity matrix of the given size. +usage: | + Create an identity matrix of the given size. +editLink: false +contributors: false +--- + + +# `matrix identity` for [filters](/commands/categories/filters.md) + +
Create an identity matrix of the given size.
+ +## Signature + +```> matrix identity {flags} (size)``` + +## Parameters + + - `size`: The size of the square identity matrix. + + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | matrix | +## Examples + +Create a 3x3 identity matrix +```nu +> matrix identity 3 | matrix into-nu | to nuon +[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]] +``` + +Create a 2x2 identity matrix +```nu +> matrix identity 2 | matrix into-nu | to nuon +[[1.0, 0.0], [0.0, 1.0]] +``` diff --git a/commands/docs/matrix_into-nu.md b/commands/docs/matrix_into-nu.md new file mode 100644 index 00000000000..2a64b651823 --- /dev/null +++ b/commands/docs/matrix_into-nu.md @@ -0,0 +1,45 @@ +--- +title: matrix into-nu +categories: | + conversions +version: 0.115.0 +conversions: | + Convert a matrix to a nushell table (list of lists by default). +usage: | + Convert a matrix to a nushell table (list of lists by default). +editLink: false +contributors: false +--- + + +# `matrix into-nu` for [conversions](/commands/categories/conversions.md) + +
Convert a matrix to a nushell table (list of lists by default).
+ +## Signature + +```> matrix into-nu {flags} ``` + +## Flags + + - `--as-records, -r`: Output as a list of records with auto-generated column names + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | table | +## Examples + +Convert an identity matrix to a nushell table +```nu +> matrix identity 2 | matrix into-nu | to nuon +[[1.0, 0.0], [0.0, 1.0]] +``` + +Convert a matrix to records +```nu +> matrix identity 2 | matrix into-nu --as-records | to nuon +[["col0", "col1"]; [1.0, 0.0], [0.0, 1.0]] +``` diff --git a/commands/docs/matrix_map.md b/commands/docs/matrix_map.md new file mode 100644 index 00000000000..4bf2146d8fc --- /dev/null +++ b/commands/docs/matrix_map.md @@ -0,0 +1,45 @@ +--- +title: matrix map +categories: | + filters +version: 0.115.0 +filters: | + Apply a closure to each element of a matrix and return a new matrix. +usage: | + Apply a closure to each element of a matrix and return a new matrix. +editLink: false +contributors: false +--- + + +# `matrix map` for [filters](/commands/categories/filters.md) + +
Apply a closure to each element of a matrix and return a new matrix.
+ +## Signature + +```> matrix map {flags} (closure)``` + +## Parameters + + - `closure`: The closure to apply to each element. + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | matrix | +## Examples + +Double each element in a matrix +```nu +> [[1 2] [3 4]] | into matrix | matrix map {|e| $e * 2} | matrix into-nu | to nuon +[[2.0, 4.0], [6.0, 8.0]] +``` + +Add 10 to each element of an identity matrix +```nu +> matrix identity 2 | matrix map {|e| $e + 10} | matrix into-nu | to nuon +[[11.0, 10.0], [10.0, 11.0]] +``` diff --git a/commands/docs/matrix_max.md b/commands/docs/matrix_max.md new file mode 100644 index 00000000000..03a25028fe0 --- /dev/null +++ b/commands/docs/matrix_max.md @@ -0,0 +1,52 @@ +--- +title: matrix max +categories: | + filters +version: 0.115.0 +filters: | + Find the maximum value in a matrix, or max along an axis. +usage: | + Find the maximum value in a matrix, or max along an axis. +editLink: false +contributors: false +--- + + +# `matrix max` for [filters](/commands/categories/filters.md) + +
Find the maximum value in a matrix, or max along an axis.
+ +## Signature + +```> matrix max {flags} ``` + +## Flags + + - `--axis, -a {int}`: The axis to find the max along (0-based). + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | float | +| matrix | matrix | +## Examples + +Find the maximum element in a matrix +```nu +> [[1 2] [3 4]] | into matrix | matrix max +4.0 +``` + +Find max along rows (axis 0) +```nu +> [[1 2] [3 4]] | into matrix | matrix max --axis 0 | matrix into-nu | to nuon +[[3.0, 4.0]] +``` + +Find max along columns (axis 1) +```nu +> [[1 2] [3 4]] | into matrix | matrix max --axis 1 | matrix into-nu | to nuon +[[2.0, 4.0]] +``` diff --git a/commands/docs/matrix_mean.md b/commands/docs/matrix_mean.md new file mode 100644 index 00000000000..d7e3a3a3764 --- /dev/null +++ b/commands/docs/matrix_mean.md @@ -0,0 +1,41 @@ +--- +title: matrix mean +categories: | + filters +version: 0.115.0 +filters: | + Compute the mean of all elements in a matrix. +usage: | + Compute the mean of all elements in a matrix. +editLink: false +contributors: false +--- + + +# `matrix mean` for [filters](/commands/categories/filters.md) + +
Compute the mean of all elements in a matrix.
+ +## Signature + +```> matrix mean {flags} ``` + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | float | +## Examples + +Compute the mean of a 2x2 matrix +```nu +> [[1 2] [3 4]] | into matrix | matrix mean +2.5 +``` + +Compute the mean of an identity matrix +```nu +> matrix identity 2 | matrix mean +0.5 +``` diff --git a/commands/docs/matrix_multiply.md b/commands/docs/matrix_multiply.md new file mode 100644 index 00000000000..57a7851cdb3 --- /dev/null +++ b/commands/docs/matrix_multiply.md @@ -0,0 +1,63 @@ +--- +title: matrix multiply +categories: | + filters +version: 0.115.0 +filters: | + Multiply two matrices using dot product. +usage: | + Multiply two matrices using dot product. +editLink: false +contributors: false +--- + + +# `matrix multiply` for [filters](/commands/categories/filters.md) + +
Multiply two matrices using dot product.
+ +## Signature + +```> matrix multiply {flags} (other) ...rest``` + +## Flags + + - `--swap, -s`: Swap the left and right operands. + - `--multall, -a`: Multiply the input matrix with all matrices given as arguments, chaining them left to right (e.g., `$a | matrix multiply --multall $b $c` multiplies all three together). + +## Parameters + + - `other`: The other matrix to multiply with. + - `...rest`: Additional matrices for chained multiplication (requires --multall). + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | matrix | +## Examples + +Multiply two 2x2 matrices +```nu +> [[1 2] [3 4]] | into matrix | matrix multiply ([[1 0] [0 1]] | into matrix) | matrix into-nu | to nuon +[[1.0, 2.0], [3.0, 4.0]] +``` + +Multiply a matrix by its inverse gives identity +```nu +> matrix identity 2 | matrix multiply (matrix identity 2) | matrix into-nu | to nuon +[[1.0, 0.0], [0.0, 1.0]] +``` + +Swap operands with --swap +```nu +> [[1 2] [3 4]] | into matrix | matrix multiply --swap ([[0 1] [1 0]] | into matrix) | matrix into-nu | to nuon +[[3.0, 4.0], [1.0, 2.0]] +``` + +Chain-multiply three matrices with --multall +```nu +> matrix identity 2 | matrix multiply --multall ([[2 0] [0 2]] | into matrix) ([[3 0] [0 3]] | into matrix) | matrix into-nu | to nuon +[[6.0, 0.0], [0.0, 6.0]] +``` diff --git a/commands/docs/matrix_reduce.md b/commands/docs/matrix_reduce.md new file mode 100644 index 00000000000..1ebc353e304 --- /dev/null +++ b/commands/docs/matrix_reduce.md @@ -0,0 +1,55 @@ +--- +title: matrix reduce +categories: | + filters +version: 0.115.0 +filters: | + Reduce all elements of a matrix to a single value. +usage: | + Reduce all elements of a matrix to a single value. +editLink: false +contributors: false +--- + + +# `matrix reduce` for [filters](/commands/categories/filters.md) + +
Reduce all elements of a matrix to a single value.
+ +## Signature + +```> matrix reduce {flags} (closure)``` + +## Flags + + - `--fold, -f {any}`: The initial value for the accumulator + +## Parameters + + - `closure`: Reducing function. Arguments are the current element, then the accumulator (same order as `reduce`). + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | any | +## Examples + +Sum all elements of a 2x2 matrix +```nu +> [[1 2] [3 4]] | into matrix | matrix reduce --fold 0.0 {|e, acc| $acc + $e} +10.0 +``` + +Product of all elements in a matrix +```nu +> [[1 2] [3 4]] | into matrix | matrix reduce --fold 1.0 {|e, acc| $acc * $e} +24.0 +``` + +Sum without an initial value (uses first element as starting accumulator) +```nu +> [[1 2] [3 4]] | into matrix | matrix reduce {|e, acc| $acc + $e} +10.0 +``` diff --git a/commands/docs/matrix_reshape.md b/commands/docs/matrix_reshape.md new file mode 100644 index 00000000000..a69a0366b88 --- /dev/null +++ b/commands/docs/matrix_reshape.md @@ -0,0 +1,50 @@ +--- +title: matrix reshape +categories: | + filters +version: 0.115.0 +filters: | + Change the dimensions of a matrix. +usage: | + Change the dimensions of a matrix. +editLink: false +contributors: false +--- + + +# `matrix reshape` for [filters](/commands/categories/filters.md) + +
Change the dimensions of a matrix.
+ +## Signature + +```> matrix reshape {flags} (dimensions) ...rest``` + +## Flags + + - `--flatten, -f`: Flatten the matrix to a 1D vector + +## Parameters + + - `dimensions`: The new dimensions (e.g., 2 3 for a 2x3 matrix). Required unless --flatten is used. + - `...rest`: Additional dimensions for n-dimensional reshaping. + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | matrix | +## Examples + +Reshape a 1x6 matrix to 2x3 +```nu +> [[1 2 3 4 5 6]] | into matrix | matrix reshape 2 3 | matrix into-nu | to nuon +[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]] +``` + +Flatten a 2x2 matrix to 1D +```nu +> matrix identity 2 | matrix reshape --flatten | matrix into-nu | to nuon +[[1.0, 0.0, 0.0, 1.0]] +``` diff --git a/commands/docs/matrix_scale.md b/commands/docs/matrix_scale.md new file mode 100644 index 00000000000..b9188ee0745 --- /dev/null +++ b/commands/docs/matrix_scale.md @@ -0,0 +1,45 @@ +--- +title: matrix scale +categories: | + filters +version: 0.115.0 +filters: | + Multiply all elements of a matrix by a scalar. +usage: | + Multiply all elements of a matrix by a scalar. +editLink: false +contributors: false +--- + + +# `matrix scale` for [filters](/commands/categories/filters.md) + +
Multiply all elements of a matrix by a scalar.
+ +## Signature + +```> matrix scale {flags} (scalar)``` + +## Parameters + + - `scalar`: The scalar to multiply each element by. + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | matrix | +## Examples + +Scale a matrix by an integer +```nu +> matrix identity 2 | matrix scale 3 | matrix into-nu | to nuon +[[3.0, 0.0], [0.0, 3.0]] +``` + +Scale a matrix by a float +```nu +> matrix identity 2 | matrix scale 0.5 | matrix into-nu | to nuon +[[0.5, 0.0], [0.0, 0.5]] +``` diff --git a/commands/docs/matrix_set-col.md b/commands/docs/matrix_set-col.md new file mode 100644 index 00000000000..5897aae0cbe --- /dev/null +++ b/commands/docs/matrix_set-col.md @@ -0,0 +1,46 @@ +--- +title: matrix set-col +categories: | + filters +version: 0.115.0 +filters: | + Replace a column in a 2D matrix. +usage: | + Replace a column in a 2D matrix. +editLink: false +contributors: false +--- + + +# `matrix set-col` for [filters](/commands/categories/filters.md) + +
Replace a column in a 2D matrix.
+ +## Signature + +```> matrix set-col {flags} (index) (replacement)``` + +## Parameters + + - `index`: The column index to replace (0-based). + - `replacement`: The new column values as a list of numbers. + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | matrix | +## Examples + +Replace the first column of a 2x3 matrix +```nu +> matrix zeros 2 3 | matrix set-col 0 [1.0 2.0] | matrix into-nu | to nuon +[[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]] +``` + +Replace the second column of a 2x2 matrix +```nu +> matrix zeros 2 2 | matrix set-col 1 [4.0 5.0] | matrix into-nu | to nuon +[[0.0, 4.0], [0.0, 5.0]] +``` diff --git a/commands/docs/matrix_set-row.md b/commands/docs/matrix_set-row.md new file mode 100644 index 00000000000..f8870dc3f20 --- /dev/null +++ b/commands/docs/matrix_set-row.md @@ -0,0 +1,46 @@ +--- +title: matrix set-row +categories: | + filters +version: 0.115.0 +filters: | + Replace a row in a matrix. +usage: | + Replace a row in a matrix. +editLink: false +contributors: false +--- + + +# `matrix set-row` for [filters](/commands/categories/filters.md) + +
Replace a row in a matrix.
+ +## Signature + +```> matrix set-row {flags} (index) (replacement)``` + +## Parameters + + - `index`: The row index to replace (0-based). + - `replacement`: The new row values as a list of numbers. + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | matrix | +## Examples + +Replace the first row of a 2x3 matrix +```nu +> matrix zeros 2 3 | matrix set-row 0 [1.0 2.0 3.0] | matrix into-nu | to nuon +[[1.0, 2.0, 3.0], [0.0, 0.0, 0.0]] +``` + +Replace the second row of a 2x2 matrix +```nu +> matrix zeros 2 2 | matrix set-row 1 [4.0 5.0] | matrix into-nu | to nuon +[[0.0, 0.0], [4.0, 5.0]] +``` diff --git a/commands/docs/matrix_subtract.md b/commands/docs/matrix_subtract.md new file mode 100644 index 00000000000..757fc87cc23 --- /dev/null +++ b/commands/docs/matrix_subtract.md @@ -0,0 +1,55 @@ +--- +title: matrix subtract +categories: | + filters +version: 0.115.0 +filters: | + Subtract a matrix or scalar from a matrix. +usage: | + Subtract a matrix or scalar from a matrix. +editLink: false +contributors: false +--- + + +# `matrix subtract` for [filters](/commands/categories/filters.md) + +
Subtract a matrix or scalar from a matrix.
+ +## Signature + +```> matrix subtract {flags} (other)``` + +## Flags + + - `--broadcast, -b`: Enable broadcasting to allow compatible shapes + +## Parameters + + - `other`: The other matrix or scalar to subtract. + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | matrix | +## Examples + +Subtract a scalar from a matrix +```nu +> matrix zeros 2 2 | matrix add 5 | matrix subtract 2 | matrix into-nu | to nuon +[[3.0, 3.0], [3.0, 3.0]] +``` + +Subtract two matrices element-wise +```nu +> matrix identity 2 | matrix add 5 | matrix subtract (matrix identity 2) | matrix into-nu | to nuon +[[5.0, 5.0], [5.0, 5.0]] +``` + +Subtract with broadcasting a row vector +```nu +> matrix zeros 2 3 | matrix add 5 | matrix subtract --broadcast ([[1.0 2.0 3.0]] | into matrix) | matrix into-nu | to nuon +[[4.0, 3.0, 2.0], [4.0, 3.0, 2.0]] +``` diff --git a/commands/docs/matrix_sum.md b/commands/docs/matrix_sum.md new file mode 100644 index 00000000000..055cdf7704f --- /dev/null +++ b/commands/docs/matrix_sum.md @@ -0,0 +1,52 @@ +--- +title: matrix sum +categories: | + filters +version: 0.115.0 +filters: | + Sum all elements of a matrix, or sum along an axis. +usage: | + Sum all elements of a matrix, or sum along an axis. +editLink: false +contributors: false +--- + + +# `matrix sum` for [filters](/commands/categories/filters.md) + +
Sum all elements of a matrix, or sum along an axis.
+ +## Signature + +```> matrix sum {flags} ``` + +## Flags + + - `--axis, -a {int}`: The axis to sum along (0-based). + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | float | +| matrix | matrix | +## Examples + +Sum all elements of a 2x2 matrix +```nu +> [[1 2] [3 4]] | into matrix | matrix sum +10.0 +``` + +Sum along rows (axis 0) +```nu +> [[1 2] [3 4]] | into matrix | matrix sum --axis 0 | matrix into-nu | to nuon +[[4.0, 6.0]] +``` + +Sum along columns (axis 1) +```nu +> [[1 2] [3 4]] | into matrix | matrix sum --axis 1 | matrix into-nu | to nuon +[[3.0, 7.0]] +``` diff --git a/commands/docs/matrix_transpose.md b/commands/docs/matrix_transpose.md new file mode 100644 index 00000000000..e7d594425c3 --- /dev/null +++ b/commands/docs/matrix_transpose.md @@ -0,0 +1,41 @@ +--- +title: matrix transpose +categories: | + filters +version: 0.115.0 +filters: | + Transpose a matrix (swap rows and columns). For n-dimensional arrays, reverses all axes. +usage: | + Transpose a matrix (swap rows and columns). For n-dimensional arrays, reverses all axes. +editLink: false +contributors: false +--- + + +# `matrix transpose` for [filters](/commands/categories/filters.md) + +
Transpose a matrix (swap rows and columns). For n-dimensional arrays, reverses all axes.
+ +## Signature + +```> matrix transpose {flags} ``` + + +## Input/output types: + +| input | output | +| ------ | ------ | +| matrix | matrix | +## Examples + +Transpose a 2x3 matrix to a 3x2 matrix +```nu +> [[1 2 3] [4 5 6]] | into matrix | matrix transpose | matrix into-nu | to nuon +[[1.0, 4.0], [2.0, 5.0], [3.0, 6.0]] +``` + +Transpose an identity matrix (result is the same) +```nu +> matrix identity 2 | matrix transpose | matrix into-nu | to nuon +[[1.0, 0.0], [0.0, 1.0]] +``` diff --git a/commands/docs/matrix_zeros.md b/commands/docs/matrix_zeros.md new file mode 100644 index 00000000000..a11223a626e --- /dev/null +++ b/commands/docs/matrix_zeros.md @@ -0,0 +1,46 @@ +--- +title: matrix zeros +categories: | + filters +version: 0.115.0 +filters: | + Create a matrix filled with zeros. +usage: | + Create a matrix filled with zeros. +editLink: false +contributors: false +--- + + +# `matrix zeros` for [filters](/commands/categories/filters.md) + +
Create a matrix filled with zeros.
+ +## Signature + +```> matrix zeros {flags} (dimensions) ...rest``` + +## Parameters + + - `dimensions`: The dimensions of the zero matrix (e.g., 3 4 for a 3x4 matrix). + - `...rest`: Additional dimensions for n-dimensional arrays. + + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | matrix | +## Examples + +Create a 3x4 matrix of zeros +```nu +> matrix zeros 3 4 | matrix into-nu | to nuon +[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]] +``` + +Create a 2x2 matrix of zeros +```nu +> matrix zeros 2 2 | matrix into-nu | to nuon +[[0.0, 0.0], [0.0, 0.0]] +``` diff --git a/commands/docs/merge.md b/commands/docs/merge.md index 958ee96d8a2..8849711084f 100644 --- a/commands/docs/merge.md +++ b/commands/docs/merge.md @@ -2,7 +2,7 @@ title: merge categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Merge the input with a record or table, overwriting values in matching columns. usage: | diff --git a/commands/docs/merge_deep.md b/commands/docs/merge_deep.md index e3f69daf54c..fd4ad762abe 100644 --- a/commands/docs/merge_deep.md +++ b/commands/docs/merge_deep.md @@ -2,7 +2,7 @@ title: merge deep categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Merge the input with a record or table, recursively merging values in matching columns. usage: | diff --git a/commands/docs/metadata.md b/commands/docs/metadata.md index e2a39924529..46f038060d0 100644 --- a/commands/docs/metadata.md +++ b/commands/docs/metadata.md @@ -2,7 +2,7 @@ title: metadata categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Get the metadata for items in the stream. usage: | diff --git a/commands/docs/metadata_access.md b/commands/docs/metadata_access.md index 0f277b8d9a5..3e4a08f05cf 100644 --- a/commands/docs/metadata_access.md +++ b/commands/docs/metadata_access.md @@ -2,7 +2,7 @@ title: metadata access categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Access the metadata for the input stream within a closure. usage: | diff --git a/commands/docs/metadata_set.md b/commands/docs/metadata_set.md index 7acb378c673..be7552bb53f 100644 --- a/commands/docs/metadata_set.md +++ b/commands/docs/metadata_set.md @@ -2,7 +2,7 @@ title: metadata set categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Set the metadata for items in the stream. usage: | diff --git a/commands/docs/mkdir.md b/commands/docs/mkdir.md index a83c6162286..689d11fa328 100644 --- a/commands/docs/mkdir.md +++ b/commands/docs/mkdir.md @@ -2,7 +2,7 @@ title: mkdir categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Create directories, with intermediary directories if required using uutils/coreutils mkdir. usage: | diff --git a/commands/docs/mktemp.md b/commands/docs/mktemp.md index a14eb96f2c6..3d64ad3f5ad 100644 --- a/commands/docs/mktemp.md +++ b/commands/docs/mktemp.md @@ -2,7 +2,7 @@ title: mktemp categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Create temporary files or directories using uutils/coreutils mktemp. usage: | diff --git a/commands/docs/module.md b/commands/docs/module.md index fc0f2fc6f65..cfbbf89912c 100644 --- a/commands/docs/module.md +++ b/commands/docs/module.md @@ -2,7 +2,7 @@ title: module categories: | core -version: 0.114.0 +version: 0.115.0 core: | Define a custom module. usage: | diff --git a/commands/docs/move.md b/commands/docs/move.md index 4d0dd0ff62d..36cd3dc2090 100644 --- a/commands/docs/move.md +++ b/commands/docs/move.md @@ -2,7 +2,7 @@ title: move categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Moves columns relative to other columns or make them the first/last columns. Flags are mutually exclusive. usage: | diff --git a/commands/docs/mut.md b/commands/docs/mut.md index b2523f55309..c3e7adf7d48 100644 --- a/commands/docs/mut.md +++ b/commands/docs/mut.md @@ -2,7 +2,7 @@ title: mut categories: | core -version: 0.114.0 +version: 0.115.0 core: | Create a mutable variable and give it a value. usage: | diff --git a/commands/docs/mv.md b/commands/docs/mv.md index 2391e6c57b0..6cc2d4e4d0c 100644 --- a/commands/docs/mv.md +++ b/commands/docs/mv.md @@ -2,7 +2,7 @@ title: mv categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Move files or directories using uutils/coreutils mv. usage: | diff --git a/commands/docs/nu-check.md b/commands/docs/nu-check.md index d9567a3178f..61b6a62f989 100644 --- a/commands/docs/nu-check.md +++ b/commands/docs/nu-check.md @@ -2,7 +2,7 @@ title: nu-check categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Validate and parse Nushell input content. usage: | diff --git a/commands/docs/nu-highlight.md b/commands/docs/nu-highlight.md index 07908f86e74..fc52b564324 100644 --- a/commands/docs/nu-highlight.md +++ b/commands/docs/nu-highlight.md @@ -2,7 +2,7 @@ title: nu-highlight categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Syntax highlight the input string. usage: | diff --git a/commands/docs/open.md b/commands/docs/open.md index cabe6761480..3d2d7054e26 100644 --- a/commands/docs/open.md +++ b/commands/docs/open.md @@ -2,7 +2,7 @@ title: open categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Load a file into a cell, converting to table if possible (avoid by appending '--raw'). usage: | diff --git a/commands/docs/overlay.md b/commands/docs/overlay.md index f92279f9d8d..b648e288311 100644 --- a/commands/docs/overlay.md +++ b/commands/docs/overlay.md @@ -2,7 +2,7 @@ title: overlay categories: | core -version: 0.114.0 +version: 0.115.0 core: | Commands for manipulating overlays. usage: | diff --git a/commands/docs/overlay_hide.md b/commands/docs/overlay_hide.md index c5e60232b8b..dbf6a69ea8f 100644 --- a/commands/docs/overlay_hide.md +++ b/commands/docs/overlay_hide.md @@ -2,7 +2,7 @@ title: overlay hide categories: | core -version: 0.114.0 +version: 0.115.0 core: | Hide an active overlay. usage: | diff --git a/commands/docs/overlay_list.md b/commands/docs/overlay_list.md index c8594470f54..61b46295a70 100644 --- a/commands/docs/overlay_list.md +++ b/commands/docs/overlay_list.md @@ -2,7 +2,7 @@ title: overlay list categories: | core -version: 0.114.0 +version: 0.115.0 core: | List all overlays with their active status. usage: | diff --git a/commands/docs/overlay_new.md b/commands/docs/overlay_new.md index 44eb3b37e84..4af4eb1a6a5 100644 --- a/commands/docs/overlay_new.md +++ b/commands/docs/overlay_new.md @@ -2,7 +2,7 @@ title: overlay new categories: | core -version: 0.114.0 +version: 0.115.0 core: | Create an empty overlay. usage: | diff --git a/commands/docs/overlay_use.md b/commands/docs/overlay_use.md index 6565b9dd083..917ffb0fd66 100644 --- a/commands/docs/overlay_use.md +++ b/commands/docs/overlay_use.md @@ -2,7 +2,7 @@ title: overlay use categories: | core -version: 0.114.0 +version: 0.115.0 core: | Use definitions from a module as an overlay. usage: | diff --git a/commands/docs/panic.md b/commands/docs/panic.md index 733be65d717..226fbd84f49 100644 --- a/commands/docs/panic.md +++ b/commands/docs/panic.md @@ -2,7 +2,7 @@ title: panic categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Causes nushell to panic. usage: | diff --git a/commands/docs/par-each.md b/commands/docs/par-each.md index 3e8dda8d441..7636e50c0f3 100644 --- a/commands/docs/par-each.md +++ b/commands/docs/par-each.md @@ -2,7 +2,7 @@ title: par-each categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Run a closure on each row of the input list in parallel, creating a new list with the results. usage: | @@ -86,3 +86,6 @@ Iterate over each element, producing a list showing indexes of any 2s. ╰───┴───────────────╯ ``` + +## Notes + Uses a dedicated thread pool (reused across top-level calls; sized by --threads when set). Nested par-each calls use a private pool so they cannot deadlock on the outer pool. \ No newline at end of file diff --git a/commands/docs/parse.md b/commands/docs/parse.md index bf0d71feee1..16908cbc29d 100644 --- a/commands/docs/parse.md +++ b/commands/docs/parse.md @@ -2,7 +2,7 @@ title: parse categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Parse columns from string data using a simple pattern or a supplied regular expression. usage: | diff --git a/commands/docs/path.md b/commands/docs/path.md index 90414d25c80..b54ba6ae242 100644 --- a/commands/docs/path.md +++ b/commands/docs/path.md @@ -2,7 +2,7 @@ title: path categories: | path -version: 0.114.0 +version: 0.115.0 path: | Explore and manipulate paths. usage: | diff --git a/commands/docs/path_basename.md b/commands/docs/path_basename.md index 88f17549338..699dcc8db20 100644 --- a/commands/docs/path_basename.md +++ b/commands/docs/path_basename.md @@ -2,7 +2,7 @@ title: path basename categories: | path -version: 0.114.0 +version: 0.115.0 path: | Get the final component of a path. usage: | diff --git a/commands/docs/path_dirname.md b/commands/docs/path_dirname.md index 371d1b1f9e7..71c962f1ee9 100644 --- a/commands/docs/path_dirname.md +++ b/commands/docs/path_dirname.md @@ -2,7 +2,7 @@ title: path dirname categories: | path -version: 0.114.0 +version: 0.115.0 path: | Get the parent directory of a path. usage: | diff --git a/commands/docs/path_exists.md b/commands/docs/path_exists.md index dced85bdd56..43f30d0672c 100644 --- a/commands/docs/path_exists.md +++ b/commands/docs/path_exists.md @@ -2,7 +2,7 @@ title: path exists categories: | path -version: 0.114.0 +version: 0.115.0 path: | Check whether a path exists. usage: | diff --git a/commands/docs/path_expand.md b/commands/docs/path_expand.md index 68c2b1b985d..a0afc641571 100644 --- a/commands/docs/path_expand.md +++ b/commands/docs/path_expand.md @@ -2,7 +2,7 @@ title: path expand categories: | path -version: 0.114.0 +version: 0.115.0 path: | Try to expand a path to its absolute form. usage: | diff --git a/commands/docs/path_join.md b/commands/docs/path_join.md index c2bbbaf5109..e864a03c68d 100644 --- a/commands/docs/path_join.md +++ b/commands/docs/path_join.md @@ -2,7 +2,7 @@ title: path join categories: | path -version: 0.114.0 +version: 0.115.0 path: | Join a structured path or a list of path parts. usage: | diff --git a/commands/docs/path_parse.md b/commands/docs/path_parse.md index dec6fa9b7f6..c832f712ad0 100644 --- a/commands/docs/path_parse.md +++ b/commands/docs/path_parse.md @@ -2,7 +2,7 @@ title: path parse categories: | path -version: 0.114.0 +version: 0.115.0 path: | Convert a path into structured data. usage: | diff --git a/commands/docs/path_relative-to.md b/commands/docs/path_relative-to.md index c2f3dee04df..2a08ac7b254 100644 --- a/commands/docs/path_relative-to.md +++ b/commands/docs/path_relative-to.md @@ -2,7 +2,7 @@ title: path relative-to categories: | path -version: 0.114.0 +version: 0.115.0 path: | Express a path as relative to another path. usage: | diff --git a/commands/docs/path_self.md b/commands/docs/path_self.md index c52a1148b5f..ebec9a81eab 100644 --- a/commands/docs/path_self.md +++ b/commands/docs/path_self.md @@ -2,7 +2,7 @@ title: path self categories: | path -version: 0.114.0 +version: 0.115.0 path: | Get the absolute path of the script or module containing this command at parse time. usage: | diff --git a/commands/docs/path_split.md b/commands/docs/path_split.md index e82f5ba4cf4..3a3794547c2 100644 --- a/commands/docs/path_split.md +++ b/commands/docs/path_split.md @@ -2,7 +2,7 @@ title: path split categories: | path -version: 0.114.0 +version: 0.115.0 path: | Split a path into a list based on the system's path separator. usage: | diff --git a/commands/docs/path_type.md b/commands/docs/path_type.md index 6da51f361c0..a16b555c034 100644 --- a/commands/docs/path_type.md +++ b/commands/docs/path_type.md @@ -2,7 +2,7 @@ title: path type categories: | path -version: 0.114.0 +version: 0.115.0 path: | Get the type of the object a path refers to (e.g., file, dir, symlink). usage: | @@ -35,6 +35,12 @@ Show type of a filepath. dir ``` +Empty string is not a path. +```nu +> '' | path type | is-empty +true +``` + Show type of filepaths in a list. ```nu > ls | get name | path type diff --git a/commands/docs/peek.md b/commands/docs/peek.md index 427b9b41beb..d3f9200c3a5 100644 --- a/commands/docs/peek.md +++ b/commands/docs/peek.md @@ -2,7 +2,7 @@ title: peek categories: | default -version: 0.114.0 +version: 0.115.0 default: | Peek the first elements of a stream and store them in the metadata. usage: | diff --git a/commands/docs/permutations.md b/commands/docs/permutations.md index 799d5d64025..92d091bf767 100644 --- a/commands/docs/permutations.md +++ b/commands/docs/permutations.md @@ -2,7 +2,7 @@ title: permutations categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Generates all permutations of the input list. usage: | diff --git a/commands/docs/plugin.md b/commands/docs/plugin.md index 9a757a44ec2..f88709de665 100644 --- a/commands/docs/plugin.md +++ b/commands/docs/plugin.md @@ -2,7 +2,7 @@ title: plugin categories: | plugin -version: 0.114.0 +version: 0.115.0 plugin: | Commands for managing plugins. usage: | diff --git a/commands/docs/plugin_add.md b/commands/docs/plugin_add.md index a54dba977b9..a87a0601680 100644 --- a/commands/docs/plugin_add.md +++ b/commands/docs/plugin_add.md @@ -2,7 +2,7 @@ title: plugin add categories: | plugin -version: 0.114.0 +version: 0.115.0 plugin: | Add a plugin to the plugin registry file. usage: | diff --git a/commands/docs/plugin_list.md b/commands/docs/plugin_list.md index 3239e5ec5c9..1f8508db926 100644 --- a/commands/docs/plugin_list.md +++ b/commands/docs/plugin_list.md @@ -2,7 +2,7 @@ title: plugin list categories: | plugin -version: 0.114.0 +version: 0.115.0 plugin: | List loaded and installed plugins. usage: | @@ -40,7 +40,7 @@ List installed plugins. ╭───┬──────┬────────────────────┬─────────┬────────┬───────────────────────────────┬───────┬─────────────────╮ │ # │ name │ version │ status │ pid │ filename │ shell │ commands │ ├───┼──────┼────────────────────┼─────────┼────────┼───────────────────────────────┼───────┼─────────────────┤ -│ 0 │ inc │ 0.114.0 │ running │ 106480 │ /opt/nu/plugins/nu_plugin_inc │ │ ╭───┬─────┬───╮ │ +│ 0 │ inc │ 0.115.0 │ running │ 106480 │ /opt/nu/plugins/nu_plugin_inc │ │ ╭───┬─────┬───╮ │ │ │ │ │ │ │ │ │ │ # │ nam │ d │ │ │ │ │ │ │ │ │ │ │ │ e │ e │ │ │ │ │ │ │ │ │ │ │ │ │ s │ │ diff --git a/commands/docs/plugin_rm.md b/commands/docs/plugin_rm.md index 35edcad01c7..1ba3f040da6 100644 --- a/commands/docs/plugin_rm.md +++ b/commands/docs/plugin_rm.md @@ -2,7 +2,7 @@ title: plugin rm categories: | plugin -version: 0.114.0 +version: 0.115.0 plugin: | Remove a plugin from the plugin registry file. usage: | diff --git a/commands/docs/plugin_stop.md b/commands/docs/plugin_stop.md index 53a428c6a2e..489bca6126b 100644 --- a/commands/docs/plugin_stop.md +++ b/commands/docs/plugin_stop.md @@ -2,7 +2,7 @@ title: plugin stop categories: | plugin -version: 0.114.0 +version: 0.115.0 plugin: | Stop an installed plugin if it was running. usage: | diff --git a/commands/docs/plugin_use.md b/commands/docs/plugin_use.md index 74520b82e08..5234bf18698 100644 --- a/commands/docs/plugin_use.md +++ b/commands/docs/plugin_use.md @@ -2,7 +2,7 @@ title: plugin use categories: | plugin -version: 0.114.0 +version: 0.115.0 plugin: | Load a plugin from the plugin registry file into scope. usage: | diff --git a/commands/docs/polars.md b/commands/docs/polars.md index 20c6dcf5b3e..86068c991b0 100644 --- a/commands/docs/polars.md +++ b/commands/docs/polars.md @@ -2,7 +2,7 @@ title: polars categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Operate with data in a dataframe format. usage: | @@ -160,7 +160,7 @@ to the `polars agg` command with some column expressions for aggregation which t | [`polars replace`](/commands/docs/polars_replace.md) | Create an expression that replaces old values with new values | plugin | | [`polars replace-time-zone`](/commands/docs/polars_replace-time-zone.md) | Replace the timezone information in a datetime column. | plugin | | [`polars reverse`](/commands/docs/polars_reverse.md) | Reverses the LazyFrame | plugin | -| [`polars rolling`](/commands/docs/polars_rolling.md) | Rolling calculation for a series. | plugin | +| [`polars rolling`](/commands/docs/polars_rolling.md) | Rolling calculation for a series or expression, or a rolling group-by for a lazyframe. | plugin | | [`polars sample`](/commands/docs/polars_sample.md) | Create sample dataframe. | plugin | | [`polars save`](/commands/docs/polars_save.md) | Saves a dataframe to disk. For lazy dataframes a sink operation will be used if the file type supports it (parquet, ipc/arrow, csv, and ndjson). | plugin | | [`polars schema`](/commands/docs/polars_schema.md) | Show schema for a dataframe. | plugin | diff --git a/commands/docs/polars_agg-groups.md b/commands/docs/polars_agg-groups.md index 2f7ecb5c2ee..e7037757bc6 100644 --- a/commands/docs/polars_agg-groups.md +++ b/commands/docs/polars_agg-groups.md @@ -2,7 +2,7 @@ title: polars agg-groups categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates an agg_groups expression. usage: | diff --git a/commands/docs/polars_agg.md b/commands/docs/polars_agg.md index 072c89a7438..9f36a04bc1d 100644 --- a/commands/docs/polars_agg.md +++ b/commands/docs/polars_agg.md @@ -2,7 +2,7 @@ title: polars agg categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Performs a series of aggregations from a group-by. usage: | @@ -31,6 +31,7 @@ contributors: false | ---------------- | ---------------- | | polars_dataframe | polars_dataframe | | polars_lazyframe | polars_lazyframe | +| polars_group_by | polars_lazyframe | ## Examples Group by and perform an aggregation diff --git a/commands/docs/polars_all-false.md b/commands/docs/polars_all-false.md index e8523e1b32b..1c19a202eb5 100644 --- a/commands/docs/polars_all-false.md +++ b/commands/docs/polars_all-false.md @@ -2,7 +2,7 @@ title: polars all-false categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Returns true if all values are false. usage: | diff --git a/commands/docs/polars_all-true.md b/commands/docs/polars_all-true.md index 2e24b72c765..a37343aa487 100644 --- a/commands/docs/polars_all-true.md +++ b/commands/docs/polars_all-true.md @@ -2,7 +2,7 @@ title: polars all-true categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Returns true if all values are true. usage: | diff --git a/commands/docs/polars_append.md b/commands/docs/polars_append.md index 2b4958f0e70..f8f66a92dc6 100644 --- a/commands/docs/polars_append.md +++ b/commands/docs/polars_append.md @@ -2,7 +2,7 @@ title: polars append categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Appends a new dataframe. usage: | diff --git a/commands/docs/polars_arg-max.md b/commands/docs/polars_arg-max.md index 8d0f2dd111f..26f16474952 100644 --- a/commands/docs/polars_arg-max.md +++ b/commands/docs/polars_arg-max.md @@ -2,7 +2,7 @@ title: polars arg-max categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Return index for max value in series. usage: | diff --git a/commands/docs/polars_arg-min.md b/commands/docs/polars_arg-min.md index 65c92d66b32..f40f49647fe 100644 --- a/commands/docs/polars_arg-min.md +++ b/commands/docs/polars_arg-min.md @@ -2,7 +2,7 @@ title: polars arg-min categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Return index for min value in series. usage: | diff --git a/commands/docs/polars_arg-sort.md b/commands/docs/polars_arg-sort.md index dc5139cc9b8..51e3b8207d4 100644 --- a/commands/docs/polars_arg-sort.md +++ b/commands/docs/polars_arg-sort.md @@ -2,7 +2,7 @@ title: polars arg-sort categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Returns indexes for a sorted series. usage: | diff --git a/commands/docs/polars_arg-true.md b/commands/docs/polars_arg-true.md index 75a243f12fc..10aeb0eb875 100644 --- a/commands/docs/polars_arg-true.md +++ b/commands/docs/polars_arg-true.md @@ -2,7 +2,7 @@ title: polars arg-true categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Returns indexes where values are true. usage: | diff --git a/commands/docs/polars_arg-unique.md b/commands/docs/polars_arg-unique.md index cd09ed8a9b5..bb19f138f5d 100644 --- a/commands/docs/polars_arg-unique.md +++ b/commands/docs/polars_arg-unique.md @@ -2,7 +2,7 @@ title: polars arg-unique categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Returns indexes for unique values. usage: | diff --git a/commands/docs/polars_arg-where.md b/commands/docs/polars_arg-where.md index cdc060e0bb7..211e04a39a1 100644 --- a/commands/docs/polars_arg-where.md +++ b/commands/docs/polars_arg-where.md @@ -2,7 +2,7 @@ title: polars arg-where categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates an expression that returns the arguments where expression is true. usage: | diff --git a/commands/docs/polars_as-date.md b/commands/docs/polars_as-date.md index dfe65435b2f..daa8cf9063f 100644 --- a/commands/docs/polars_as-date.md +++ b/commands/docs/polars_as-date.md @@ -2,7 +2,7 @@ title: polars as-date categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Converts string to date. usage: | diff --git a/commands/docs/polars_as-datetime.md b/commands/docs/polars_as-datetime.md index f7742a708ef..d4fec777d6a 100644 --- a/commands/docs/polars_as-datetime.md +++ b/commands/docs/polars_as-datetime.md @@ -2,7 +2,7 @@ title: polars as-datetime categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Converts string to datetime. usage: | @@ -89,10 +89,10 @@ Converts string to datetime using the `--not-exact` flag even with excessive sym ╭───┬──────────────╮ │ # │ datetime │ ├───┼──────────────┤ -│ 0 │ 8 months ago │ -│ 1 │ 8 months ago │ -│ 2 │ 8 months ago │ -│ 3 │ 8 months ago │ +│ 0 │ 9 months ago │ +│ 1 │ 9 months ago │ +│ 2 │ 9 months ago │ +│ 3 │ 9 months ago │ ╰───┴──────────────╯ ``` diff --git a/commands/docs/polars_as.md b/commands/docs/polars_as.md index 6ac232020e9..0e108004282 100644 --- a/commands/docs/polars_as.md +++ b/commands/docs/polars_as.md @@ -2,7 +2,7 @@ title: polars as categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates an alias expression. usage: | diff --git a/commands/docs/polars_cache.md b/commands/docs/polars_cache.md index f11a14d65a9..1788b024df5 100644 --- a/commands/docs/polars_cache.md +++ b/commands/docs/polars_cache.md @@ -2,7 +2,7 @@ title: polars cache categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Caches operations in a new LazyFrame. usage: | diff --git a/commands/docs/polars_cast.md b/commands/docs/polars_cast.md index ae73aaea394..9481707828e 100644 --- a/commands/docs/polars_cast.md +++ b/commands/docs/polars_cast.md @@ -2,7 +2,7 @@ title: polars cast categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Cast a column to a different dtype. usage: | diff --git a/commands/docs/polars_col.md b/commands/docs/polars_col.md index f34f87bc763..acf55f2ca98 100644 --- a/commands/docs/polars_col.md +++ b/commands/docs/polars_col.md @@ -2,7 +2,7 @@ title: polars col categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates a named column expression. usage: | diff --git a/commands/docs/polars_collect.md b/commands/docs/polars_collect.md index ab4c86d5ca1..121a28260af 100644 --- a/commands/docs/polars_collect.md +++ b/commands/docs/polars_collect.md @@ -2,7 +2,7 @@ title: polars collect categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Collect lazy dataframe into eager dataframe. usage: | diff --git a/commands/docs/polars_columns.md b/commands/docs/polars_columns.md index 62751d5740b..bee91e47850 100644 --- a/commands/docs/polars_columns.md +++ b/commands/docs/polars_columns.md @@ -2,7 +2,7 @@ title: polars columns categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Show dataframe columns. usage: | diff --git a/commands/docs/polars_concat-str.md b/commands/docs/polars_concat-str.md index ca52948b0f7..c43213312f6 100644 --- a/commands/docs/polars_concat-str.md +++ b/commands/docs/polars_concat-str.md @@ -2,7 +2,7 @@ title: polars concat-str categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates a concat string expression. usage: | diff --git a/commands/docs/polars_concat.md b/commands/docs/polars_concat.md index e1409bf347c..dd84ce9f1ea 100644 --- a/commands/docs/polars_concat.md +++ b/commands/docs/polars_concat.md @@ -2,7 +2,7 @@ title: polars concat categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Concatenate two or more dataframes. usage: | diff --git a/commands/docs/polars_contains.md b/commands/docs/polars_contains.md index 976af8e3d8d..32af67860cf 100644 --- a/commands/docs/polars_contains.md +++ b/commands/docs/polars_contains.md @@ -2,7 +2,7 @@ title: polars contains categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Checks if a pattern is contained in a string. usage: | diff --git a/commands/docs/polars_convert-time-zone.md b/commands/docs/polars_convert-time-zone.md index c28cea689e2..c0571d7e556 100644 --- a/commands/docs/polars_convert-time-zone.md +++ b/commands/docs/polars_convert-time-zone.md @@ -2,7 +2,7 @@ title: polars convert-time-zone categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Convert datetime to target timezone. usage: | diff --git a/commands/docs/polars_count-null.md b/commands/docs/polars_count-null.md index 5f8967ca02f..97bc719f456 100644 --- a/commands/docs/polars_count-null.md +++ b/commands/docs/polars_count-null.md @@ -2,7 +2,7 @@ title: polars count-null categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Counts null values. usage: | diff --git a/commands/docs/polars_count.md b/commands/docs/polars_count.md index b97c87e22aa..6fe86d72855 100644 --- a/commands/docs/polars_count.md +++ b/commands/docs/polars_count.md @@ -2,7 +2,7 @@ title: polars count categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Returns the number of non-null values in the column. usage: | diff --git a/commands/docs/polars_cumulative.md b/commands/docs/polars_cumulative.md index 86f2d892572..ff10354f64b 100644 --- a/commands/docs/polars_cumulative.md +++ b/commands/docs/polars_cumulative.md @@ -2,7 +2,7 @@ title: polars cumulative categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Cumulative calculation for a column or series. usage: | diff --git a/commands/docs/polars_cut.md b/commands/docs/polars_cut.md index 0852e6f149d..63852cf0f0b 100644 --- a/commands/docs/polars_cut.md +++ b/commands/docs/polars_cut.md @@ -2,7 +2,7 @@ title: polars cut categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Bin continuous values into discrete categories for a series. usage: | diff --git a/commands/docs/polars_datepart.md b/commands/docs/polars_datepart.md index 2cbc0eb3889..564214baf2b 100644 --- a/commands/docs/polars_datepart.md +++ b/commands/docs/polars_datepart.md @@ -2,7 +2,7 @@ title: polars datepart categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates an expression for capturing the specified datepart in a column. usage: | diff --git a/commands/docs/polars_decimal.md b/commands/docs/polars_decimal.md index ce7f678f931..40bd0c6dcab 100644 --- a/commands/docs/polars_decimal.md +++ b/commands/docs/polars_decimal.md @@ -2,7 +2,7 @@ title: polars decimal categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Converts a string column into a decimal column usage: | diff --git a/commands/docs/polars_drop-duplicates.md b/commands/docs/polars_drop-duplicates.md index d0e60cd6c89..e2f0460efce 100644 --- a/commands/docs/polars_drop-duplicates.md +++ b/commands/docs/polars_drop-duplicates.md @@ -2,7 +2,7 @@ title: polars drop-duplicates categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Drops duplicate values in dataframe. usage: | diff --git a/commands/docs/polars_drop-nulls.md b/commands/docs/polars_drop-nulls.md index 60ee02dcf6e..7a083b60ae4 100644 --- a/commands/docs/polars_drop-nulls.md +++ b/commands/docs/polars_drop-nulls.md @@ -2,7 +2,7 @@ title: polars drop-nulls categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Drops null values in dataframe. usage: | diff --git a/commands/docs/polars_drop.md b/commands/docs/polars_drop.md index 47dea471e21..fa4ff08678e 100644 --- a/commands/docs/polars_drop.md +++ b/commands/docs/polars_drop.md @@ -2,7 +2,7 @@ title: polars drop categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates a new dataframe by dropping the selected columns. usage: | diff --git a/commands/docs/polars_dummies.md b/commands/docs/polars_dummies.md index 1f9239187ff..cbd8d45d567 100644 --- a/commands/docs/polars_dummies.md +++ b/commands/docs/polars_dummies.md @@ -2,7 +2,7 @@ title: polars dummies categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates a new dataframe with dummy variables. usage: | diff --git a/commands/docs/polars_entropy.md b/commands/docs/polars_entropy.md index 33096f29d4f..3c7674784d7 100644 --- a/commands/docs/polars_entropy.md +++ b/commands/docs/polars_entropy.md @@ -2,7 +2,7 @@ title: polars entropy categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the entropy as `-sum(pk * log(pk))` where `pk` are discrete probabilities. usage: | diff --git a/commands/docs/polars_explode.md b/commands/docs/polars_explode.md index 1776656629e..f09e4cb337e 100644 --- a/commands/docs/polars_explode.md +++ b/commands/docs/polars_explode.md @@ -2,7 +2,7 @@ title: polars explode categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Explodes a dataframe or creates a explode expression. usage: | diff --git a/commands/docs/polars_expr-not.md b/commands/docs/polars_expr-not.md index 71201317b59..0f5fca3d1b6 100644 --- a/commands/docs/polars_expr-not.md +++ b/commands/docs/polars_expr-not.md @@ -2,7 +2,7 @@ title: polars expr-not categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates a not expression. usage: | diff --git a/commands/docs/polars_fill-nan.md b/commands/docs/polars_fill-nan.md index 6aaf5caf54c..2bf72dc07cb 100644 --- a/commands/docs/polars_fill-nan.md +++ b/commands/docs/polars_fill-nan.md @@ -2,7 +2,7 @@ title: polars fill-nan categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Replaces NaN values with the given expression. usage: | diff --git a/commands/docs/polars_fill-null.md b/commands/docs/polars_fill-null.md index 78b5c21fd53..b45916ed3ca 100644 --- a/commands/docs/polars_fill-null.md +++ b/commands/docs/polars_fill-null.md @@ -2,7 +2,7 @@ title: polars fill-null categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Replaces NULL values with the given expression. usage: | diff --git a/commands/docs/polars_filter-with.md b/commands/docs/polars_filter-with.md index 461364a7a8a..2985bf3f8f6 100644 --- a/commands/docs/polars_filter-with.md +++ b/commands/docs/polars_filter-with.md @@ -2,7 +2,7 @@ title: polars filter-with categories: | dataframe or lazyframe -version: 0.114.0 +version: 0.115.0 dataframe_or_lazyframe: | Filters dataframe using a mask or expression as reference. usage: | diff --git a/commands/docs/polars_filter.md b/commands/docs/polars_filter.md index 7a0206cb43b..b79a9db9aaa 100644 --- a/commands/docs/polars_filter.md +++ b/commands/docs/polars_filter.md @@ -2,7 +2,7 @@ title: polars filter categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Filter dataframe based in expression. usage: | diff --git a/commands/docs/polars_first.md b/commands/docs/polars_first.md index 0f8e1ea0882..729712c1d88 100644 --- a/commands/docs/polars_first.md +++ b/commands/docs/polars_first.md @@ -2,7 +2,7 @@ title: polars first categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Show only the first number of rows or create a first expression usage: | @@ -33,6 +33,7 @@ contributors: false | polars_selector | polars_expression | | polars_dataframe | polars_dataframe | | polars_lazyframe | polars_lazyframe | +| polars_group_by | polars_lazyframe | ## Examples Return the first row of a dataframe diff --git a/commands/docs/polars_flatten.md b/commands/docs/polars_flatten.md index 3645e84512f..1c226feb204 100644 --- a/commands/docs/polars_flatten.md +++ b/commands/docs/polars_flatten.md @@ -2,7 +2,7 @@ title: polars flatten categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | An alias for polars explode. usage: | diff --git a/commands/docs/polars_get-day.md b/commands/docs/polars_get-day.md index df59d73d1e2..62c2916b1f0 100644 --- a/commands/docs/polars_get-day.md +++ b/commands/docs/polars_get-day.md @@ -2,7 +2,7 @@ title: polars get-day categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Gets day from date. usage: | diff --git a/commands/docs/polars_get-hour.md b/commands/docs/polars_get-hour.md index 1642f4e23e4..29aa2415078 100644 --- a/commands/docs/polars_get-hour.md +++ b/commands/docs/polars_get-hour.md @@ -2,7 +2,7 @@ title: polars get-hour categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Gets hour from datetime. usage: | diff --git a/commands/docs/polars_get-minute.md b/commands/docs/polars_get-minute.md index c3d530080a3..9de8f6e7dda 100644 --- a/commands/docs/polars_get-minute.md +++ b/commands/docs/polars_get-minute.md @@ -2,7 +2,7 @@ title: polars get-minute categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Gets minute from date. usage: | diff --git a/commands/docs/polars_get-month.md b/commands/docs/polars_get-month.md index f14abcfbc2b..e66cc144f28 100644 --- a/commands/docs/polars_get-month.md +++ b/commands/docs/polars_get-month.md @@ -2,7 +2,7 @@ title: polars get-month categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Gets month from date. usage: | diff --git a/commands/docs/polars_get-nanosecond.md b/commands/docs/polars_get-nanosecond.md index 8a39bb5f7a8..3c7504665d1 100644 --- a/commands/docs/polars_get-nanosecond.md +++ b/commands/docs/polars_get-nanosecond.md @@ -2,7 +2,7 @@ title: polars get-nanosecond categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Gets nanosecond from date. usage: | diff --git a/commands/docs/polars_get-ordinal.md b/commands/docs/polars_get-ordinal.md index 31f1e0941fb..80190a5767b 100644 --- a/commands/docs/polars_get-ordinal.md +++ b/commands/docs/polars_get-ordinal.md @@ -2,7 +2,7 @@ title: polars get-ordinal categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Gets ordinal from date. usage: | diff --git a/commands/docs/polars_get-second.md b/commands/docs/polars_get-second.md index 6436739d85c..16dd815e458 100644 --- a/commands/docs/polars_get-second.md +++ b/commands/docs/polars_get-second.md @@ -2,7 +2,7 @@ title: polars get-second categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Gets second from date. usage: | diff --git a/commands/docs/polars_get-week.md b/commands/docs/polars_get-week.md index 5fe4a1f4a1c..ab34e45f0ab 100644 --- a/commands/docs/polars_get-week.md +++ b/commands/docs/polars_get-week.md @@ -2,7 +2,7 @@ title: polars get-week categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Gets week from date. usage: | diff --git a/commands/docs/polars_get-weekday.md b/commands/docs/polars_get-weekday.md index e98e5a114b9..3ab03108dab 100644 --- a/commands/docs/polars_get-weekday.md +++ b/commands/docs/polars_get-weekday.md @@ -2,7 +2,7 @@ title: polars get-weekday categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Gets weekday from date. usage: | diff --git a/commands/docs/polars_get-year.md b/commands/docs/polars_get-year.md index 6209885dd90..f7047dc63cb 100644 --- a/commands/docs/polars_get-year.md +++ b/commands/docs/polars_get-year.md @@ -2,7 +2,7 @@ title: polars get-year categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Gets year from date. usage: | diff --git a/commands/docs/polars_get.md b/commands/docs/polars_get.md index 00c17fc8a77..0d8a99a8169 100644 --- a/commands/docs/polars_get.md +++ b/commands/docs/polars_get.md @@ -2,7 +2,7 @@ title: polars get categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates dataframe with the selected columns. usage: | diff --git a/commands/docs/polars_group-by.md b/commands/docs/polars_group-by.md index 567c525c83f..6e9e8a2b9b5 100644 --- a/commands/docs/polars_group-by.md +++ b/commands/docs/polars_group-by.md @@ -2,7 +2,7 @@ title: polars group-by categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Creates a group-by object that can be used for other aggregations. usage: | @@ -31,10 +31,10 @@ contributors: false ## Input/output types: -| input | output | -| ---------------- | ---------------- | -| polars_dataframe | polars_dataframe | -| polars_lazyframe | polars_lazyframe | +| input | output | +| ---------------- | --------------- | +| polars_dataframe | polars_group_by | +| polars_lazyframe | polars_group_by | ## Examples Group by and perform an aggregation diff --git a/commands/docs/polars_horizontal.md b/commands/docs/polars_horizontal.md index 2fee100a2d7..cebcb4507c1 100644 --- a/commands/docs/polars_horizontal.md +++ b/commands/docs/polars_horizontal.md @@ -2,7 +2,7 @@ title: polars horizontal categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Horizontal calculation across multiple columns. usage: | diff --git a/commands/docs/polars_implode.md b/commands/docs/polars_implode.md index c38f1aa0f65..3be23edb2f5 100644 --- a/commands/docs/polars_implode.md +++ b/commands/docs/polars_implode.md @@ -2,7 +2,7 @@ title: polars implode categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Aggregates values into a list. usage: | diff --git a/commands/docs/polars_integer.md b/commands/docs/polars_integer.md index 36ca461b519..7d22d9ca861 100644 --- a/commands/docs/polars_integer.md +++ b/commands/docs/polars_integer.md @@ -2,7 +2,7 @@ title: polars integer categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Converts a string column into a integer column usage: | diff --git a/commands/docs/polars_into-df.md b/commands/docs/polars_into-df.md index c6f282f1d40..8ac1454dc13 100644 --- a/commands/docs/polars_into-df.md +++ b/commands/docs/polars_into-df.md @@ -2,7 +2,7 @@ title: polars into-df categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Converts a list, table or record into a dataframe. usage: | diff --git a/commands/docs/polars_into-dtype.md b/commands/docs/polars_into-dtype.md index 4fd715e5e96..dd437ad1a28 100644 --- a/commands/docs/polars_into-dtype.md +++ b/commands/docs/polars_into-dtype.md @@ -2,7 +2,7 @@ title: polars into-dtype categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Convert a string to a specific datatype. usage: | diff --git a/commands/docs/polars_into-lazy.md b/commands/docs/polars_into-lazy.md index 115e90091df..f2b9b857624 100644 --- a/commands/docs/polars_into-lazy.md +++ b/commands/docs/polars_into-lazy.md @@ -2,7 +2,7 @@ title: polars into-lazy categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Converts a dataframe into a lazy dataframe. usage: | diff --git a/commands/docs/polars_into-nu.md b/commands/docs/polars_into-nu.md index 4d658c3cbf3..220df522a54 100644 --- a/commands/docs/polars_into-nu.md +++ b/commands/docs/polars_into-nu.md @@ -2,7 +2,7 @@ title: polars into-nu categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Converts a dataframe or an expression into nushell value for access and exploration. usage: | diff --git a/commands/docs/polars_into-repr.md b/commands/docs/polars_into-repr.md index 704c16200a9..025ebc3ac99 100644 --- a/commands/docs/polars_into-repr.md +++ b/commands/docs/polars_into-repr.md @@ -2,7 +2,7 @@ title: polars into-repr categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Display a dataframe in its repr format. usage: | diff --git a/commands/docs/polars_into-schema.md b/commands/docs/polars_into-schema.md index 312e5e8e239..46633aae885 100644 --- a/commands/docs/polars_into-schema.md +++ b/commands/docs/polars_into-schema.md @@ -2,7 +2,7 @@ title: polars into-schema categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Convert a value to a polars schema object usage: | diff --git a/commands/docs/polars_is-duplicated.md b/commands/docs/polars_is-duplicated.md index 393a4cec41b..2f564cde90f 100644 --- a/commands/docs/polars_is-duplicated.md +++ b/commands/docs/polars_is-duplicated.md @@ -2,7 +2,7 @@ title: polars is-duplicated categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates mask indicating duplicated values. usage: | diff --git a/commands/docs/polars_is-in.md b/commands/docs/polars_is-in.md index 0b864a32de8..e0d7e047a3f 100644 --- a/commands/docs/polars_is-in.md +++ b/commands/docs/polars_is-in.md @@ -2,7 +2,7 @@ title: polars is-in categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates an is-in expression or checks to see if the elements are contained in the right series usage: | diff --git a/commands/docs/polars_is-not-null.md b/commands/docs/polars_is-not-null.md index 44923b02df5..15133540904 100644 --- a/commands/docs/polars_is-not-null.md +++ b/commands/docs/polars_is-not-null.md @@ -2,7 +2,7 @@ title: polars is-not-null categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates mask where value is not null. usage: | diff --git a/commands/docs/polars_is-null.md b/commands/docs/polars_is-null.md index 2cb1bda7449..c1ca9524ca3 100644 --- a/commands/docs/polars_is-null.md +++ b/commands/docs/polars_is-null.md @@ -2,7 +2,7 @@ title: polars is-null categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates mask where value is null. usage: | diff --git a/commands/docs/polars_is-unique.md b/commands/docs/polars_is-unique.md index 86c8f011271..ce3539fbc2e 100644 --- a/commands/docs/polars_is-unique.md +++ b/commands/docs/polars_is-unique.md @@ -2,7 +2,7 @@ title: polars is-unique categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates mask indicating unique values. usage: | diff --git a/commands/docs/polars_join-where.md b/commands/docs/polars_join-where.md index afbe63eb2ef..cb8cc9b5e39 100644 --- a/commands/docs/polars_join-where.md +++ b/commands/docs/polars_join-where.md @@ -2,7 +2,7 @@ title: polars join-where categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Joins a lazy frame with other lazy frame based on conditions. usage: | diff --git a/commands/docs/polars_join.md b/commands/docs/polars_join.md index 20921e8e253..b0992d64557 100644 --- a/commands/docs/polars_join.md +++ b/commands/docs/polars_join.md @@ -2,7 +2,7 @@ title: polars join categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Joins a lazy frame with other lazy frame. usage: | diff --git a/commands/docs/polars_last.md b/commands/docs/polars_last.md index 93c6bb5c8f9..5b850bbb27f 100644 --- a/commands/docs/polars_last.md +++ b/commands/docs/polars_last.md @@ -2,7 +2,7 @@ title: polars last categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates new dataframe with tail rows or creates a last expression. usage: | @@ -33,6 +33,7 @@ contributors: false | polars_selector | polars_expression | | polars_dataframe | polars_dataframe | | polars_lazyframe | polars_lazyframe | +| polars_group_by | polars_lazyframe | ## Examples Create new dataframe with last rows diff --git a/commands/docs/polars_len.md b/commands/docs/polars_len.md index 20bc57e79ac..6f05569e5e5 100644 --- a/commands/docs/polars_len.md +++ b/commands/docs/polars_len.md @@ -2,7 +2,7 @@ title: polars len categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Return the number of rows in the context. This is similar to COUNT(*) in SQL. usage: | diff --git a/commands/docs/polars_list-contains.md b/commands/docs/polars_list-contains.md index b4b45d50c74..85cb75473b5 100644 --- a/commands/docs/polars_list-contains.md +++ b/commands/docs/polars_list-contains.md @@ -2,7 +2,7 @@ title: polars list-contains categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Checks if an element is contained in a list. usage: | diff --git a/commands/docs/polars_lit.md b/commands/docs/polars_lit.md index 52171167ae4..75fb422692f 100644 --- a/commands/docs/polars_lit.md +++ b/commands/docs/polars_lit.md @@ -2,7 +2,7 @@ title: polars lit categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates a literal expression. usage: | diff --git a/commands/docs/polars_lowercase.md b/commands/docs/polars_lowercase.md index 5e21f1d6f44..53bfc7b3276 100644 --- a/commands/docs/polars_lowercase.md +++ b/commands/docs/polars_lowercase.md @@ -2,7 +2,7 @@ title: polars lowercase categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Lowercase the strings in the column. usage: | diff --git a/commands/docs/polars_map-batches.md b/commands/docs/polars_map-batches.md index 19fbf554d1c..3a47f6d1dc9 100644 --- a/commands/docs/polars_map-batches.md +++ b/commands/docs/polars_map-batches.md @@ -2,7 +2,7 @@ title: polars map-batches categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Map a custom Nushell closure over one or more dataframe columns. usage: | diff --git a/commands/docs/polars_math.md b/commands/docs/polars_math.md index 129276e4e85..78a988b1f11 100644 --- a/commands/docs/polars_math.md +++ b/commands/docs/polars_math.md @@ -2,7 +2,7 @@ title: polars math categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Collection of math functions to be applied on column expressions. usage: | diff --git a/commands/docs/polars_math_abs.md b/commands/docs/polars_math_abs.md index 4dda8190320..31e275929af 100644 --- a/commands/docs/polars_math_abs.md +++ b/commands/docs/polars_math_abs.md @@ -2,7 +2,7 @@ title: polars math abs categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the absolute values of a column expression. usage: | diff --git a/commands/docs/polars_math_bitwise-and.md b/commands/docs/polars_math_bitwise-and.md index 4b6c578496f..efac9ae032e 100644 --- a/commands/docs/polars_math_bitwise-and.md +++ b/commands/docs/polars_math_bitwise-and.md @@ -2,7 +2,7 @@ title: polars math bitwise-and categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Perform an aggregation of bitwise ANDs over a column expression. usage: | diff --git a/commands/docs/polars_math_bitwise-count-ones.md b/commands/docs/polars_math_bitwise-count-ones.md index ff15a2ebae8..ed9b01c75cb 100644 --- a/commands/docs/polars_math_bitwise-count-ones.md +++ b/commands/docs/polars_math_bitwise-count-ones.md @@ -2,7 +2,7 @@ title: polars math bitwise-count-ones categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the number of set bits for each element in an integer column expression. usage: | diff --git a/commands/docs/polars_math_bitwise-count-zeros.md b/commands/docs/polars_math_bitwise-count-zeros.md index c3c6813a201..c91dbec03c2 100644 --- a/commands/docs/polars_math_bitwise-count-zeros.md +++ b/commands/docs/polars_math_bitwise-count-zeros.md @@ -2,7 +2,7 @@ title: polars math bitwise-count-zeros categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the number of unset bits for each element in an integer column expression. usage: | diff --git a/commands/docs/polars_math_bitwise-leading-ones.md b/commands/docs/polars_math_bitwise-leading-ones.md index dfccfe03bd2..95d77860886 100644 --- a/commands/docs/polars_math_bitwise-leading-ones.md +++ b/commands/docs/polars_math_bitwise-leading-ones.md @@ -2,7 +2,7 @@ title: polars math bitwise-leading-ones categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the number of leading set bits for each element in an integer column expression. usage: | diff --git a/commands/docs/polars_math_bitwise-leading-zeros.md b/commands/docs/polars_math_bitwise-leading-zeros.md index 49951673e50..1cf30538e71 100644 --- a/commands/docs/polars_math_bitwise-leading-zeros.md +++ b/commands/docs/polars_math_bitwise-leading-zeros.md @@ -2,7 +2,7 @@ title: polars math bitwise-leading-zeros categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the number of leading unset bits for each element in an integer column expression. usage: | diff --git a/commands/docs/polars_math_bitwise-or.md b/commands/docs/polars_math_bitwise-or.md index 087bc780213..9a13158c6c0 100644 --- a/commands/docs/polars_math_bitwise-or.md +++ b/commands/docs/polars_math_bitwise-or.md @@ -2,7 +2,7 @@ title: polars math bitwise-or categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Perform an aggregation of bitwise ORs over a column expression. usage: | diff --git a/commands/docs/polars_math_bitwise-trailing-ones.md b/commands/docs/polars_math_bitwise-trailing-ones.md index 6c81558f4a9..b9a02edd6d3 100644 --- a/commands/docs/polars_math_bitwise-trailing-ones.md +++ b/commands/docs/polars_math_bitwise-trailing-ones.md @@ -2,7 +2,7 @@ title: polars math bitwise-trailing-ones categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the number of trailing set bits for each element in an integer column expression. usage: | diff --git a/commands/docs/polars_math_bitwise-trailing-zeros.md b/commands/docs/polars_math_bitwise-trailing-zeros.md index 9f839f14541..8d6340cf4ad 100644 --- a/commands/docs/polars_math_bitwise-trailing-zeros.md +++ b/commands/docs/polars_math_bitwise-trailing-zeros.md @@ -2,7 +2,7 @@ title: polars math bitwise-trailing-zeros categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the number of trailing unset bits for each element in an integer column expression. usage: | diff --git a/commands/docs/polars_math_bitwise-xor.md b/commands/docs/polars_math_bitwise-xor.md index d4de52340f8..fe01b69a71a 100644 --- a/commands/docs/polars_math_bitwise-xor.md +++ b/commands/docs/polars_math_bitwise-xor.md @@ -2,7 +2,7 @@ title: polars math bitwise-xor categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Perform an aggregation of bitwise XORs over a column expression. usage: | diff --git a/commands/docs/polars_math_cos.md b/commands/docs/polars_math_cos.md index 73a7049861f..78a37d0c6d0 100644 --- a/commands/docs/polars_math_cos.md +++ b/commands/docs/polars_math_cos.md @@ -2,7 +2,7 @@ title: polars math cos categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the element-wise cosine of a column expression. usage: | diff --git a/commands/docs/polars_math_dot.md b/commands/docs/polars_math_dot.md index 9f150227cfd..c1d1a6228c6 100644 --- a/commands/docs/polars_math_dot.md +++ b/commands/docs/polars_math_dot.md @@ -2,7 +2,7 @@ title: polars math dot categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the dot product of two column expressions. usage: | diff --git a/commands/docs/polars_math_exp.md b/commands/docs/polars_math_exp.md index 72cc70cf47e..f019a1b47a5 100644 --- a/commands/docs/polars_math_exp.md +++ b/commands/docs/polars_math_exp.md @@ -2,7 +2,7 @@ title: polars math exp categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute element-wise e raised to the power of a column expression. usage: | diff --git a/commands/docs/polars_math_log.md b/commands/docs/polars_math_log.md index 655e0214bd6..50af9895d98 100644 --- a/commands/docs/polars_math_log.md +++ b/commands/docs/polars_math_log.md @@ -2,7 +2,7 @@ title: polars math log categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the element-wise logarithm of a column expression. usage: | diff --git a/commands/docs/polars_math_log1p.md b/commands/docs/polars_math_log1p.md index caaa1635474..c3b05f07e20 100644 --- a/commands/docs/polars_math_log1p.md +++ b/commands/docs/polars_math_log1p.md @@ -2,7 +2,7 @@ title: polars math log1p categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the element-wise natural log of 1 + x for a column expression. usage: | diff --git a/commands/docs/polars_math_sign.md b/commands/docs/polars_math_sign.md index 976db8d9e78..1d1d2479887 100644 --- a/commands/docs/polars_math_sign.md +++ b/commands/docs/polars_math_sign.md @@ -2,7 +2,7 @@ title: polars math sign categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the element-wise sign of a column expression, returning -1, 0, or 1. usage: | diff --git a/commands/docs/polars_math_sin.md b/commands/docs/polars_math_sin.md index 1421d8be442..7717d0d9686 100644 --- a/commands/docs/polars_math_sin.md +++ b/commands/docs/polars_math_sin.md @@ -2,7 +2,7 @@ title: polars math sin categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the element-wise sine of a column expression. usage: | diff --git a/commands/docs/polars_math_sqrt.md b/commands/docs/polars_math_sqrt.md index 41362d46d42..65462273393 100644 --- a/commands/docs/polars_math_sqrt.md +++ b/commands/docs/polars_math_sqrt.md @@ -2,7 +2,7 @@ title: polars math sqrt categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Compute the element-wise square root of a column expression. usage: | diff --git a/commands/docs/polars_max.md b/commands/docs/polars_max.md index f1ec1b5e610..97e6b4f0b2a 100644 --- a/commands/docs/polars_max.md +++ b/commands/docs/polars_max.md @@ -2,7 +2,7 @@ title: polars max categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates a max expression or aggregates columns to their max value. usage: | diff --git a/commands/docs/polars_mean.md b/commands/docs/polars_mean.md index d3e2596675b..3f2b087d1e2 100644 --- a/commands/docs/polars_mean.md +++ b/commands/docs/polars_mean.md @@ -2,7 +2,7 @@ title: polars mean categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates a mean expression for an aggregation or aggregates columns to their mean value. usage: | diff --git a/commands/docs/polars_median.md b/commands/docs/polars_median.md index a506245b97a..47aedf438fe 100644 --- a/commands/docs/polars_median.md +++ b/commands/docs/polars_median.md @@ -2,7 +2,7 @@ title: polars median categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Median value from columns in a dataframe or creates expression for an aggregation usage: | diff --git a/commands/docs/polars_min.md b/commands/docs/polars_min.md index 9d65cc3b15f..b9762d5c39c 100644 --- a/commands/docs/polars_min.md +++ b/commands/docs/polars_min.md @@ -2,7 +2,7 @@ title: polars min categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates a min expression or aggregates columns to their min value. usage: | diff --git a/commands/docs/polars_n-unique.md b/commands/docs/polars_n-unique.md index fd691f521c5..dbc55045555 100644 --- a/commands/docs/polars_n-unique.md +++ b/commands/docs/polars_n-unique.md @@ -2,7 +2,7 @@ title: polars n-unique categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Counts unique values. usage: | diff --git a/commands/docs/polars_not.md b/commands/docs/polars_not.md index f2896e2278d..c29f37307a8 100644 --- a/commands/docs/polars_not.md +++ b/commands/docs/polars_not.md @@ -2,7 +2,7 @@ title: polars not categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Inverts boolean mask. usage: | diff --git a/commands/docs/polars_open.md b/commands/docs/polars_open.md index cf8700b36d0..2d9f2808079 100644 --- a/commands/docs/polars_open.md +++ b/commands/docs/polars_open.md @@ -2,7 +2,7 @@ title: polars open categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Opens CSV, JSON, NDJSON/JSON lines, arrow, avro, or parquet file to create dataframe. A lazy dataframe will be created by default, if supported. usage: | diff --git a/commands/docs/polars_otherwise.md b/commands/docs/polars_otherwise.md index e59cfa187a7..b29e2f73f4a 100644 --- a/commands/docs/polars_otherwise.md +++ b/commands/docs/polars_otherwise.md @@ -2,7 +2,7 @@ title: polars otherwise categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Completes a when expression. usage: | diff --git a/commands/docs/polars_over.md b/commands/docs/polars_over.md index 4b808c61a44..2c692bf5232 100644 --- a/commands/docs/polars_over.md +++ b/commands/docs/polars_over.md @@ -2,7 +2,7 @@ title: polars over categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Compute expressions over a window group defined by partition expressions. usage: | diff --git a/commands/docs/polars_pivot.md b/commands/docs/polars_pivot.md index f55939ad93d..9acb4f01bb0 100644 --- a/commands/docs/polars_pivot.md +++ b/commands/docs/polars_pivot.md @@ -2,7 +2,7 @@ title: polars pivot categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Pivot a DataFrame from long to wide format. usage: | diff --git a/commands/docs/polars_profile.md b/commands/docs/polars_profile.md index 9beeb9a59b8..c51a71f9a09 100644 --- a/commands/docs/polars_profile.md +++ b/commands/docs/polars_profile.md @@ -2,7 +2,7 @@ title: polars profile categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Profile a lazy dataframe. usage: | diff --git a/commands/docs/polars_qcut.md b/commands/docs/polars_qcut.md index 563b7240a54..bdb71d50a69 100644 --- a/commands/docs/polars_qcut.md +++ b/commands/docs/polars_qcut.md @@ -2,7 +2,7 @@ title: polars qcut categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Bin continuous values into discrete categories based on their quantiles for a series. usage: | diff --git a/commands/docs/polars_quantile.md b/commands/docs/polars_quantile.md index 9df3ece0350..db48201ded6 100644 --- a/commands/docs/polars_quantile.md +++ b/commands/docs/polars_quantile.md @@ -2,7 +2,7 @@ title: polars quantile categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Aggregates the columns to the selected quantile. usage: | diff --git a/commands/docs/polars_query.md b/commands/docs/polars_query.md index a5e74e2c196..63fc4fd16f2 100644 --- a/commands/docs/polars_query.md +++ b/commands/docs/polars_query.md @@ -2,7 +2,7 @@ title: polars query categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. usage: | diff --git a/commands/docs/polars_rename.md b/commands/docs/polars_rename.md index 9506e0d998b..d51cde12443 100644 --- a/commands/docs/polars_rename.md +++ b/commands/docs/polars_rename.md @@ -2,7 +2,7 @@ title: polars rename categories: | dataframe or lazyframe -version: 0.114.0 +version: 0.115.0 dataframe_or_lazyframe: | Rename a dataframe column. usage: | diff --git a/commands/docs/polars_replace-time-zone.md b/commands/docs/polars_replace-time-zone.md index 40e6578f26a..e23b6106b4f 100644 --- a/commands/docs/polars_replace-time-zone.md +++ b/commands/docs/polars_replace-time-zone.md @@ -2,7 +2,7 @@ title: polars replace-time-zone categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Replace the timezone information in a datetime column. usage: | @@ -65,10 +65,10 @@ Apply timezone with ambiguous datetime ╭───┬──────────────╮ │ # │ datetime │ ├───┼──────────────┤ -│ 0 │ 8 months ago │ +│ 0 │ 9 months ago │ │ 1 │ │ -│ 2 │ 8 months ago │ -│ 3 │ 8 months ago │ +│ 2 │ 9 months ago │ +│ 3 │ 9 months ago │ ╰───┴──────────────╯ ``` diff --git a/commands/docs/polars_replace.md b/commands/docs/polars_replace.md index 6749133ac11..0fd0fcf1e9d 100644 --- a/commands/docs/polars_replace.md +++ b/commands/docs/polars_replace.md @@ -2,7 +2,7 @@ title: polars replace categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Create an expression that replaces old values with new values usage: | diff --git a/commands/docs/polars_reverse.md b/commands/docs/polars_reverse.md index 261b526ee70..2fbf14072d1 100644 --- a/commands/docs/polars_reverse.md +++ b/commands/docs/polars_reverse.md @@ -2,7 +2,7 @@ title: polars reverse categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Reverses the LazyFrame usage: | diff --git a/commands/docs/polars_rolling.md b/commands/docs/polars_rolling.md index ce5b7d5e7a5..d2a959e4abf 100644 --- a/commands/docs/polars_rolling.md +++ b/commands/docs/polars_rolling.md @@ -2,11 +2,11 @@ title: polars rolling categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | - Rolling calculation for a series. + Rolling calculation for a series or expression, or a rolling group-by for a lazyframe. usage: | - Rolling calculation for a series. + Rolling calculation for a series or expression, or a rolling group-by for a lazyframe. editLink: false contributors: false --- @@ -14,24 +14,33 @@ contributors: false # `polars rolling` for [dataframe](/commands/categories/dataframe.md) -
Rolling calculation for a series.
+
Rolling calculation for a series or expression, or a rolling group-by for a lazyframe.
## Signature ```> polars rolling {flags} (type) (window)``` +## Flags + + - `--index-column, -i {string}`: Time or index column to roll over. Required for lazyframe input. + - `--period, -p {oneof}`: Rolling window width (e.g. 7day, "7d", 1wk, "1mo", "2i", ). Required for lazyframe input. + - `--offset, -o {oneof}`: Offset of the rolling window relative to the index column (default: 1ns). + - `--closed, -c {string}`: Which boundary of the window is closed: left, right, both, none (default: left). + - `--group-by, -g {list}`: Additional expressions to group by within each rolling window. + ## Parameters - - `type`: Rolling operation. - - `window`: Window size for rolling. + - `type`: Rolling operation (min, max, sum, mean). Required for dataframe and expression inputs. + - `window`: Window size for rolling. Required for dataframe and expression inputs. ## Input/output types: -| input | output | -| ---------------- | ---------------- | -| polars_dataframe | polars_dataframe | -| polars_lazyframe | polars_lazyframe | +| input | output | +| ----------------- | ----------------- | +| polars_dataframe | polars_dataframe | +| polars_expression | polars_expression | +| polars_lazyframe | polars_group_by | ## Examples Rolling sum for a series @@ -61,3 +70,43 @@ Rolling max for a series ╰───┴───────────────╯ ``` + +Rolling sum for an expression in a lazyframe +```nu +> [[a]; [1] [2] [3] [4] [5]] + | polars into-df + | polars select (polars col a | polars rolling sum 2 | polars as roll_a) + | polars collect + | polars drop-nulls + | polars collect +╭───┬────────╮ +│ # │ roll_a │ +├───┼────────┤ +│ 0 │ 3 │ +│ 1 │ 5 │ +│ 2 │ 7 │ +│ 3 │ 9 │ +╰───┴────────╯ + +``` + +Rolling sum over a 2-row integer window on a lazyframe +```nu +> [[idx val]; [1 10] [2 20] [3 30] [4 40] [5 50]] + | polars into-lazy + | polars rolling --index-column idx --period 2i + | polars agg [(polars col val | polars sum | polars as val_sum)] + | polars collect + | polars sort-by idx + | polars collect +╭───┬─────┬─────────╮ +│ # │ idx │ val_sum │ +├───┼─────┼─────────┤ +│ 0 │ 1 │ 50 │ +│ 1 │ 2 │ 70 │ +│ 2 │ 3 │ 90 │ +│ 3 │ 4 │ 50 │ +│ 4 │ 5 │ 0 │ +╰───┴─────┴─────────╯ + +``` diff --git a/commands/docs/polars_sample.md b/commands/docs/polars_sample.md index ee5eae21f0f..df0da2f7f58 100644 --- a/commands/docs/polars_sample.md +++ b/commands/docs/polars_sample.md @@ -2,7 +2,7 @@ title: polars sample categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Create sample dataframe. usage: | diff --git a/commands/docs/polars_save.md b/commands/docs/polars_save.md index 28f5250771e..7b0deb32c8d 100644 --- a/commands/docs/polars_save.md +++ b/commands/docs/polars_save.md @@ -2,7 +2,7 @@ title: polars save categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Saves a dataframe to disk. For lazy dataframes a sink operation will be used if the file type supports it (parquet, ipc/arrow, csv, and ndjson). usage: | diff --git a/commands/docs/polars_schema.md b/commands/docs/polars_schema.md index 230af031259..ffe371e42ce 100644 --- a/commands/docs/polars_schema.md +++ b/commands/docs/polars_schema.md @@ -2,7 +2,7 @@ title: polars schema categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Show schema for a dataframe. usage: | diff --git a/commands/docs/polars_select.md b/commands/docs/polars_select.md index 4c769b1cc04..4fcf0eb5abd 100644 --- a/commands/docs/polars_select.md +++ b/commands/docs/polars_select.md @@ -2,7 +2,7 @@ title: polars select categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Selects columns from lazyframe. usage: | diff --git a/commands/docs/polars_selector.md b/commands/docs/polars_selector.md index 3040ffe5f4b..1eeeb99a972 100644 --- a/commands/docs/polars_selector.md +++ b/commands/docs/polars_selector.md @@ -2,7 +2,7 @@ title: polars selector categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Create column selectors for use in polars commands. usage: | diff --git a/commands/docs/polars_selector_all.md b/commands/docs/polars_selector_all.md index e54057e714d..af12bc4b943 100644 --- a/commands/docs/polars_selector_all.md +++ b/commands/docs/polars_selector_all.md @@ -2,7 +2,7 @@ title: polars selector all categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates a selector that selects all columns. usage: | diff --git a/commands/docs/polars_selector_alpha.md b/commands/docs/polars_selector_alpha.md index b0449d0a28c..efbabacad31 100644 --- a/commands/docs/polars_selector_alpha.md +++ b/commands/docs/polars_selector_alpha.md @@ -2,7 +2,7 @@ title: polars selector alpha categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all columns with alphabetic names (eg: only letters). Matching column names cannot contain *any* non-alphabetic characters. Note that the definition of "alphabetic" consists of all valid Unicode alphabetic characters by default; this can be changed by setting `--ascii-only`. usage: | diff --git a/commands/docs/polars_selector_alphanumeric.md b/commands/docs/polars_selector_alphanumeric.md index b842c9a925f..0d90efed909 100644 --- a/commands/docs/polars_selector_alphanumeric.md +++ b/commands/docs/polars_selector_alphanumeric.md @@ -2,7 +2,7 @@ title: polars selector alphanumeric categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all columns with alphanumeric names (eg: only letters). Matching column names cannot contain *any* non-alphanumeric characters. Note that the definition of "alphanumeric" consists of all valid Unicode alphanumeric characters by default; this can be changed by setting `ascii_only=true`. usage: | diff --git a/commands/docs/polars_selector_array.md b/commands/docs/polars_selector_array.md index 6df2390efb5..af037a160da 100644 --- a/commands/docs/polars_selector_array.md +++ b/commands/docs/polars_selector_array.md @@ -2,7 +2,7 @@ title: polars selector array categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all array columns. Optionally filter by fixed width. usage: | diff --git a/commands/docs/polars_selector_binary.md b/commands/docs/polars_selector_binary.md index 8f29bd8257f..d54259228ac 100644 --- a/commands/docs/polars_selector_binary.md +++ b/commands/docs/polars_selector_binary.md @@ -2,7 +2,7 @@ title: polars selector binary categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all binary columns. usage: | diff --git a/commands/docs/polars_selector_boolean.md b/commands/docs/polars_selector_boolean.md index 407b6324b4d..f73479e4f9a 100644 --- a/commands/docs/polars_selector_boolean.md +++ b/commands/docs/polars_selector_boolean.md @@ -2,7 +2,7 @@ title: polars selector boolean categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all boolean columns. usage: | diff --git a/commands/docs/polars_selector_by-dtype.md b/commands/docs/polars_selector_by-dtype.md index d276033119c..d94550fd372 100644 --- a/commands/docs/polars_selector_by-dtype.md +++ b/commands/docs/polars_selector_by-dtype.md @@ -2,7 +2,7 @@ title: polars selector by-dtype categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates a selector that selects columns by data type. usage: | diff --git a/commands/docs/polars_selector_by-index.md b/commands/docs/polars_selector_by-index.md index 88f3ab0045e..4ca8a86aacc 100644 --- a/commands/docs/polars_selector_by-index.md +++ b/commands/docs/polars_selector_by-index.md @@ -2,7 +2,7 @@ title: polars selector by-index categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select columns by their index position. Supports negative indices (e.g., -1 for the last column). usage: | diff --git a/commands/docs/polars_selector_by-name.md b/commands/docs/polars_selector_by-name.md index 41d944006cf..d7f01e048a3 100644 --- a/commands/docs/polars_selector_by-name.md +++ b/commands/docs/polars_selector_by-name.md @@ -2,7 +2,7 @@ title: polars selector by-name categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates a selector that selects columns by name. usage: | diff --git a/commands/docs/polars_selector_categorical.md b/commands/docs/polars_selector_categorical.md index 53bc8590391..88971d63f97 100644 --- a/commands/docs/polars_selector_categorical.md +++ b/commands/docs/polars_selector_categorical.md @@ -2,7 +2,7 @@ title: polars selector categorical categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all categorical columns. usage: | diff --git a/commands/docs/polars_selector_contains.md b/commands/docs/polars_selector_contains.md index 563d8a66f7b..2a56a1c6d52 100644 --- a/commands/docs/polars_selector_contains.md +++ b/commands/docs/polars_selector_contains.md @@ -2,7 +2,7 @@ title: polars selector contains categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select columns whose names contain the given literal substring(s). usage: | diff --git a/commands/docs/polars_selector_date.md b/commands/docs/polars_selector_date.md index c6f2cb51732..a31f59ad18e 100644 --- a/commands/docs/polars_selector_date.md +++ b/commands/docs/polars_selector_date.md @@ -2,7 +2,7 @@ title: polars selector date categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all date columns. usage: | diff --git a/commands/docs/polars_selector_datetime.md b/commands/docs/polars_selector_datetime.md index 15fa8178c22..44433d72b8c 100644 --- a/commands/docs/polars_selector_datetime.md +++ b/commands/docs/polars_selector_datetime.md @@ -2,7 +2,7 @@ title: polars selector datetime categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all datetime columns. Optionally filter by time unit (ns, us, ms) and/or timezone. usage: | diff --git a/commands/docs/polars_selector_decimal.md b/commands/docs/polars_selector_decimal.md index f4f95316d85..a551062acfd 100644 --- a/commands/docs/polars_selector_decimal.md +++ b/commands/docs/polars_selector_decimal.md @@ -2,7 +2,7 @@ title: polars selector decimal categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all decimal columns. usage: | diff --git a/commands/docs/polars_selector_digit.md b/commands/docs/polars_selector_digit.md index 95c27956ea3..66a7f3708b6 100644 --- a/commands/docs/polars_selector_digit.md +++ b/commands/docs/polars_selector_digit.md @@ -2,7 +2,7 @@ title: polars selector digit categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select columns whose names consist entirely of digit characters. By default uses Unicode decimal digits; use `--ascii-only` to restrict to ASCII 0-9. usage: | diff --git a/commands/docs/polars_selector_duration.md b/commands/docs/polars_selector_duration.md index 4e721b367b2..ff82ce9f6de 100644 --- a/commands/docs/polars_selector_duration.md +++ b/commands/docs/polars_selector_duration.md @@ -2,7 +2,7 @@ title: polars selector duration categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all duration columns. Optionally filter by time unit (ns, us, ms). usage: | diff --git a/commands/docs/polars_selector_empty.md b/commands/docs/polars_selector_empty.md index 6ab4b0df287..b5b34adcb06 100644 --- a/commands/docs/polars_selector_empty.md +++ b/commands/docs/polars_selector_empty.md @@ -2,7 +2,7 @@ title: polars selector empty categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Create an empty selector that matches no columns. Useful as a base for selector composition. usage: | diff --git a/commands/docs/polars_selector_ends-with.md b/commands/docs/polars_selector_ends-with.md index 06e3c9f54f2..e7ddfcab376 100644 --- a/commands/docs/polars_selector_ends-with.md +++ b/commands/docs/polars_selector_ends-with.md @@ -2,7 +2,7 @@ title: polars selector ends-with categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select columns that end with the given substring(s). usage: | diff --git a/commands/docs/polars_selector_enum.md b/commands/docs/polars_selector_enum.md index ecd21327510..5e816250b2e 100644 --- a/commands/docs/polars_selector_enum.md +++ b/commands/docs/polars_selector_enum.md @@ -2,7 +2,7 @@ title: polars selector enum categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all enum columns. usage: | diff --git a/commands/docs/polars_selector_exclude.md b/commands/docs/polars_selector_exclude.md index 398c1295a1f..6afd10e7d7c 100644 --- a/commands/docs/polars_selector_exclude.md +++ b/commands/docs/polars_selector_exclude.md @@ -2,7 +2,7 @@ title: polars selector exclude categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all columns except those with the given name(s). This is the inverse of `polars selector by-name`. usage: | diff --git a/commands/docs/polars_selector_first.md b/commands/docs/polars_selector_first.md index 4a78e57b757..35949722405 100644 --- a/commands/docs/polars_selector_first.md +++ b/commands/docs/polars_selector_first.md @@ -2,7 +2,7 @@ title: polars selector first categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates a selector that selects the first column(s) by index. usage: | diff --git a/commands/docs/polars_selector_float.md b/commands/docs/polars_selector_float.md index 2cd32758719..7da98d197ce 100644 --- a/commands/docs/polars_selector_float.md +++ b/commands/docs/polars_selector_float.md @@ -2,7 +2,7 @@ title: polars selector float categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all float columns. usage: | diff --git a/commands/docs/polars_selector_integer.md b/commands/docs/polars_selector_integer.md index 436ded8e4f6..5b5793c14a8 100644 --- a/commands/docs/polars_selector_integer.md +++ b/commands/docs/polars_selector_integer.md @@ -2,7 +2,7 @@ title: polars selector integer categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all integer columns. usage: | diff --git a/commands/docs/polars_selector_last.md b/commands/docs/polars_selector_last.md index c6048ee0b28..e4fcf64735a 100644 --- a/commands/docs/polars_selector_last.md +++ b/commands/docs/polars_selector_last.md @@ -2,7 +2,7 @@ title: polars selector last categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates a selector that selects the last column(s) by index. usage: | diff --git a/commands/docs/polars_selector_list.md b/commands/docs/polars_selector_list.md index f4a8e527822..65d1eb939cc 100644 --- a/commands/docs/polars_selector_list.md +++ b/commands/docs/polars_selector_list.md @@ -2,7 +2,7 @@ title: polars selector list categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all list columns. usage: | diff --git a/commands/docs/polars_selector_matches.md b/commands/docs/polars_selector_matches.md index 5c710fda72d..b93bf367049 100644 --- a/commands/docs/polars_selector_matches.md +++ b/commands/docs/polars_selector_matches.md @@ -2,7 +2,7 @@ title: polars selector matches categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all columns that match the given regex pattern. usage: | diff --git a/commands/docs/polars_selector_nested.md b/commands/docs/polars_selector_nested.md index 2447e5d157d..c5f1e15356d 100644 --- a/commands/docs/polars_selector_nested.md +++ b/commands/docs/polars_selector_nested.md @@ -2,7 +2,7 @@ title: polars selector nested categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all nested columns (list, array, or struct). usage: | diff --git a/commands/docs/polars_selector_not.md b/commands/docs/polars_selector_not.md index 496133dfdfd..d36f3c3376b 100644 --- a/commands/docs/polars_selector_not.md +++ b/commands/docs/polars_selector_not.md @@ -2,7 +2,7 @@ title: polars selector not categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Inverts selector. usage: | diff --git a/commands/docs/polars_selector_numeric.md b/commands/docs/polars_selector_numeric.md index 5bcb0426f64..fa8145518ec 100644 --- a/commands/docs/polars_selector_numeric.md +++ b/commands/docs/polars_selector_numeric.md @@ -2,7 +2,7 @@ title: polars selector numeric categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all numeric columns. usage: | diff --git a/commands/docs/polars_selector_object.md b/commands/docs/polars_selector_object.md index 980cf09683d..abd181d5d11 100644 --- a/commands/docs/polars_selector_object.md +++ b/commands/docs/polars_selector_object.md @@ -2,7 +2,7 @@ title: polars selector object categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all object columns. usage: | diff --git a/commands/docs/polars_selector_signed-integer.md b/commands/docs/polars_selector_signed-integer.md index 9a37fc93b47..bbc990ed81b 100644 --- a/commands/docs/polars_selector_signed-integer.md +++ b/commands/docs/polars_selector_signed-integer.md @@ -2,7 +2,7 @@ title: polars selector signed-integer categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all signed integer columns. usage: | diff --git a/commands/docs/polars_selector_starts-with.md b/commands/docs/polars_selector_starts-with.md index 95f69606825..bce04ccaaf3 100644 --- a/commands/docs/polars_selector_starts-with.md +++ b/commands/docs/polars_selector_starts-with.md @@ -2,7 +2,7 @@ title: polars selector starts-with categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select columns that start with the given substring(s). usage: | diff --git a/commands/docs/polars_selector_string.md b/commands/docs/polars_selector_string.md index 610a079f02f..542e37416b5 100644 --- a/commands/docs/polars_selector_string.md +++ b/commands/docs/polars_selector_string.md @@ -2,7 +2,7 @@ title: polars selector string categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all string columns. Use `--include-categorical` to also select categorical columns. usage: | diff --git a/commands/docs/polars_selector_struct.md b/commands/docs/polars_selector_struct.md index 288c3df111e..bee9356ae30 100644 --- a/commands/docs/polars_selector_struct.md +++ b/commands/docs/polars_selector_struct.md @@ -2,7 +2,7 @@ title: polars selector struct categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all struct columns. usage: | diff --git a/commands/docs/polars_selector_temporal.md b/commands/docs/polars_selector_temporal.md index 1f93b3a2580..bc33abe0feb 100644 --- a/commands/docs/polars_selector_temporal.md +++ b/commands/docs/polars_selector_temporal.md @@ -2,7 +2,7 @@ title: polars selector temporal categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all temporal columns (date, datetime, duration, and time). usage: | diff --git a/commands/docs/polars_selector_unsigned-integer.md b/commands/docs/polars_selector_unsigned-integer.md index 71cf8aeb4dc..628f4b2c2ad 100644 --- a/commands/docs/polars_selector_unsigned-integer.md +++ b/commands/docs/polars_selector_unsigned-integer.md @@ -2,7 +2,7 @@ title: polars selector unsigned-integer categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Select all unsigned integer columns. usage: | diff --git a/commands/docs/polars_set-with-idx.md b/commands/docs/polars_set-with-idx.md index f029d2155ff..f92e39721f9 100644 --- a/commands/docs/polars_set-with-idx.md +++ b/commands/docs/polars_set-with-idx.md @@ -2,7 +2,7 @@ title: polars set-with-idx categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Sets value in the given index. usage: | diff --git a/commands/docs/polars_set.md b/commands/docs/polars_set.md index 0612340076c..0a8ac9fb697 100644 --- a/commands/docs/polars_set.md +++ b/commands/docs/polars_set.md @@ -2,7 +2,7 @@ title: polars set categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Sets value where given mask is true. usage: | diff --git a/commands/docs/polars_shape.md b/commands/docs/polars_shape.md index 796f93368a3..48c05ed7dda 100644 --- a/commands/docs/polars_shape.md +++ b/commands/docs/polars_shape.md @@ -2,7 +2,7 @@ title: polars shape categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Shows column and row size for a dataframe. usage: | diff --git a/commands/docs/polars_shift.md b/commands/docs/polars_shift.md index ed61e3146f7..a82c9f422cc 100644 --- a/commands/docs/polars_shift.md +++ b/commands/docs/polars_shift.md @@ -2,7 +2,7 @@ title: polars shift categories: | dataframe or lazyframe -version: 0.114.0 +version: 0.115.0 dataframe_or_lazyframe: | Shifts the values by a given period. usage: | diff --git a/commands/docs/polars_slice.md b/commands/docs/polars_slice.md index 47b2a8c1454..5a8b15aef69 100644 --- a/commands/docs/polars_slice.md +++ b/commands/docs/polars_slice.md @@ -2,7 +2,7 @@ title: polars slice categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates new dataframe from a slice of rows. usage: | diff --git a/commands/docs/polars_sort-by.md b/commands/docs/polars_sort-by.md index 71edc13d6e7..d00261730c1 100644 --- a/commands/docs/polars_sort-by.md +++ b/commands/docs/polars_sort-by.md @@ -2,7 +2,7 @@ title: polars sort-by categories: | lazyframe -version: 0.114.0 +version: 0.115.0 lazyframe: | Sorts a lazy dataframe based on expression(s). usage: | diff --git a/commands/docs/polars_std.md b/commands/docs/polars_std.md index aa8eb1887ed..998964195fc 100644 --- a/commands/docs/polars_std.md +++ b/commands/docs/polars_std.md @@ -2,7 +2,7 @@ title: polars std categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates a std expression for an aggregation of std value from columns in a dataframe. usage: | diff --git a/commands/docs/polars_store-get.md b/commands/docs/polars_store-get.md index 7c05b3c4597..d688dcdf173 100644 --- a/commands/docs/polars_store-get.md +++ b/commands/docs/polars_store-get.md @@ -2,7 +2,7 @@ title: polars store-get categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Gets a Dataframe or other object from the plugin cache. usage: | diff --git a/commands/docs/polars_store-ls.md b/commands/docs/polars_store-ls.md index 51c7f820669..18d7c38129d 100644 --- a/commands/docs/polars_store-ls.md +++ b/commands/docs/polars_store-ls.md @@ -2,7 +2,7 @@ title: polars store-ls categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Lists stored polars objects. usage: | diff --git a/commands/docs/polars_store-rm.md b/commands/docs/polars_store-rm.md index 2c89881f669..1694860ee41 100644 --- a/commands/docs/polars_store-rm.md +++ b/commands/docs/polars_store-rm.md @@ -2,7 +2,7 @@ title: polars store-rm categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Removes a stored Dataframe or other object from the plugin cache. usage: | diff --git a/commands/docs/polars_str-join.md b/commands/docs/polars_str-join.md index 4e0cda934db..f2ed6750cd3 100644 --- a/commands/docs/polars_str-join.md +++ b/commands/docs/polars_str-join.md @@ -2,7 +2,7 @@ title: polars str-join categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Concatenates strings within a column or dataframes usage: | diff --git a/commands/docs/polars_str-lengths.md b/commands/docs/polars_str-lengths.md index e163d167e3d..b15bff20ef6 100644 --- a/commands/docs/polars_str-lengths.md +++ b/commands/docs/polars_str-lengths.md @@ -2,7 +2,7 @@ title: polars str-lengths categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Get lengths of all strings. usage: | diff --git a/commands/docs/polars_str-replace-all.md b/commands/docs/polars_str-replace-all.md index eaeeffc23f3..830f11f5c1b 100644 --- a/commands/docs/polars_str-replace-all.md +++ b/commands/docs/polars_str-replace-all.md @@ -2,7 +2,7 @@ title: polars str-replace-all categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Replace all (sub)strings by a regex pattern. usage: | diff --git a/commands/docs/polars_str-replace.md b/commands/docs/polars_str-replace.md index 24a45ed62a1..275071c5173 100644 --- a/commands/docs/polars_str-replace.md +++ b/commands/docs/polars_str-replace.md @@ -2,7 +2,7 @@ title: polars str-replace categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Replace the leftmost (sub)string by a regex pattern. usage: | diff --git a/commands/docs/polars_str-slice.md b/commands/docs/polars_str-slice.md index 92f7f07384e..db40ca31c9d 100644 --- a/commands/docs/polars_str-slice.md +++ b/commands/docs/polars_str-slice.md @@ -2,7 +2,7 @@ title: polars str-slice categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Slices the string from the start position until the selected length. usage: | diff --git a/commands/docs/polars_str-split.md b/commands/docs/polars_str-split.md index d9d8300d2f2..08ab6c45e5e 100644 --- a/commands/docs/polars_str-split.md +++ b/commands/docs/polars_str-split.md @@ -2,7 +2,7 @@ title: polars str-split categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Split the string by a substring. The resulting dtype is list. usage: | diff --git a/commands/docs/polars_str-strip-chars.md b/commands/docs/polars_str-strip-chars.md index 848a4a09751..8c7e86a4a67 100644 --- a/commands/docs/polars_str-strip-chars.md +++ b/commands/docs/polars_str-strip-chars.md @@ -2,7 +2,7 @@ title: polars str-strip-chars categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Strips specified characters from strings in a column usage: | diff --git a/commands/docs/polars_strftime.md b/commands/docs/polars_strftime.md index b5b81cc8b41..cb04c142aa6 100644 --- a/commands/docs/polars_strftime.md +++ b/commands/docs/polars_strftime.md @@ -2,7 +2,7 @@ title: polars strftime categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Formats date based on string rule. usage: | diff --git a/commands/docs/polars_struct-json-encode.md b/commands/docs/polars_struct-json-encode.md index e2834ea346c..9269695d909 100644 --- a/commands/docs/polars_struct-json-encode.md +++ b/commands/docs/polars_struct-json-encode.md @@ -2,7 +2,7 @@ title: polars struct-json-encode categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Convert this struct to a string column with json values. usage: | diff --git a/commands/docs/polars_sum.md b/commands/docs/polars_sum.md index 987ac01e05b..817bd48fd0c 100644 --- a/commands/docs/polars_sum.md +++ b/commands/docs/polars_sum.md @@ -2,7 +2,7 @@ title: polars sum categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates a sum expression for an aggregation or aggregates columns to their sum value. usage: | diff --git a/commands/docs/polars_summary.md b/commands/docs/polars_summary.md index a19ccd80881..90cdb16105b 100644 --- a/commands/docs/polars_summary.md +++ b/commands/docs/polars_summary.md @@ -2,7 +2,7 @@ title: polars summary categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. usage: | diff --git a/commands/docs/polars_take.md b/commands/docs/polars_take.md index e4c998b192e..b18a3ce2e04 100644 --- a/commands/docs/polars_take.md +++ b/commands/docs/polars_take.md @@ -2,7 +2,7 @@ title: polars take categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Creates new dataframe using the given indices. usage: | diff --git a/commands/docs/polars_truncate.md b/commands/docs/polars_truncate.md index 7feaa9a9664..743d6d9c9ac 100644 --- a/commands/docs/polars_truncate.md +++ b/commands/docs/polars_truncate.md @@ -2,7 +2,7 @@ title: polars truncate categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Divide the date/datetime range into buckets. usage: | @@ -40,7 +40,7 @@ Truncate a series of dates by period length │ # │ datetime │ truncated │ ├───┼─────────────┼─────────────┤ │ 0 │ 2 years ago │ 2 years ago │ -│ 1 │ a year ago │ a year ago │ +│ 1 │ 2 years ago │ 2 years ago │ │ 2 │ a year ago │ a year ago │ │ 3 │ a year ago │ a year ago │ ╰───┴─────────────┴─────────────╯ diff --git a/commands/docs/polars_unique.md b/commands/docs/polars_unique.md index ffb8673c07c..f22eb9640cb 100644 --- a/commands/docs/polars_unique.md +++ b/commands/docs/polars_unique.md @@ -2,7 +2,7 @@ title: polars unique categories: | dataframe or lazyframe -version: 0.114.0 +version: 0.115.0 dataframe_or_lazyframe: | Returns unique values from a dataframe. usage: | diff --git a/commands/docs/polars_unnest.md b/commands/docs/polars_unnest.md index 1669b702279..75c89bf9347 100644 --- a/commands/docs/polars_unnest.md +++ b/commands/docs/polars_unnest.md @@ -2,7 +2,7 @@ title: polars unnest categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Decompose struct columns into separate columns for each of their fields. The new columns will be inserted into the dataframe at the location of the struct column. usage: | diff --git a/commands/docs/polars_unpivot.md b/commands/docs/polars_unpivot.md index 26aef372ada..86c495aa604 100644 --- a/commands/docs/polars_unpivot.md +++ b/commands/docs/polars_unpivot.md @@ -2,7 +2,7 @@ title: polars unpivot categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Unpivot a DataFrame from wide to long format. usage: | diff --git a/commands/docs/polars_uppercase.md b/commands/docs/polars_uppercase.md index 06e233916e4..33b2cb39753 100644 --- a/commands/docs/polars_uppercase.md +++ b/commands/docs/polars_uppercase.md @@ -2,7 +2,7 @@ title: polars uppercase categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Uppercase the strings in the column. usage: | diff --git a/commands/docs/polars_value-counts.md b/commands/docs/polars_value-counts.md index 49b6901de64..1aa753484a0 100644 --- a/commands/docs/polars_value-counts.md +++ b/commands/docs/polars_value-counts.md @@ -2,7 +2,7 @@ title: polars value-counts categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Returns a dataframe with the counts for unique values in series. usage: | diff --git a/commands/docs/polars_var.md b/commands/docs/polars_var.md index 9733bb80c09..2c74f643304 100644 --- a/commands/docs/polars_var.md +++ b/commands/docs/polars_var.md @@ -2,7 +2,7 @@ title: polars var categories: | dataframe -version: 0.114.0 +version: 0.115.0 dataframe: | Create a var expression for an aggregation. usage: | diff --git a/commands/docs/polars_when.md b/commands/docs/polars_when.md index 9bf0bae715b..628de57631e 100644 --- a/commands/docs/polars_when.md +++ b/commands/docs/polars_when.md @@ -2,7 +2,7 @@ title: polars when categories: | expression -version: 0.114.0 +version: 0.115.0 expression: | Creates and modifies a when expression. usage: | diff --git a/commands/docs/polars_with-column.md b/commands/docs/polars_with-column.md index b918af14dba..f0c16726671 100644 --- a/commands/docs/polars_with-column.md +++ b/commands/docs/polars_with-column.md @@ -2,7 +2,7 @@ title: polars with-column categories: | dataframe or lazyframe -version: 0.114.0 +version: 0.115.0 dataframe_or_lazyframe: | Adds a series to the dataframe. usage: | diff --git a/commands/docs/port.md b/commands/docs/port.md index fc55771e0c2..9aa4eb82231 100644 --- a/commands/docs/port.md +++ b/commands/docs/port.md @@ -2,7 +2,7 @@ title: port categories: | network -version: 0.114.0 +version: 0.115.0 network: | Get a free TCP port from system. usage: | diff --git a/commands/docs/prepend.md b/commands/docs/prepend.md index 5d7425219cc..a6ed178ae6f 100644 --- a/commands/docs/prepend.md +++ b/commands/docs/prepend.md @@ -2,7 +2,7 @@ title: prepend categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Prepend any number of rows to a table. usage: | diff --git a/commands/docs/print.md b/commands/docs/print.md index ced5687ff60..8b52b86f17c 100644 --- a/commands/docs/print.md +++ b/commands/docs/print.md @@ -2,7 +2,7 @@ title: print categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Print the given values to stdout. usage: | diff --git a/commands/docs/ps.md b/commands/docs/ps.md index a8453e9e963..739ddcedcbb 100644 --- a/commands/docs/ps.md +++ b/commands/docs/ps.md @@ -2,7 +2,7 @@ title: ps categories: | system -version: 0.114.0 +version: 0.115.0 system: | View information about system processes. usage: | diff --git a/commands/docs/pwd.md b/commands/docs/pwd.md index e64af378996..20776b3cc19 100644 --- a/commands/docs/pwd.md +++ b/commands/docs/pwd.md @@ -2,7 +2,7 @@ title: pwd categories: | default -version: 0.114.0 +version: 0.115.0 default: | Return the current working directory usage: | diff --git a/commands/docs/query.md b/commands/docs/query.md index 341cd547ee7..91aa932ab31 100644 --- a/commands/docs/query.md +++ b/commands/docs/query.md @@ -2,7 +2,7 @@ title: query categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Show all the query commands usage: | diff --git a/commands/docs/query_db.md b/commands/docs/query_db.md index 8cdb79ee476..ec1f0de9213 100644 --- a/commands/docs/query_db.md +++ b/commands/docs/query_db.md @@ -2,7 +2,7 @@ title: query db categories: | database -version: 0.114.0 +version: 0.115.0 database: | Query a SQLite database with SQL statements. usage: | diff --git a/commands/docs/query_json.md b/commands/docs/query_json.md index 04bf0409563..38454054e32 100644 --- a/commands/docs/query_json.md +++ b/commands/docs/query_json.md @@ -2,7 +2,7 @@ title: query json categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | execute json query on json file (open --raw | query json 'query string') usage: | diff --git a/commands/docs/query_web.md b/commands/docs/query_web.md index edd0b317cc0..2c034c5be30 100644 --- a/commands/docs/query_web.md +++ b/commands/docs/query_web.md @@ -2,7 +2,7 @@ title: query web categories: | network -version: 0.114.0 +version: 0.115.0 network: | execute selector query on html/web usage: | diff --git a/commands/docs/query_webpage-info.md b/commands/docs/query_webpage-info.md index 494747da0b8..3b845722b31 100644 --- a/commands/docs/query_webpage-info.md +++ b/commands/docs/query_webpage-info.md @@ -2,7 +2,7 @@ title: query webpage-info categories: | network -version: 0.114.0 +version: 0.115.0 network: | uses the webpage crate to extract info from html: title, description, language, links, RSS feeds, Opengraph, Schema.org, and more usage: | diff --git a/commands/docs/query_xml.md b/commands/docs/query_xml.md index 700d565725e..c747f482d03 100644 --- a/commands/docs/query_xml.md +++ b/commands/docs/query_xml.md @@ -2,7 +2,7 @@ title: query xml categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Execute XPath 1.0 query on XML input usage: | diff --git a/commands/docs/random.md b/commands/docs/random.md index eb63c53e337..9fd0994101f 100644 --- a/commands/docs/random.md +++ b/commands/docs/random.md @@ -2,7 +2,7 @@ title: random categories: | random -version: 0.114.0 +version: 0.115.0 random: | Generate a random value. usage: | diff --git a/commands/docs/random_binary.md b/commands/docs/random_binary.md index 373d30c25e9..a0f3253522d 100644 --- a/commands/docs/random_binary.md +++ b/commands/docs/random_binary.md @@ -2,7 +2,7 @@ title: random binary categories: | random -version: 0.114.0 +version: 0.115.0 random: | Generate random bytes. usage: | diff --git a/commands/docs/random_bool.md b/commands/docs/random_bool.md index 4ab50a4eaf0..c5e63687f0b 100644 --- a/commands/docs/random_bool.md +++ b/commands/docs/random_bool.md @@ -2,7 +2,7 @@ title: random bool categories: | random -version: 0.114.0 +version: 0.115.0 random: | Generate a random boolean value. usage: | diff --git a/commands/docs/random_chars.md b/commands/docs/random_chars.md index f35c14ba234..fb2c21b3f58 100644 --- a/commands/docs/random_chars.md +++ b/commands/docs/random_chars.md @@ -2,7 +2,7 @@ title: random chars categories: | random -version: 0.114.0 +version: 0.115.0 random: | Generate random chars uniformly distributed over ASCII letters and numbers: a-z, A-Z and 0-9. usage: | diff --git a/commands/docs/random_float.md b/commands/docs/random_float.md index 072589f2d69..5899582c64e 100644 --- a/commands/docs/random_float.md +++ b/commands/docs/random_float.md @@ -2,7 +2,7 @@ title: random float categories: | random -version: 0.114.0 +version: 0.115.0 random: | Generate a random float within a range [min..max]. usage: | diff --git a/commands/docs/random_int.md b/commands/docs/random_int.md index 7a71f15a033..4dc7f7da0f5 100644 --- a/commands/docs/random_int.md +++ b/commands/docs/random_int.md @@ -2,7 +2,7 @@ title: random int categories: | random -version: 0.114.0 +version: 0.115.0 random: | Generate a random integer [min..max]. usage: | diff --git a/commands/docs/random_pass.md b/commands/docs/random_pass.md index b2f2f2b6ce2..b567e328129 100644 --- a/commands/docs/random_pass.md +++ b/commands/docs/random_pass.md @@ -2,7 +2,7 @@ title: random pass categories: | random -version: 0.114.0 +version: 0.115.0 random: | Generate a cryptologically secure password. usage: | diff --git a/commands/docs/random_uuid.md b/commands/docs/random_uuid.md index 2a98d454dfa..e2bd453dbad 100644 --- a/commands/docs/random_uuid.md +++ b/commands/docs/random_uuid.md @@ -2,7 +2,7 @@ title: random uuid categories: | random -version: 0.114.0 +version: 0.115.0 random: | Generate a random uuid string of the specified version. usage: | diff --git a/commands/docs/reduce.md b/commands/docs/reduce.md index b76b2939964..1d422238c17 100644 --- a/commands/docs/reduce.md +++ b/commands/docs/reduce.md @@ -2,7 +2,7 @@ title: reduce categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Aggregate a list (starting from the left) to a single value using an accumulator closure. usage: | diff --git a/commands/docs/registry.md b/commands/docs/registry.md index 3c276e8bd53..1806950bbef 100644 --- a/commands/docs/registry.md +++ b/commands/docs/registry.md @@ -2,7 +2,7 @@ title: registry categories: | system -version: 0.114.0 +version: 0.115.0 system: | Various commands for interacting with the system registry (Windows only). usage: | diff --git a/commands/docs/registry_query.md b/commands/docs/registry_query.md index a0c006703fd..a415cd16ee3 100644 --- a/commands/docs/registry_query.md +++ b/commands/docs/registry_query.md @@ -2,7 +2,7 @@ title: registry query categories: | system -version: 0.114.0 +version: 0.115.0 system: | Query the Windows registry. usage: | diff --git a/commands/docs/reject.md b/commands/docs/reject.md index 6867eb2807a..0f73f162c76 100644 --- a/commands/docs/reject.md +++ b/commands/docs/reject.md @@ -2,7 +2,7 @@ title: reject categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Remove the given columns or rows from the table. Opposite of `select`. usage: | diff --git a/commands/docs/rename.md b/commands/docs/rename.md index 6f572093942..accfa168219 100644 --- a/commands/docs/rename.md +++ b/commands/docs/rename.md @@ -2,7 +2,7 @@ title: rename categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Creates a new table with columns renamed. usage: | diff --git a/commands/docs/return.md b/commands/docs/return.md index a1dec1b6be0..e4b01884f22 100644 --- a/commands/docs/return.md +++ b/commands/docs/return.md @@ -2,7 +2,7 @@ title: return categories: | core -version: 0.114.0 +version: 0.115.0 core: | Return early from a custom command. usage: | diff --git a/commands/docs/reverse.md b/commands/docs/reverse.md index c9034c86817..1992cfd79d7 100644 --- a/commands/docs/reverse.md +++ b/commands/docs/reverse.md @@ -2,7 +2,7 @@ title: reverse categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Reverses the input list or table. usage: | diff --git a/commands/docs/rm.md b/commands/docs/rm.md index 5e672ee8af7..88225783764 100644 --- a/commands/docs/rm.md +++ b/commands/docs/rm.md @@ -2,7 +2,7 @@ title: rm categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Remove files and directories. usage: | diff --git a/commands/docs/roll.md b/commands/docs/roll.md index 9f88bd5b7bd..f988ba51dce 100644 --- a/commands/docs/roll.md +++ b/commands/docs/roll.md @@ -2,7 +2,7 @@ title: roll categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Rolling commands for tables. usage: | diff --git a/commands/docs/roll_down.md b/commands/docs/roll_down.md index da6320a733a..5ffe8379bf2 100644 --- a/commands/docs/roll_down.md +++ b/commands/docs/roll_down.md @@ -2,7 +2,7 @@ title: roll down categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Roll table rows down. usage: | diff --git a/commands/docs/roll_left.md b/commands/docs/roll_left.md index 5913e895660..80a36e49fee 100644 --- a/commands/docs/roll_left.md +++ b/commands/docs/roll_left.md @@ -2,7 +2,7 @@ title: roll left categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Roll record or table columns left. usage: | diff --git a/commands/docs/roll_right.md b/commands/docs/roll_right.md index d22c20a93dc..934e4ff5ed6 100644 --- a/commands/docs/roll_right.md +++ b/commands/docs/roll_right.md @@ -2,7 +2,7 @@ title: roll right categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Roll table columns right. usage: | diff --git a/commands/docs/roll_up.md b/commands/docs/roll_up.md index c66419786e7..49a78549963 100644 --- a/commands/docs/roll_up.md +++ b/commands/docs/roll_up.md @@ -2,7 +2,7 @@ title: roll up categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Roll table rows up. usage: | diff --git a/commands/docs/rotate.md b/commands/docs/rotate.md index 7d47c817803..19e0f147a1e 100644 --- a/commands/docs/rotate.md +++ b/commands/docs/rotate.md @@ -2,7 +2,7 @@ title: rotate categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Rotates a table or record clockwise (default) or counter-clockwise (use --ccw flag). usage: | diff --git a/commands/docs/run-external.md b/commands/docs/run-external.md index 4c5fa2d63c5..aa6a20254b4 100644 --- a/commands/docs/run-external.md +++ b/commands/docs/run-external.md @@ -2,7 +2,7 @@ title: run-external categories: | system -version: 0.114.0 +version: 0.115.0 system: | Runs external command. usage: | diff --git a/commands/docs/run-internal.md b/commands/docs/run-internal.md index 5f746632bd4..3efa4dd8c41 100644 --- a/commands/docs/run-internal.md +++ b/commands/docs/run-internal.md @@ -2,7 +2,7 @@ title: run-internal categories: | default -version: 0.114.0 +version: 0.115.0 default: | Run a built-in command by name. Used internally by `%($cmd)` dynamic dispatch. usage: | diff --git a/commands/docs/run.md b/commands/docs/run.md index 23d18757004..d892f7973b8 100644 --- a/commands/docs/run.md +++ b/commands/docs/run.md @@ -2,7 +2,7 @@ title: run categories: | core -version: 0.114.0 +version: 0.115.0 core: | Runs a script file in an isolated scope as part of a pipeline. usage: | diff --git a/commands/docs/save.md b/commands/docs/save.md index 31b44d437cd..4cf7f4b7891 100644 --- a/commands/docs/save.md +++ b/commands/docs/save.md @@ -2,7 +2,7 @@ title: save categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Save a file. usage: | diff --git a/commands/docs/schema.md b/commands/docs/schema.md index c4fb5fb30de..cb112f2963e 100644 --- a/commands/docs/schema.md +++ b/commands/docs/schema.md @@ -2,7 +2,7 @@ title: schema categories: | database -version: 0.114.0 +version: 0.115.0 database: | Show the schema of a SQLite database. usage: | diff --git a/commands/docs/scope.md b/commands/docs/scope.md index 5423eaf4754..c15c72b4832 100644 --- a/commands/docs/scope.md +++ b/commands/docs/scope.md @@ -2,7 +2,7 @@ title: scope categories: | core -version: 0.114.0 +version: 0.115.0 core: | Commands for getting info about what is in scope. usage: | @@ -29,11 +29,11 @@ contributors: false ## Subcommands: -| name | description | type | -| ------------------------------------------------------------ | -------------------------------------------------------- | -------- | -| [`scope aliases`](/commands/docs/scope_aliases.md) | Output info on the aliases in the current scope. | built-in | -| [`scope commands`](/commands/docs/scope_commands.md) | Output info on the commands in the current scope. | built-in | -| [`scope engine-stats`](/commands/docs/scope_engine-stats.md) | Output stats on the engine in the current state. | built-in | -| [`scope externs`](/commands/docs/scope_externs.md) | Output info on the known externals in the current scope. | built-in | -| [`scope modules`](/commands/docs/scope_modules.md) | Output info on the modules in the current scope. | built-in | -| [`scope variables`](/commands/docs/scope_variables.md) | Output info on the variables in the current scope. | built-in | \ No newline at end of file +| name | description | type | +| ------------------------------------------------------------ | --------------------------------------------------------------------------------------------- | -------- | +| [`scope aliases`](/commands/docs/scope_aliases.md) | Output info on the aliases in the current scope. | built-in | +| [`scope commands`](/commands/docs/scope_commands.md) | Output info on the commands in the current scope. | built-in | +| [`scope engine-stats`](/commands/docs/scope_engine-stats.md) | Output stats on the engine in the current state, including interactive last-result size info. | built-in | +| [`scope externs`](/commands/docs/scope_externs.md) | Output info on the known externals in the current scope. | built-in | +| [`scope modules`](/commands/docs/scope_modules.md) | Output info on the modules in the current scope. | built-in | +| [`scope variables`](/commands/docs/scope_variables.md) | Output info on the variables in the current scope. | built-in | \ No newline at end of file diff --git a/commands/docs/scope_aliases.md b/commands/docs/scope_aliases.md index b6f6fd73b96..c799663a5fa 100644 --- a/commands/docs/scope_aliases.md +++ b/commands/docs/scope_aliases.md @@ -2,7 +2,7 @@ title: scope aliases categories: | core -version: 0.114.0 +version: 0.115.0 core: | Output info on the aliases in the current scope. usage: | diff --git a/commands/docs/scope_commands.md b/commands/docs/scope_commands.md index b0d4e05ee72..3bd2dd4bcf0 100644 --- a/commands/docs/scope_commands.md +++ b/commands/docs/scope_commands.md @@ -2,7 +2,7 @@ title: scope commands categories: | core -version: 0.114.0 +version: 0.115.0 core: | Output info on the commands in the current scope. usage: | diff --git a/commands/docs/scope_engine-stats.md b/commands/docs/scope_engine-stats.md index 5592ba46b3e..72e9cfa0e99 100644 --- a/commands/docs/scope_engine-stats.md +++ b/commands/docs/scope_engine-stats.md @@ -2,11 +2,11 @@ title: scope engine-stats categories: | core -version: 0.114.0 +version: 0.115.0 core: | - Output stats on the engine in the current state. + Output stats on the engine in the current state, including interactive last-result size info. usage: | - Output stats on the engine in the current state. + Output stats on the engine in the current state, including interactive last-result size info. editLink: false contributors: false --- @@ -14,7 +14,7 @@ contributors: false # `scope engine-stats` for [core](/commands/categories/core.md) -
Output stats on the engine in the current state.
+
Output stats on the engine in the current state, including interactive last-result size info.
## Signature @@ -28,7 +28,7 @@ contributors: false | nothing | any | ## Examples -Show the stats on the current engine state. +Show the stats on the current engine state (includes last_result size limit and memory use). ```nu > scope engine-stats diff --git a/commands/docs/scope_externs.md b/commands/docs/scope_externs.md index 7844a887a0f..1434757a5bb 100644 --- a/commands/docs/scope_externs.md +++ b/commands/docs/scope_externs.md @@ -2,7 +2,7 @@ title: scope externs categories: | core -version: 0.114.0 +version: 0.115.0 core: | Output info on the known externals in the current scope. usage: | diff --git a/commands/docs/scope_modules.md b/commands/docs/scope_modules.md index 3067d22bf66..208de44fc11 100644 --- a/commands/docs/scope_modules.md +++ b/commands/docs/scope_modules.md @@ -2,7 +2,7 @@ title: scope modules categories: | core -version: 0.114.0 +version: 0.115.0 core: | Output info on the modules in the current scope. usage: | diff --git a/commands/docs/scope_variables.md b/commands/docs/scope_variables.md index 9585bc6c324..c06569e0489 100644 --- a/commands/docs/scope_variables.md +++ b/commands/docs/scope_variables.md @@ -2,7 +2,7 @@ title: scope variables categories: | core -version: 0.114.0 +version: 0.115.0 core: | Output info on the variables in the current scope. usage: | @@ -33,3 +33,21 @@ Show the variables in the current scope. > scope variables ``` + +## Notes +Lists variables that are available at runtime in the current stack and active overlays (locals and globals). Nested scopes such as `do`, `if`/`for` bodies, and custom commands include their locals while that scope is active; outer locals remain visible when the outer frame is still on the stack. + +Closures only capture free variables that are referenced in the closure body. An outer local that is never mentioned is not captured, so after the defining scope ends it will not appear in `scope variables` when that closure runs. Mentioning the variable (for example `$a`) causes it to be captured and listed. + +For example, this shows `$a` inside the `do` block, but not when the returned closure runs later: + + do { + let a = 123 + scope variables | where name == '$a' | print + {|| scope variables | where name == '$a' } + } | let factory + do $factory + +Adding a reference to `$a` in the closure body captures it so it appears: + + {|| $a; scope variables | where name == '$a' } \ No newline at end of file diff --git a/commands/docs/select.md b/commands/docs/select.md index 4c0961cae3e..be7feb24d2f 100644 --- a/commands/docs/select.md +++ b/commands/docs/select.md @@ -2,7 +2,7 @@ title: select categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Select only these columns or rows from the input. Opposite of `reject`. usage: | diff --git a/commands/docs/semver.md b/commands/docs/semver.md index 4d389f55c6c..6f719686eba 100644 --- a/commands/docs/semver.md +++ b/commands/docs/semver.md @@ -2,7 +2,7 @@ title: semver categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Various commands for working with semantic versions. usage: | diff --git a/commands/docs/semver_bump.md b/commands/docs/semver_bump.md index f94ceb4dc94..8c21e5ec3f1 100644 --- a/commands/docs/semver_bump.md +++ b/commands/docs/semver_bump.md @@ -2,7 +2,7 @@ title: semver bump categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Bump a semantic version to the next level. usage: | @@ -24,6 +24,7 @@ contributors: false - `--ignore-errors, -i`: If the input is not a valid semver version, return the original input unchanged - `--preserve-build-metadata, -p`: Preserve the existing build metadata from the input version + - `--loose, -l`: Allow common non-strict prefixes such as v1.2.3, v.1.2.3, v:1.2.3, v-1.2.3, or v_1.2.3 when parsing string input; the prefix is preserved on the result - `--build-metadata, -b {string}`: Additionally set the build metadata. Takes precedence over --preserve-build-metadata ## Parameters @@ -80,3 +81,15 @@ Bump with preserved build metadata > '1.2.3+build.5' | into semver | semver bump patch --preserve-build-metadata 1.2.4+build.5 ``` + +Bump a loosely-prefixed version string +```nu +> 'v1.2.3' | semver bump patch --loose | to text +v1.2.4 +``` + +Bump after converting with --loose (prefix is preserved) +```nu +> 'v1.2.3' | into semver --loose | semver bump major | to text +v2.0.0 +``` diff --git a/commands/docs/seq.md b/commands/docs/seq.md index e5297a663af..3a601b07a8b 100644 --- a/commands/docs/seq.md +++ b/commands/docs/seq.md @@ -2,7 +2,7 @@ title: seq categories: | generators -version: 0.114.0 +version: 0.115.0 generators: | Output sequences of numbers. usage: | diff --git a/commands/docs/seq_char.md b/commands/docs/seq_char.md index 1949da3af84..08686631cdd 100644 --- a/commands/docs/seq_char.md +++ b/commands/docs/seq_char.md @@ -2,7 +2,7 @@ title: seq char categories: | generators -version: 0.114.0 +version: 0.115.0 generators: | Print a sequence of ASCII characters. usage: | diff --git a/commands/docs/seq_date.md b/commands/docs/seq_date.md index 764d40d30a0..9ad21d6165b 100644 --- a/commands/docs/seq_date.md +++ b/commands/docs/seq_date.md @@ -2,7 +2,7 @@ title: seq date categories: | generators -version: 0.114.0 +version: 0.115.0 generators: | Print sequences of dates. usage: | diff --git a/commands/docs/shuffle.md b/commands/docs/shuffle.md index d3d153e007c..30296b1cba6 100644 --- a/commands/docs/shuffle.md +++ b/commands/docs/shuffle.md @@ -2,7 +2,7 @@ title: shuffle categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Shuffle rows randomly. usage: | diff --git a/commands/docs/skip.md b/commands/docs/skip.md index de998aad3ef..ec9f3115f74 100644 --- a/commands/docs/skip.md +++ b/commands/docs/skip.md @@ -2,11 +2,11 @@ title: skip categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | - Skip the first several rows of the input. Counterpart of `drop`. Opposite of `first`. + Skip the first several rows of the input. Counterpart of `drop`. Opposite of `first`. For binary input, n can also be specified as a filesize. usage: | - Skip the first several rows of the input. Counterpart of `drop`. Opposite of `first`. + Skip the first several rows of the input. Counterpart of `drop`. Opposite of `first`. For binary input, n can also be specified as a filesize. editLink: false contributors: false --- @@ -14,7 +14,7 @@ contributors: false # `skip` for [filters](/commands/categories/filters.md) -
Skip the first several rows of the input. Counterpart of `drop`. Opposite of `first`.
+
Skip the first several rows of the input. Counterpart of `drop`. Opposite of `first`. For binary input, n can also be specified as a filesize.
## Signature @@ -64,6 +64,14 @@ Length: 2 (0x2) bytes | null_char printable whitespace ascii_other non_ascii ``` +Skip 2 bytes of a binary value, using a filesize argument. +```nu +> 0x[01 23 45 67] | skip 2b +Length: 2 (0x2) bytes | null_char printable whitespace ascii_other non_ascii +00000000: 45 67 Eg + +``` + ## Notes To skip specific numbered rows, try `drop nth`. To skip specific named columns, try `reject`. diff --git a/commands/docs/skip_until.md b/commands/docs/skip_until.md index f3b0bcb4886..81ad2a0c5c9 100644 --- a/commands/docs/skip_until.md +++ b/commands/docs/skip_until.md @@ -2,7 +2,7 @@ title: skip until categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Skip elements of the input until a predicate is true. usage: | diff --git a/commands/docs/skip_while.md b/commands/docs/skip_while.md index 4aee42baeb0..05d4c532ad2 100644 --- a/commands/docs/skip_while.md +++ b/commands/docs/skip_while.md @@ -2,7 +2,7 @@ title: skip while categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Skip elements of the input while a predicate is true. usage: | diff --git a/commands/docs/sleep.md b/commands/docs/sleep.md index 48900562015..8f64b6e9aac 100644 --- a/commands/docs/sleep.md +++ b/commands/docs/sleep.md @@ -2,7 +2,7 @@ title: sleep categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Delay for a specified amount of time. usage: | diff --git a/commands/docs/slice.md b/commands/docs/slice.md index 520f3c50f69..15597edf44f 100644 --- a/commands/docs/slice.md +++ b/commands/docs/slice.md @@ -2,7 +2,7 @@ title: slice categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Return only the selected rows. usage: | diff --git a/commands/docs/sort-by.md b/commands/docs/sort-by.md index e5bb2e6b1c5..d00e2968328 100644 --- a/commands/docs/sort-by.md +++ b/commands/docs/sort-by.md @@ -2,7 +2,7 @@ title: sort-by categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Sort by the given cell path or closure. usage: | diff --git a/commands/docs/sort.md b/commands/docs/sort.md index 693caa0b301..d915d947701 100644 --- a/commands/docs/sort.md +++ b/commands/docs/sort.md @@ -2,7 +2,7 @@ title: sort categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Sort the input in increasing order. usage: | diff --git a/commands/docs/source-env.md b/commands/docs/source-env.md index 17fa7f57321..3f2fa4e4e16 100644 --- a/commands/docs/source-env.md +++ b/commands/docs/source-env.md @@ -2,7 +2,7 @@ title: source-env categories: | core -version: 0.114.0 +version: 0.115.0 core: | Source the environment from a source file into the current environment. usage: | diff --git a/commands/docs/source.md b/commands/docs/source.md index 823fc315e11..b4b988d2814 100644 --- a/commands/docs/source.md +++ b/commands/docs/source.md @@ -2,7 +2,7 @@ title: source categories: | core -version: 0.114.0 +version: 0.115.0 core: | Runs a script file in the current context. usage: | diff --git a/commands/docs/split.md b/commands/docs/split.md index ba424a8f97f..04b94d2a3e2 100644 --- a/commands/docs/split.md +++ b/commands/docs/split.md @@ -2,7 +2,7 @@ title: split categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Split contents across desired subcommand (like row, column) via the separator. usage: | diff --git a/commands/docs/split_cell-path.md b/commands/docs/split_cell-path.md index c317de04078..aa515b44818 100644 --- a/commands/docs/split_cell-path.md +++ b/commands/docs/split_cell-path.md @@ -2,7 +2,7 @@ title: split cell-path categories: | conversions -version: 0.114.0 +version: 0.115.0 conversions: | Split a cell-path into its components. usage: | diff --git a/commands/docs/split_chars.md b/commands/docs/split_chars.md index 9419af462cf..4bc9ca3e039 100644 --- a/commands/docs/split_chars.md +++ b/commands/docs/split_chars.md @@ -2,7 +2,7 @@ title: split chars categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Split a string into a list of characters. usage: | diff --git a/commands/docs/split_column.md b/commands/docs/split_column.md index 5d709d15c0e..c451a84bf9a 100644 --- a/commands/docs/split_column.md +++ b/commands/docs/split_column.md @@ -2,7 +2,7 @@ title: split column categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Split a string into multiple columns using a separator. usage: | diff --git a/commands/docs/split_list.md b/commands/docs/split_list.md index 8a21e05fd26..22a92acf296 100644 --- a/commands/docs/split_list.md +++ b/commands/docs/split_list.md @@ -2,7 +2,7 @@ title: split list categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Split a list into multiple lists using a separator. usage: | diff --git a/commands/docs/split_row.md b/commands/docs/split_row.md index 6de92d8c89d..d12b69f2cf4 100644 --- a/commands/docs/split_row.md +++ b/commands/docs/split_row.md @@ -2,7 +2,7 @@ title: split row categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Split a string into multiple rows using a separator. usage: | diff --git a/commands/docs/split_words.md b/commands/docs/split_words.md index 510e1053928..e550138a650 100644 --- a/commands/docs/split_words.md +++ b/commands/docs/split_words.md @@ -2,7 +2,7 @@ title: split words categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Split a string's words into separate rows. usage: | diff --git a/commands/docs/start.md b/commands/docs/start.md index 0c292ea8112..eafd91263d9 100644 --- a/commands/docs/start.md +++ b/commands/docs/start.md @@ -2,7 +2,7 @@ title: start categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Open a folder, file, or website in the default application or viewer. usage: | diff --git a/commands/docs/stor.md b/commands/docs/stor.md index f008c67797e..cd5a45bf04c 100644 --- a/commands/docs/stor.md +++ b/commands/docs/stor.md @@ -2,7 +2,7 @@ title: stor categories: | database -version: 0.114.0 +version: 0.115.0 database: | Various commands for working with the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_create.md b/commands/docs/stor_create.md index 81c47fc4cc2..c623fa84779 100644 --- a/commands/docs/stor_create.md +++ b/commands/docs/stor_create.md @@ -2,7 +2,7 @@ title: stor create categories: | database -version: 0.114.0 +version: 0.115.0 database: | Create a table in the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_delete.md b/commands/docs/stor_delete.md index bd5a19a04e6..11a486497bf 100644 --- a/commands/docs/stor_delete.md +++ b/commands/docs/stor_delete.md @@ -2,7 +2,7 @@ title: stor delete categories: | database -version: 0.114.0 +version: 0.115.0 database: | Delete a table or specified rows in the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_export.md b/commands/docs/stor_export.md index 194955b5d52..89e76c58d96 100644 --- a/commands/docs/stor_export.md +++ b/commands/docs/stor_export.md @@ -2,7 +2,7 @@ title: stor export categories: | database -version: 0.114.0 +version: 0.115.0 database: | Export the in-memory sqlite database to a sqlite database file. usage: | diff --git a/commands/docs/stor_import.md b/commands/docs/stor_import.md index b5b7caf283d..d3d8b3bb667 100644 --- a/commands/docs/stor_import.md +++ b/commands/docs/stor_import.md @@ -2,7 +2,7 @@ title: stor import categories: | database -version: 0.114.0 +version: 0.115.0 database: | Import a sqlite database file into the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_insert.md b/commands/docs/stor_insert.md index 9584d559e32..a326a80d286 100644 --- a/commands/docs/stor_insert.md +++ b/commands/docs/stor_insert.md @@ -2,7 +2,7 @@ title: stor insert categories: | database -version: 0.114.0 +version: 0.115.0 database: | Insert information into a specified table in the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_open.md b/commands/docs/stor_open.md index aa5b1cf3795..1b8d8f7c1e5 100644 --- a/commands/docs/stor_open.md +++ b/commands/docs/stor_open.md @@ -2,7 +2,7 @@ title: stor open categories: | database -version: 0.114.0 +version: 0.115.0 database: | Opens the in-memory sqlite database. usage: | diff --git a/commands/docs/stor_reset.md b/commands/docs/stor_reset.md index cb4e536b043..c4e1311b243 100644 --- a/commands/docs/stor_reset.md +++ b/commands/docs/stor_reset.md @@ -2,7 +2,7 @@ title: stor reset categories: | database -version: 0.114.0 +version: 0.115.0 database: | Reset the in-memory database by dropping all tables. usage: | diff --git a/commands/docs/stor_update.md b/commands/docs/stor_update.md index 71e5c79d6b2..16575037653 100644 --- a/commands/docs/stor_update.md +++ b/commands/docs/stor_update.md @@ -2,7 +2,7 @@ title: stor update categories: | database -version: 0.114.0 +version: 0.115.0 database: | Update information in a specified table in the in-memory sqlite database. usage: | diff --git a/commands/docs/str.md b/commands/docs/str.md index 18f87bae131..10fd2cf55ab 100644 --- a/commands/docs/str.md +++ b/commands/docs/str.md @@ -2,7 +2,7 @@ title: str categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Various commands for working with string data. usage: | diff --git a/commands/docs/str_camel-case.md b/commands/docs/str_camel-case.md index d01721e59b6..1444f97bb02 100644 --- a/commands/docs/str_camel-case.md +++ b/commands/docs/str_camel-case.md @@ -2,7 +2,7 @@ title: str camel-case categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Convert a string to camelCase. usage: | diff --git a/commands/docs/str_capitalize.md b/commands/docs/str_capitalize.md index b299da53070..9fd8723a67d 100644 --- a/commands/docs/str_capitalize.md +++ b/commands/docs/str_capitalize.md @@ -2,7 +2,7 @@ title: str capitalize categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Capitalize the first letter of text. usage: | diff --git a/commands/docs/str_contains.md b/commands/docs/str_contains.md index 4e3c784cff6..a8cdf947e63 100644 --- a/commands/docs/str_contains.md +++ b/commands/docs/str_contains.md @@ -2,7 +2,7 @@ title: str contains categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Checks if string input contains a substring. usage: | diff --git a/commands/docs/str_distance.md b/commands/docs/str_distance.md index 8ed070a05d2..6c647cfb82c 100644 --- a/commands/docs/str_distance.md +++ b/commands/docs/str_distance.md @@ -2,7 +2,7 @@ title: str distance categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Compare two strings and return the edit distance/Levenshtein distance. usage: | diff --git a/commands/docs/str_downcase.md b/commands/docs/str_downcase.md index d192b3190af..1744a2e9b67 100644 --- a/commands/docs/str_downcase.md +++ b/commands/docs/str_downcase.md @@ -2,7 +2,7 @@ title: str downcase categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Convert text to lowercase. usage: | diff --git a/commands/docs/str_ends-with.md b/commands/docs/str_ends-with.md index 9e3f12cce29..f2fc038960f 100644 --- a/commands/docs/str_ends-with.md +++ b/commands/docs/str_ends-with.md @@ -2,7 +2,7 @@ title: str ends-with categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Check if an input ends with a string. usage: | diff --git a/commands/docs/str_escape-regex.md b/commands/docs/str_escape-regex.md index 1338a3ed11d..69f762a10a1 100644 --- a/commands/docs/str_escape-regex.md +++ b/commands/docs/str_escape-regex.md @@ -2,7 +2,7 @@ title: str escape-regex categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Escapes special characters in the input string with '\'. usage: | diff --git a/commands/docs/str_expand.md b/commands/docs/str_expand.md index 0d770b86803..9f7615cedc5 100644 --- a/commands/docs/str_expand.md +++ b/commands/docs/str_expand.md @@ -2,7 +2,7 @@ title: str expand categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Generates all possible combinations defined in brace expansion syntax. usage: | diff --git a/commands/docs/str_index-of.md b/commands/docs/str_index-of.md index d0f1f22fb21..57c87eaf6be 100644 --- a/commands/docs/str_index-of.md +++ b/commands/docs/str_index-of.md @@ -2,7 +2,7 @@ title: str index-of categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Returns start index of first occurrence of string in input, or -1 if no match. usage: | diff --git a/commands/docs/str_join.md b/commands/docs/str_join.md index c488efeaa68..8c89a19a1a6 100644 --- a/commands/docs/str_join.md +++ b/commands/docs/str_join.md @@ -2,7 +2,7 @@ title: str join categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Concatenate multiple strings into a single string, with an optional separator between each. usage: | diff --git a/commands/docs/str_kebab-case.md b/commands/docs/str_kebab-case.md index ee67db290fd..ca06f5f39cb 100644 --- a/commands/docs/str_kebab-case.md +++ b/commands/docs/str_kebab-case.md @@ -2,7 +2,7 @@ title: str kebab-case categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Convert a string to kebab-case. usage: | diff --git a/commands/docs/str_length.md b/commands/docs/str_length.md index 66e391c29b1..c4b5de7644f 100644 --- a/commands/docs/str_length.md +++ b/commands/docs/str_length.md @@ -2,7 +2,7 @@ title: str length categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Output the length of any strings in the pipeline. usage: | diff --git a/commands/docs/str_lowercase.md b/commands/docs/str_lowercase.md index b8c06fa6f3f..bd3c4a9ce32 100644 --- a/commands/docs/str_lowercase.md +++ b/commands/docs/str_lowercase.md @@ -2,7 +2,7 @@ title: str lowercase categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Convert text to lowercase. usage: | diff --git a/commands/docs/str_pascal-case.md b/commands/docs/str_pascal-case.md index 374707d5480..8428cc16ec6 100644 --- a/commands/docs/str_pascal-case.md +++ b/commands/docs/str_pascal-case.md @@ -2,7 +2,7 @@ title: str pascal-case categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Convert a string to PascalCase. usage: | diff --git a/commands/docs/str_replace.md b/commands/docs/str_replace.md index 18cee52d8ca..758cb913c1b 100644 --- a/commands/docs/str_replace.md +++ b/commands/docs/str_replace.md @@ -2,7 +2,7 @@ title: str replace categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Find and replace text in the input string. usage: | diff --git a/commands/docs/str_reverse.md b/commands/docs/str_reverse.md index 24e4be13951..0419bf64b99 100644 --- a/commands/docs/str_reverse.md +++ b/commands/docs/str_reverse.md @@ -2,7 +2,7 @@ title: str reverse categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Reverse every string in the pipeline. usage: | diff --git a/commands/docs/str_screaming-snake-case.md b/commands/docs/str_screaming-snake-case.md index de8342d8d9f..e78b36aa6d0 100644 --- a/commands/docs/str_screaming-snake-case.md +++ b/commands/docs/str_screaming-snake-case.md @@ -2,7 +2,7 @@ title: str screaming-snake-case categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Convert a string to SCREAMING_SNAKE_CASE. usage: | diff --git a/commands/docs/str_snake-case.md b/commands/docs/str_snake-case.md index 3ad45808309..8fdc69e4162 100644 --- a/commands/docs/str_snake-case.md +++ b/commands/docs/str_snake-case.md @@ -2,7 +2,7 @@ title: str snake-case categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Convert a string to snake_case. usage: | diff --git a/commands/docs/str_starts-with.md b/commands/docs/str_starts-with.md index 5e9e2c91a04..f09200087ab 100644 --- a/commands/docs/str_starts-with.md +++ b/commands/docs/str_starts-with.md @@ -2,7 +2,7 @@ title: str starts-with categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Check if an input starts with a string. usage: | diff --git a/commands/docs/str_stats.md b/commands/docs/str_stats.md index 4ec6b7a24db..ebbff838654 100644 --- a/commands/docs/str_stats.md +++ b/commands/docs/str_stats.md @@ -2,7 +2,7 @@ title: str stats categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Gather word count statistics on the text. usage: | diff --git a/commands/docs/str_substring.md b/commands/docs/str_substring.md index d6fd7416179..194acc6de3f 100644 --- a/commands/docs/str_substring.md +++ b/commands/docs/str_substring.md @@ -2,7 +2,7 @@ title: str substring categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Get part of a string. Note that the first character of a string is index 0. usage: | diff --git a/commands/docs/str_title-case.md b/commands/docs/str_title-case.md index ef68b581745..58e87b70265 100644 --- a/commands/docs/str_title-case.md +++ b/commands/docs/str_title-case.md @@ -2,7 +2,7 @@ title: str title-case categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Convert a string to Title Case. usage: | diff --git a/commands/docs/str_trim.md b/commands/docs/str_trim.md index 96b1d17b3a6..b965ed401ba 100644 --- a/commands/docs/str_trim.md +++ b/commands/docs/str_trim.md @@ -2,7 +2,7 @@ title: str trim categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Trim whitespace or specific character. usage: | diff --git a/commands/docs/str_upcase.md b/commands/docs/str_upcase.md index fe8a1f384a0..ad952b2aeb9 100644 --- a/commands/docs/str_upcase.md +++ b/commands/docs/str_upcase.md @@ -2,7 +2,7 @@ title: str upcase categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Convert text to uppercase. usage: | diff --git a/commands/docs/str_uppercase.md b/commands/docs/str_uppercase.md index ce9f4a27565..b88a965c540 100644 --- a/commands/docs/str_uppercase.md +++ b/commands/docs/str_uppercase.md @@ -2,7 +2,7 @@ title: str uppercase categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Convert text to uppercase. usage: | diff --git a/commands/docs/sys.md b/commands/docs/sys.md index c9a4b5578f6..7d0ba48ffe0 100644 --- a/commands/docs/sys.md +++ b/commands/docs/sys.md @@ -2,7 +2,7 @@ title: sys categories: | system -version: 0.114.0 +version: 0.115.0 system: | View information about the system. usage: | diff --git a/commands/docs/sys_cpu.md b/commands/docs/sys_cpu.md index 5f07418c771..9eed2bcdcce 100644 --- a/commands/docs/sys_cpu.md +++ b/commands/docs/sys_cpu.md @@ -2,7 +2,7 @@ title: sys cpu categories: | system -version: 0.114.0 +version: 0.115.0 system: | View information about the system CPUs. usage: | diff --git a/commands/docs/sys_disks.md b/commands/docs/sys_disks.md index 0779c622f43..3055b5eda17 100644 --- a/commands/docs/sys_disks.md +++ b/commands/docs/sys_disks.md @@ -2,7 +2,7 @@ title: sys disks categories: | system -version: 0.114.0 +version: 0.115.0 system: | View information about the system disks. usage: | diff --git a/commands/docs/sys_host.md b/commands/docs/sys_host.md index 423aec2602f..5530937bc6b 100644 --- a/commands/docs/sys_host.md +++ b/commands/docs/sys_host.md @@ -2,7 +2,7 @@ title: sys host categories: | system -version: 0.114.0 +version: 0.115.0 system: | View information about the system host. usage: | diff --git a/commands/docs/sys_mem.md b/commands/docs/sys_mem.md index c3e71c9ca27..dcd43fe8537 100644 --- a/commands/docs/sys_mem.md +++ b/commands/docs/sys_mem.md @@ -2,7 +2,7 @@ title: sys mem categories: | system -version: 0.114.0 +version: 0.115.0 system: | View information about the system memory. usage: | diff --git a/commands/docs/sys_net.md b/commands/docs/sys_net.md index 12a50f40c3a..b832dada21d 100644 --- a/commands/docs/sys_net.md +++ b/commands/docs/sys_net.md @@ -2,7 +2,7 @@ title: sys net categories: | system -version: 0.114.0 +version: 0.115.0 system: | View information about the system network interfaces. usage: | diff --git a/commands/docs/sys_temp.md b/commands/docs/sys_temp.md index 19c79eb0089..8cbe23fff5d 100644 --- a/commands/docs/sys_temp.md +++ b/commands/docs/sys_temp.md @@ -2,7 +2,7 @@ title: sys temp categories: | system -version: 0.114.0 +version: 0.115.0 system: | View the temperatures of system components. usage: | diff --git a/commands/docs/sys_users.md b/commands/docs/sys_users.md index 754139ca454..31cda72ea9a 100644 --- a/commands/docs/sys_users.md +++ b/commands/docs/sys_users.md @@ -2,7 +2,7 @@ title: sys users categories: | system -version: 0.114.0 +version: 0.115.0 system: | View information about the users on the system. usage: | diff --git a/commands/docs/table.md b/commands/docs/table.md index 680cdae5b3b..f6d17e20e66 100644 --- a/commands/docs/table.md +++ b/commands/docs/table.md @@ -2,7 +2,7 @@ title: table categories: | viewers -version: 0.114.0 +version: 0.115.0 viewers: | Render the table. usage: | diff --git a/commands/docs/take.md b/commands/docs/take.md index 8eaa9c5a4f1..4c1b2d0923b 100644 --- a/commands/docs/take.md +++ b/commands/docs/take.md @@ -2,11 +2,11 @@ title: take categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | - Take only the first n elements of a list, or the first n bytes of a binary value. + Take only the first n elements of a list, or the first n bytes of a binary value. For binary input, n can also be specified as a filesize. usage: | - Take only the first n elements of a list, or the first n bytes of a binary value. + Take only the first n elements of a list, or the first n bytes of a binary value. For binary input, n can also be specified as a filesize. editLink: false contributors: false --- @@ -14,7 +14,7 @@ contributors: false # `take` for [filters](/commands/categories/filters.md) -
Take only the first n elements of a list, or the first n bytes of a binary value.
+
Take only the first n elements of a list, or the first n bytes of a binary value. For binary input, n can also be specified as a filesize.
## Signature @@ -85,6 +85,14 @@ Return the first 3 elements of a range. ``` +Return the first 3 bytes of a binary value, using a filesize argument. +```nu +> 0x[01 23 45] | take 3b +Length: 3 (0x3) bytes | null_char printable whitespace ascii_other non_ascii +00000000: 01 23 45 •#E + +``` + ## Subcommands: diff --git a/commands/docs/take_until.md b/commands/docs/take_until.md index ec88c8dedfe..990a461a1ab 100644 --- a/commands/docs/take_until.md +++ b/commands/docs/take_until.md @@ -2,7 +2,7 @@ title: take until categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Take elements of the input until a predicate is true. usage: | @@ -20,6 +20,10 @@ contributors: false ```> take until {flags} (predicate)``` +## Flags + + - `--include, -i {int}`: Include extra items after the stream would otherwise have stopped. `0` is a no-op. + ## Parameters - `predicate`: The predicate that element(s) must not match. @@ -29,6 +33,7 @@ contributors: false | input | output | | --------- | --------- | +| table | table | | list<any> | list<any> | ## Examples @@ -63,3 +68,16 @@ Take until the field value is positive. ╰───┴────╯ ``` + +Take until the first item with an uppercase name including that item. +```nu +> [[name value]; [b, 2], [c, 3], [A, 1], [D, 4]] | take until -i 1 {|x| $x.name like '[A-Z]' } +╭───┬──────┬───────╮ +│ # │ name │ value │ +├───┼──────┼───────┤ +│ 0 │ b │ 2 │ +│ 1 │ c │ 3 │ +│ 2 │ A │ 1 │ +╰───┴──────┴───────╯ + +``` diff --git a/commands/docs/take_while.md b/commands/docs/take_while.md index 753d3c72cf5..77e14842ec7 100644 --- a/commands/docs/take_while.md +++ b/commands/docs/take_while.md @@ -2,7 +2,7 @@ title: take while categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Take elements of the input while a predicate is true. usage: | @@ -20,6 +20,10 @@ contributors: false ```> take while {flags} (predicate)``` +## Flags + + - `--include, -i {int}`: Include extra items after the stream would otherwise have stopped. `0` is a no-op. + ## Parameters - `predicate`: The predicate that element(s) must match. @@ -64,3 +68,16 @@ Take while the field value is negative. ╰───┴────╯ ``` + +Take until the first item without a lowercase name including that item. +```nu +> [[name value]; [b, 2], [c, 3], [A, 1], [D, 4]] | take while -i 1 {|x| $x.name like '[a-z]' } +╭───┬──────┬───────╮ +│ # │ name │ value │ +├───┼──────┼───────┤ +│ 0 │ b │ 2 │ +│ 1 │ c │ 3 │ +│ 2 │ A │ 1 │ +╰───┴──────┴───────╯ + +``` diff --git a/commands/docs/tee.md b/commands/docs/tee.md index 59071d65bb0..7552b009cd6 100644 --- a/commands/docs/tee.md +++ b/commands/docs/tee.md @@ -2,7 +2,7 @@ title: tee categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Copy a stream to another command in parallel. usage: | diff --git a/commands/docs/term.md b/commands/docs/term.md index dd591fe8853..a3166df7c34 100644 --- a/commands/docs/term.md +++ b/commands/docs/term.md @@ -2,7 +2,7 @@ title: term categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Commands for querying information about the terminal. usage: | diff --git a/commands/docs/term_query.md b/commands/docs/term_query.md index 292f8eb3413..d5004021d0e 100644 --- a/commands/docs/term_query.md +++ b/commands/docs/term_query.md @@ -2,7 +2,7 @@ title: term query categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Query the terminal for information. usage: | diff --git a/commands/docs/term_size.md b/commands/docs/term_size.md index 0710004e939..51ad670a299 100644 --- a/commands/docs/term_size.md +++ b/commands/docs/term_size.md @@ -2,7 +2,7 @@ title: term size categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Returns a record containing the number of columns (width) and rows (height) of the terminal. usage: | diff --git a/commands/docs/timeit.md b/commands/docs/timeit.md index 36942d99037..2b8f4e046bf 100644 --- a/commands/docs/timeit.md +++ b/commands/docs/timeit.md @@ -2,7 +2,7 @@ title: timeit categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Time how long it takes a closure to run. usage: | diff --git a/commands/docs/to.md b/commands/docs/to.md index da2c9d9a220..2c66d50897e 100644 --- a/commands/docs/to.md +++ b/commands/docs/to.md @@ -2,7 +2,7 @@ title: to categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Translate structured data to various formats. usage: | @@ -36,7 +36,7 @@ You must use one of the following subcommands. Using this command as-is will onl | [`to csv`](/commands/docs/to_csv.md) | Convert table into .csv text . | built-in | | [`to html`](/commands/docs/to_html.md) | Convert table into simple HTML. | built-in | | [`to json`](/commands/docs/to_json.md) | Converts table data into JSON text. | built-in | -| [`to kdl`](/commands/docs/to_kdl.md) | Converts table data into KDL text. | built-in | +| [`to kdl`](/commands/docs/to_kdl.md) | Converts structured data into KDL text. | built-in | | [`to md`](/commands/docs/to_md.md) | Convert table into simple Markdown. | built-in | | [`to msgpack`](/commands/docs/to_msgpack.md) | Convert Nu values into MessagePack. | built-in | | [`to msgpackz`](/commands/docs/to_msgpackz.md) | Convert Nu values into brotli-compressed MessagePack. | built-in | @@ -45,6 +45,7 @@ You must use one of the following subcommands. Using this command as-is will onl | [`to text`](/commands/docs/to_text.md) | Convert data into plain text format. | built-in | | [`to toml`](/commands/docs/to_toml.md) | Convert record into .toml text. | built-in | | [`to tsv`](/commands/docs/to_tsv.md) | Convert table into .tsv text. | built-in | +| [`to txt`](/commands/docs/to_txt.md) | Convert data into plain text format. | built-in | | [`to xml`](/commands/docs/to_xml.md) | Convert special record structure into .xml text. | built-in | | [`to yaml`](/commands/docs/to_yaml.md) | Convert table into .yaml/.yml text. | built-in | | [`to yml`](/commands/docs/to_yml.md) | Convert table into .yaml/.yml text. | built-in | \ No newline at end of file diff --git a/commands/docs/to_csv.md b/commands/docs/to_csv.md index e02f95c1090..01ce7d8115c 100644 --- a/commands/docs/to_csv.md +++ b/commands/docs/to_csv.md @@ -2,7 +2,7 @@ title: to csv categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert table into .csv text . usage: | diff --git a/commands/docs/to_html.md b/commands/docs/to_html.md index 582726e1045..1a27db7140c 100644 --- a/commands/docs/to_html.md +++ b/commands/docs/to_html.md @@ -2,7 +2,7 @@ title: to html categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert table into simple HTML. usage: | diff --git a/commands/docs/to_json.md b/commands/docs/to_json.md index 003dccfa949..b02574aa315 100644 --- a/commands/docs/to_json.md +++ b/commands/docs/to_json.md @@ -2,7 +2,7 @@ title: to json categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Converts table data into JSON text. usage: | diff --git a/commands/docs/to_kdl.md b/commands/docs/to_kdl.md index 87c9784089a..776fe42bae7 100644 --- a/commands/docs/to_kdl.md +++ b/commands/docs/to_kdl.md @@ -2,11 +2,11 @@ title: to kdl categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | - Converts table data into KDL text. + Converts structured data into KDL text. usage: | - Converts table data into KDL text. + Converts structured data into KDL text. editLink: false contributors: false --- @@ -14,7 +14,7 @@ contributors: false # `to kdl` for [formats](/commands/categories/formats.md) -
Converts table data into KDL text.
+
Converts structured data into KDL text.
## Signature @@ -22,7 +22,10 @@ contributors: false ## Flags - - `--serialize, -s`: Serialize nushell types that cannot be deserialized. + - `--spec {int}`: KDL language version (1 or 2 (default)). + - `--format {string}`: Data model: 'jik' (default) for JSON-in-KDL, or 'nodes' for KDL AST rows. + - `--serialize, -s`: Serialize nushell types that cannot be deserialized (shorthand for --non-roundtrip lossy). + - `--non-roundtrip {string}`: How to handle values that are non-roundtrippable ('error' (default), 'null', or 'lossy'). ## Input/output types: @@ -32,45 +35,143 @@ contributors: false | any | string | ## Examples -Convert yaml file to kdl file +Convert a record to JSON-in-KDL (default KDL v2 keywords). ```nu -> {this: that list: [1 2 3 {bool: true} {this: should be: a-block}]} | to yaml | from yaml | to kdl -this that -list 1 2 3 bool=#true { - this should - be a-block -} +> {a: 1, b: true} | to kdl +- a=1 b=#true ``` -Convert nu record to kdl +Emit KDL v2 explicitly with --spec 2. ```nu -> {one: [{one: two, 1: 2} {three: 3} [1 2 3] 4 5 6 {bool: true}] } | to kdl -one three=3 1 2 3 4 5 6 bool=#true { - one two - "1" 2 -} +> {a: 1, b: true} | to kdl --spec 2 +- a=1 b=#true ``` -Convert nu list to kdl string +Emit KDL v1 keywords with --spec 1 (bare true/false/null). +```nu +> {a: 1, b: true} | to kdl --spec 1 +- a=1 b=true + +``` + +Convert a list to JSON-in-KDL. ```nu > [1 2 3] | to kdl -root 1 2 3 +- 1 2 3 + +``` + +Emit null/bool keywords as KDL v2. +```nu +> [null false true] | to kdl --spec 2 +- #null #false #true ``` -Convert nu closure to kdl string +Emit null/bool keywords as KDL v1. ```nu -> {2: {|| 1 + 1} } | to kdl --serialize -"2" "{|| 1 + 1}" +> [null false true] | to kdl --spec 1 +- null false true ``` -Round-trip KDL through canonical node rows. +Round-trip KDL through node rows (default v2). ```nu > 'node one; node two' | from kdl | to kdl node one node two ``` + +Round-trip a KDL v1 document; metadata keeps --spec 1 on to kdl. +```nu +> "item 1 enabled=true" | from kdl --spec 1 | to kdl +item 1 enabled=true + +``` + +Round-trip a KDL v2 document with --spec 2 on both sides. +```nu +> "item 1 enabled=#true" | from kdl --spec 2 | to kdl --spec 2 +item 1 enabled=#true + +``` + +Override metadata: parse as v1 but emit as v2. +```nu +> "item 1 enabled=true" | from kdl --spec 1 | to kdl --spec 2 +item 1 enabled=#true + +``` + +Serialize a closure as a string. +```nu +> {|| 1 + 1} | to kdl --serialize +- "{|| 1 + 1}" + +``` + +Emit Nushell filesize and duration with type annotations. +```nu +> {size: 1kib, wait: 5sec} | to kdl +- size=(filesize)1024 wait=(duration)5000000000 + +``` + +Emit a datetime as a (timestamp) annotation (RFC 3339 string). +```nu +> {when: 2020-01-02T03:04:05+00:00} | to kdl +- when=(timestamp)"2020-01-02T03:04:05+00:00" + +``` + +Emit a cell-path with a (cell-path) annotation. +```nu +> $.1.abc | to kdl +- (cell-path)$.1.abc + +``` + +Emit a range with a (range) annotation. +```nu +> 1..3 | to kdl +- (range)"1..3" + +``` + +Emit a glob with a (glob) annotation. +```nu +> "*.rs" | into glob | to kdl +- (glob)*.rs + +``` + +Emit binary data as base64 with a (binary) annotation. +```nu +> 0x[01 02 03] | to kdl +- (binary)AQID + +``` + +Round-trip annotated Nushell types through KDL. +```nu +> {size: 1kib, wait: 5sec} | to kdl | from kdl --format jik +╭──────┬────────╮ +│ size │ 1.0 kB │ +│ wait │ 5sec │ +╰──────┴────────╯ +``` + +Round-trip a list of records (table-shaped data) as JSON-in-KDL. +```nu +> [{a: 1}, {a: 2}] | to kdl | from kdl --format jik +╭───┬───╮ +│ # │ a │ +├───┼───┤ +│ 0 │ 1 │ +│ 1 │ 2 │ +╰───┴───╯ + +``` diff --git a/commands/docs/to_md.md b/commands/docs/to_md.md index 3f1279163ed..e5022179433 100644 --- a/commands/docs/to_md.md +++ b/commands/docs/to_md.md @@ -2,7 +2,7 @@ title: to md categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert table into simple Markdown. usage: | diff --git a/commands/docs/to_msgpack.md b/commands/docs/to_msgpack.md index 248d22b9b26..a4ff1c34ad1 100644 --- a/commands/docs/to_msgpack.md +++ b/commands/docs/to_msgpack.md @@ -2,7 +2,7 @@ title: to msgpack categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert Nu values into MessagePack. usage: | diff --git a/commands/docs/to_msgpackz.md b/commands/docs/to_msgpackz.md index 35a75070f11..24d4869f6b7 100644 --- a/commands/docs/to_msgpackz.md +++ b/commands/docs/to_msgpackz.md @@ -2,7 +2,7 @@ title: to msgpackz categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert Nu values into brotli-compressed MessagePack. usage: | diff --git a/commands/docs/to_nuon.md b/commands/docs/to_nuon.md index cd02c7d9d89..4e8e268b134 100644 --- a/commands/docs/to_nuon.md +++ b/commands/docs/to_nuon.md @@ -2,7 +2,7 @@ title: to nuon categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Converts table data into Nuon (Nushell Object Notation) text. usage: | diff --git a/commands/docs/to_plist.md b/commands/docs/to_plist.md index ab8440b1a47..e09ef5c3129 100644 --- a/commands/docs/to_plist.md +++ b/commands/docs/to_plist.md @@ -2,7 +2,7 @@ title: to plist categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert Nu values into plist usage: | diff --git a/commands/docs/to_text.md b/commands/docs/to_text.md index 4c6ea09e820..dfb1db7a06e 100644 --- a/commands/docs/to_text.md +++ b/commands/docs/to_text.md @@ -2,7 +2,7 @@ title: to text categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert data into plain text format. usage: | diff --git a/commands/docs/to_toml.md b/commands/docs/to_toml.md index 1014c708d33..895e9b59fc6 100644 --- a/commands/docs/to_toml.md +++ b/commands/docs/to_toml.md @@ -2,7 +2,7 @@ title: to toml categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert record into .toml text. usage: | diff --git a/commands/docs/to_tsv.md b/commands/docs/to_tsv.md index 739a0dee2f5..345561a26a0 100644 --- a/commands/docs/to_tsv.md +++ b/commands/docs/to_tsv.md @@ -2,7 +2,7 @@ title: to tsv categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert table into .tsv text. usage: | diff --git a/commands/docs/to_txt.md b/commands/docs/to_txt.md new file mode 100644 index 00000000000..57d64658d02 --- /dev/null +++ b/commands/docs/to_txt.md @@ -0,0 +1,59 @@ +--- +title: to txt +categories: | + formats +version: 0.115.0 +formats: | + Convert data into plain text format. +usage: | + Convert data into plain text format. +editLink: false +contributors: false +--- + + +# `to txt` for [formats](/commands/categories/formats.md) + +
Convert data into plain text format.
+ +## Signature + +```> to txt {flags} ``` + +## Flags + + - `--no-newline, -n`: Do not append a newline to the end of the text. + - `--serialize, -s`: Serialize nushell types that cannot be deserialized. + + +## Input/output types: + +| input | output | +| ----- | ------ | +| any | string | +## Examples + +Outputs data as simple text with a trailing newline. +```nu +> [1] | to txt +1 + +``` + +Outputs data as simple text without a trailing newline. +```nu +> [1] | to txt --no-newline +1 +``` + +Outputs external data as simple text. +```nu +> git help -a | lines | find -r '^ ' | to txt + +``` + +Outputs records as simple text. +```nu +> ls | to txt + +``` diff --git a/commands/docs/to_xml.md b/commands/docs/to_xml.md index 9728d7e79c9..a056651869f 100644 --- a/commands/docs/to_xml.md +++ b/commands/docs/to_xml.md @@ -2,7 +2,7 @@ title: to xml categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert special record structure into .xml text. usage: | diff --git a/commands/docs/to_yaml.md b/commands/docs/to_yaml.md index cb0905a513b..18ae07d7cb0 100644 --- a/commands/docs/to_yaml.md +++ b/commands/docs/to_yaml.md @@ -2,7 +2,7 @@ title: to yaml categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert table into .yaml/.yml text. usage: | @@ -23,6 +23,13 @@ contributors: false ## Flags - `--serialize, -s`: Serialize nushell types that cannot be deserialized. + - `--non-roundtrip {string}`: How to handle values that are non-roundtrippable. + - `--spec {string}`: YAML spec version ('1.1' or '1.2' (default)). + - `--add-directives, -d`: Add YAML document directives. + - `--multiple, -m`: Given a list, serialize a multi document stream. + - `--indent, -i {int}`: Configure the indent. + - `--compact-list-indent`: Emit lists with a more compact indentation style. + - `--quote, -q {string}`: String quote style ('auto' (default), 'single' or 'double') ## Input/output types: @@ -35,7 +42,14 @@ contributors: false Outputs a YAML string representing the contents of this table. ```nu > [[foo bar]; ["1" "2"]] | to yaml -- foo: '1' - bar: '2' +- foo: "1" + bar: "2" + +``` + +Convert a nushell specific type into YAML. +```nu +> $.1.abc | to yaml +!cell-path $.1.abc ``` diff --git a/commands/docs/to_yml.md b/commands/docs/to_yml.md index ed6d3567e61..3601052c009 100644 --- a/commands/docs/to_yml.md +++ b/commands/docs/to_yml.md @@ -2,7 +2,7 @@ title: to yml categories: | formats -version: 0.114.0 +version: 0.115.0 formats: | Convert table into .yaml/.yml text. usage: | @@ -23,6 +23,13 @@ contributors: false ## Flags - `--serialize, -s`: Serialize nushell types that cannot be deserialized. + - `--non-roundtrip {string}`: How to handle values that are non-roundtrippable. + - `--spec {string}`: YAML spec version ('1.1' or '1.2' (default)). + - `--add-directives, -d`: Add YAML document directives. + - `--multiple, -m`: Given a list, serialize a multi document stream. + - `--indent, -i {int}`: Configure the indent. + - `--compact-list-indent`: Emit lists with a more compact indentation style. + - `--quote, -q {string}`: String quote style ('auto' (default), 'single' or 'double') ## Input/output types: @@ -35,7 +42,14 @@ contributors: false Outputs a YAML string representing the contents of this table. ```nu > [[foo bar]; ["1" "2"]] | to yml -- foo: '1' - bar: '2' +- foo: "1" + bar: "2" + +``` + +Convert a nushell specific type into YAML. +```nu +> $.1.abc | to yml +!cell-path $.1.abc ``` diff --git a/commands/docs/touch.md b/commands/docs/touch.md index 970c199c023..1710e7ecfc8 100644 --- a/commands/docs/touch.md +++ b/commands/docs/touch.md @@ -2,7 +2,7 @@ title: touch categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Creates one or more files. usage: | diff --git a/commands/docs/transpose.md b/commands/docs/transpose.md index 80decd1774a..a587061171d 100644 --- a/commands/docs/transpose.md +++ b/commands/docs/transpose.md @@ -2,7 +2,7 @@ title: transpose categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Transposes the table contents so rows become columns and columns become rows. usage: | diff --git a/commands/docs/try.md b/commands/docs/try.md index 23fcb2eba2d..e082f984ace 100644 --- a/commands/docs/try.md +++ b/commands/docs/try.md @@ -2,7 +2,7 @@ title: try categories: | core -version: 0.114.0 +version: 0.115.0 core: | Try to run a block, if it fails optionally run a catch closure. usage: | diff --git a/commands/docs/tutor.md b/commands/docs/tutor.md index bbe271215d1..bdf933e31e0 100644 --- a/commands/docs/tutor.md +++ b/commands/docs/tutor.md @@ -2,7 +2,7 @@ title: tutor categories: | misc -version: 0.114.0 +version: 0.115.0 misc: | Run the tutorial. To begin, run: tutor. usage: | diff --git a/commands/docs/ulimit.md b/commands/docs/ulimit.md index 52c531188f0..7edc062147f 100644 --- a/commands/docs/ulimit.md +++ b/commands/docs/ulimit.md @@ -2,7 +2,7 @@ title: ulimit categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Set or get resource usage limits. usage: | diff --git a/commands/docs/umask.md b/commands/docs/umask.md index b9bec08aab9..2bb1b754d10 100644 --- a/commands/docs/umask.md +++ b/commands/docs/umask.md @@ -2,7 +2,7 @@ title: umask categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Get or set default file creation permissions. usage: | diff --git a/commands/docs/uname.md b/commands/docs/uname.md index b4f82b392e6..4a521045455 100644 --- a/commands/docs/uname.md +++ b/commands/docs/uname.md @@ -2,7 +2,7 @@ title: uname categories: | system -version: 0.114.0 +version: 0.115.0 system: | Print certain system information using uutils/coreutils uname. usage: | @@ -23,9 +23,9 @@ contributors: false ## Input/output types: -| input | output | -| ------- | ------ | -| nothing | table | +| input | output | +| ------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| nothing | record<kernel-name: string, nodename: string, kernel-release: string, kernel-version: string, machine: string, operating-system: string> | ## Examples Print all information diff --git a/commands/docs/union.md b/commands/docs/union.md index f1ab3331654..1d21e6ba616 100644 --- a/commands/docs/union.md +++ b/commands/docs/union.md @@ -2,7 +2,7 @@ title: union categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Returns a list of unique elements from both the input and the provided list. usage: | diff --git a/commands/docs/uniq-by.md b/commands/docs/uniq-by.md index 159bae2f9e6..bf731db61c9 100644 --- a/commands/docs/uniq-by.md +++ b/commands/docs/uniq-by.md @@ -2,7 +2,7 @@ title: uniq-by categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Return the distinct values in the input by the given column(s). usage: | diff --git a/commands/docs/uniq.md b/commands/docs/uniq.md index c10fae57bf0..a70b774e01f 100644 --- a/commands/docs/uniq.md +++ b/commands/docs/uniq.md @@ -2,7 +2,7 @@ title: uniq categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Return the distinct values in the input. usage: | diff --git a/commands/docs/unlet.md b/commands/docs/unlet.md index 3c3574a4bfb..78e29ccc806 100644 --- a/commands/docs/unlet.md +++ b/commands/docs/unlet.md @@ -2,7 +2,7 @@ title: unlet categories: | experimental -version: 0.114.0 +version: 0.115.0 experimental: | Delete variables from nushell memory, making them unrecoverable. usage: | diff --git a/commands/docs/update.md b/commands/docs/update.md index 85a3b55a88c..aa335b26837 100644 --- a/commands/docs/update.md +++ b/commands/docs/update.md @@ -2,7 +2,7 @@ title: update categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Update an existing column to have a new value. usage: | @@ -33,6 +33,7 @@ contributors: false | record | record | | table | table | | list<any> | list<any> | +| matrix | matrix | ## Examples Update a column value. @@ -88,6 +89,12 @@ Use a closure to compute a new value at an index. ``` +Update a row in a matrix +```nu +> [[1 2] [3 4]] | into matrix | update 0 [5 6] | matrix into-nu | to nuon +[[5.0, 6.0], [3.0, 4.0]] +``` + ## Notes When updating a column, the closure will be run for each row, and the current row will be passed as the first argument. Referencing `$in` inside the closure will provide the value at the column for the current row. diff --git a/commands/docs/update_cells.md b/commands/docs/update_cells.md index 7c2a3a95a6f..37773397e2f 100644 --- a/commands/docs/update_cells.md +++ b/commands/docs/update_cells.md @@ -2,7 +2,7 @@ title: update cells categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Update the table cells. usage: | diff --git a/commands/docs/upsert.md b/commands/docs/upsert.md index 27132216bc3..6c7a01e6b00 100644 --- a/commands/docs/upsert.md +++ b/commands/docs/upsert.md @@ -2,7 +2,7 @@ title: upsert categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Update an existing column to have a new value, or insert a new column. usage: | diff --git a/commands/docs/url.md b/commands/docs/url.md index d503014cd78..d5dc670f367 100644 --- a/commands/docs/url.md +++ b/commands/docs/url.md @@ -2,7 +2,7 @@ title: url categories: | network -version: 0.114.0 +version: 0.115.0 network: | Various commands for working with URLs. usage: | diff --git a/commands/docs/url_build-query.md b/commands/docs/url_build-query.md index 00728e7302b..b2a5c6d4155 100644 --- a/commands/docs/url_build-query.md +++ b/commands/docs/url_build-query.md @@ -2,7 +2,7 @@ title: url build-query categories: | network -version: 0.114.0 +version: 0.115.0 network: | Converts record or table into query string applying percent-encoding. usage: | diff --git a/commands/docs/url_decode.md b/commands/docs/url_decode.md index f33e937d1ae..c0abd207851 100644 --- a/commands/docs/url_decode.md +++ b/commands/docs/url_decode.md @@ -2,7 +2,7 @@ title: url decode categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Converts a percent-encoded web safe string to a string. usage: | diff --git a/commands/docs/url_encode.md b/commands/docs/url_encode.md index 1be9c8c5df0..5f8f9c50796 100644 --- a/commands/docs/url_encode.md +++ b/commands/docs/url_encode.md @@ -2,7 +2,7 @@ title: url encode categories: | strings -version: 0.114.0 +version: 0.115.0 strings: | Converts a string to a percent encoded web safe string. usage: | diff --git a/commands/docs/url_join.md b/commands/docs/url_join.md index 4ba68200603..bed93b744ff 100644 --- a/commands/docs/url_join.md +++ b/commands/docs/url_join.md @@ -2,7 +2,7 @@ title: url join categories: | network -version: 0.114.0 +version: 0.115.0 network: | Convert a record to a URL string. usage: | diff --git a/commands/docs/url_parse.md b/commands/docs/url_parse.md index d1cbe850c44..ad29181a59d 100644 --- a/commands/docs/url_parse.md +++ b/commands/docs/url_parse.md @@ -2,7 +2,7 @@ title: url parse categories: | network -version: 0.114.0 +version: 0.115.0 network: | Parse a URL string into structured data. usage: | diff --git a/commands/docs/url_split-query.md b/commands/docs/url_split-query.md index 510ab929f29..21ba86e430e 100644 --- a/commands/docs/url_split-query.md +++ b/commands/docs/url_split-query.md @@ -2,7 +2,7 @@ title: url split-query categories: | network -version: 0.114.0 +version: 0.115.0 network: | Converts query string into table applying percent-decoding. usage: | diff --git a/commands/docs/use.md b/commands/docs/use.md index 72087475693..a233bb33cc9 100644 --- a/commands/docs/use.md +++ b/commands/docs/use.md @@ -2,7 +2,7 @@ title: use categories: | core -version: 0.114.0 +version: 0.115.0 core: | Use definitions from a module, making them available in your shell. usage: | diff --git a/commands/docs/values.md b/commands/docs/values.md index 94de84cd5bf..e9b2489bb09 100644 --- a/commands/docs/values.md +++ b/commands/docs/values.md @@ -2,7 +2,7 @@ title: values categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Given a record or table, produce a list of its columns' values. usage: | diff --git a/commands/docs/version.md b/commands/docs/version.md index add1abb1890..e414429af38 100644 --- a/commands/docs/version.md +++ b/commands/docs/version.md @@ -2,7 +2,7 @@ title: version categories: | core -version: 0.114.0 +version: 0.115.0 core: | Display Nu version, and its build configuration. usage: | diff --git a/commands/docs/version_check.md b/commands/docs/version_check.md index 370f13048ad..928ff6d8e38 100644 --- a/commands/docs/version_check.md +++ b/commands/docs/version_check.md @@ -2,7 +2,7 @@ title: version check categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Checks to see if you have the latest version of nushell. usage: | diff --git a/commands/docs/view.md b/commands/docs/view.md index 9fb1674abb2..7f6f70c7c47 100644 --- a/commands/docs/view.md +++ b/commands/docs/view.md @@ -2,7 +2,7 @@ title: view categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | Various commands for viewing debug information. usage: | diff --git a/commands/docs/view_blocks.md b/commands/docs/view_blocks.md index bfb1cb073f9..c3e17d5c228 100644 --- a/commands/docs/view_blocks.md +++ b/commands/docs/view_blocks.md @@ -2,7 +2,7 @@ title: view blocks categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | View the blocks registered in nushell's EngineState memory. usage: | diff --git a/commands/docs/view_files.md b/commands/docs/view_files.md index e8684b4d709..7716938591e 100644 --- a/commands/docs/view_files.md +++ b/commands/docs/view_files.md @@ -2,7 +2,7 @@ title: view files categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | View the files registered in nushell's EngineState memory. usage: | diff --git a/commands/docs/view_ir.md b/commands/docs/view_ir.md index 024a714d670..0ee4ed0c49c 100644 --- a/commands/docs/view_ir.md +++ b/commands/docs/view_ir.md @@ -2,7 +2,7 @@ title: view ir categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | View the compiled IR code for a block of code. usage: | diff --git a/commands/docs/view_source.md b/commands/docs/view_source.md index 79dc2643bc5..8e0b74230c0 100644 --- a/commands/docs/view_source.md +++ b/commands/docs/view_source.md @@ -2,7 +2,7 @@ title: view source categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | View a block, module, or a definition. usage: | diff --git a/commands/docs/view_span.md b/commands/docs/view_span.md index 9bed7c60892..7ba828792ed 100644 --- a/commands/docs/view_span.md +++ b/commands/docs/view_span.md @@ -2,7 +2,7 @@ title: view span categories: | debug -version: 0.114.0 +version: 0.115.0 debug: | View the contents of a span. usage: | diff --git a/commands/docs/watch.md b/commands/docs/watch.md index 1e1074305d8..9fb41b30239 100644 --- a/commands/docs/watch.md +++ b/commands/docs/watch.md @@ -2,7 +2,7 @@ title: watch categories: | filesystem -version: 0.114.0 +version: 0.115.0 filesystem: | Watch for file changes and execute Nu code when they happen. usage: | diff --git a/commands/docs/where.md b/commands/docs/where.md index b6c331afc09..93e655e53ef 100644 --- a/commands/docs/where.md +++ b/commands/docs/where.md @@ -2,7 +2,7 @@ title: where categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Filter values of an input list based on a condition. usage: | diff --git a/commands/docs/which.md b/commands/docs/which.md index ba6f0764325..d12b6d508d9 100644 --- a/commands/docs/which.md +++ b/commands/docs/which.md @@ -2,7 +2,7 @@ title: which categories: | system -version: 0.114.0 +version: 0.115.0 system: | Finds a program file, alias or custom command. If `application` is not provided, all deduplicated commands will be returned. usage: | diff --git a/commands/docs/while.md b/commands/docs/while.md index 765b3eaf567..fb91ff72eab 100644 --- a/commands/docs/while.md +++ b/commands/docs/while.md @@ -2,7 +2,7 @@ title: while categories: | core -version: 0.114.0 +version: 0.115.0 core: | Conditionally run a block in a loop. usage: | diff --git a/commands/docs/whoami.md b/commands/docs/whoami.md index 3c70bc27f97..81264522b9c 100644 --- a/commands/docs/whoami.md +++ b/commands/docs/whoami.md @@ -2,7 +2,7 @@ title: whoami categories: | platform -version: 0.114.0 +version: 0.115.0 platform: | Get the current username using uutils/coreutils whoami. usage: | diff --git a/commands/docs/window.md b/commands/docs/window.md index e5466880db9..37e929b82fa 100644 --- a/commands/docs/window.md +++ b/commands/docs/window.md @@ -2,7 +2,7 @@ title: window categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Creates a sliding window of `window_size` that slide by n rows/elements across input. usage: | diff --git a/commands/docs/with-env.md b/commands/docs/with-env.md index 5ff0cf179d0..b35c5bd0fd2 100644 --- a/commands/docs/with-env.md +++ b/commands/docs/with-env.md @@ -2,7 +2,7 @@ title: with-env categories: | env -version: 0.114.0 +version: 0.115.0 env: | Runs a block with an environment variable set. usage: | diff --git a/commands/docs/wrap.md b/commands/docs/wrap.md index 6a7bdc956bd..d2843686909 100644 --- a/commands/docs/wrap.md +++ b/commands/docs/wrap.md @@ -2,7 +2,7 @@ title: wrap categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Wrap the value into a column. usage: | diff --git a/commands/docs/zip.md b/commands/docs/zip.md index 9bf8856cf46..87daa86cfc2 100644 --- a/commands/docs/zip.md +++ b/commands/docs/zip.md @@ -2,7 +2,7 @@ title: zip categories: | filters -version: 0.114.0 +version: 0.115.0 filters: | Combine a stream with the input. usage: |