From 4cddb0cd741683773347161b9a4a3a2b3c704db3 Mon Sep 17 00:00:00 2001 From: hustcer Date: Tue, 10 Jun 2025 23:12:09 +0800 Subject: [PATCH 1/2] Refresh Nu command docs for v0.105.0 --- commands/docs/alias.md | 2 +- commands/docs/all.md | 4 +- commands/docs/ansi.md | 2 +- commands/docs/ansi_gradient.md | 6 +- commands/docs/ansi_link.md | 6 +- commands/docs/ansi_strip.md | 6 +- commands/docs/any.md | 4 +- commands/docs/append.md | 4 +- commands/docs/ast.md | 4 +- commands/docs/attr_category.md | 4 +- commands/docs/attr_deprecated.md | 63 +++++ commands/docs/attr_example.md | 4 +- commands/docs/attr_search-terms.md | 4 +- commands/docs/banner.md | 9 +- commands/docs/bits.md | 2 +- commands/docs/bits_and.md | 8 +- commands/docs/bits_not.md | 8 +- commands/docs/bits_or.md | 8 +- commands/docs/bits_rol.md | 8 +- commands/docs/bits_ror.md | 8 +- commands/docs/bits_shl.md | 8 +- commands/docs/bits_shr.md | 8 +- commands/docs/bits_xor.md | 8 +- commands/docs/break.md | 2 +- commands/docs/bytes.md | 2 +- commands/docs/bytes_add.md | 6 +- commands/docs/bytes_at.md | 6 +- commands/docs/bytes_build.md | 2 +- commands/docs/bytes_collect.md | 4 +- commands/docs/bytes_ends-with.md | 4 +- commands/docs/bytes_index-of.md | 4 +- commands/docs/bytes_length.md | 6 +- commands/docs/bytes_remove.md | 4 +- commands/docs/bytes_replace.md | 4 +- commands/docs/bytes_reverse.md | 4 +- commands/docs/bytes_split.md | 4 +- commands/docs/bytes_starts-with.md | 4 +- commands/docs/cal.md | 3 +- commands/docs/cd.md | 2 +- commands/docs/char.md | 2 +- commands/docs/chunk-by.md | 6 +- commands/docs/chunks.md | 8 +- commands/docs/clear.md | 2 +- commands/docs/collect.md | 2 +- commands/docs/columns.md | 6 +- commands/docs/commandline.md | 2 +- commands/docs/commandline_edit.md | 2 +- commands/docs/commandline_get-cursor.md | 2 +- commands/docs/commandline_set-cursor.md | 2 +- commands/docs/compact.md | 4 +- commands/docs/complete.md | 2 +- commands/docs/config.md | 2 +- commands/docs/config_env.md | 2 +- commands/docs/config_flatten.md | 2 +- commands/docs/config_nu.md | 2 +- commands/docs/config_reset.md | 2 +- commands/docs/config_use-colors.md | 2 +- commands/docs/const.md | 2 +- commands/docs/continue.md | 2 +- commands/docs/cp.md | 2 +- commands/docs/date.md | 2 +- commands/docs/date_format.md | 2 +- commands/docs/date_from-human.md | 4 +- commands/docs/date_humanize.md | 2 +- commands/docs/date_list-timezone.md | 2 +- commands/docs/date_now.md | 2 +- commands/docs/date_to-timezone.md | 2 +- commands/docs/debug.md | 13 +- commands/docs/debug_env.md | 41 ++++ commands/docs/debug_info.md | 2 +- commands/docs/debug_profile.md | 2 +- commands/docs/decode.md | 2 +- commands/docs/decode_base32.md | 2 +- commands/docs/decode_base32hex.md | 2 +- commands/docs/decode_base64.md | 2 +- commands/docs/decode_hex.md | 2 +- commands/docs/def.md | 2 +- commands/docs/default.md | 24 +- commands/docs/describe.md | 4 +- commands/docs/detect_columns.md | 2 +- commands/docs/do.md | 2 +- commands/docs/drop.md | 4 +- commands/docs/drop_column.md | 4 +- commands/docs/drop_nth.md | 6 +- commands/docs/du.md | 2 +- commands/docs/each.md | 6 +- commands/docs/each_while.md | 4 +- commands/docs/echo.md | 2 +- commands/docs/encode.md | 2 +- commands/docs/encode_base32.md | 4 +- commands/docs/encode_base32hex.md | 4 +- commands/docs/encode_base64.md | 4 +- commands/docs/encode_hex.md | 4 +- commands/docs/enumerate.md | 2 +- commands/docs/error_make.md | 4 +- commands/docs/every.md | 4 +- commands/docs/exec.md | 2 +- commands/docs/exit.md | 2 +- commands/docs/explain.md | 2 +- commands/docs/explore.md | 2 +- commands/docs/export-env.md | 2 +- commands/docs/export.md | 2 +- commands/docs/export_alias.md | 2 +- commands/docs/export_const.md | 2 +- commands/docs/export_def.md | 2 +- commands/docs/export_extern.md | 2 +- commands/docs/export_module.md | 2 +- commands/docs/export_use.md | 2 +- commands/docs/extern.md | 2 +- commands/docs/fill.md | 16 +- commands/docs/filter.md | 10 +- commands/docs/find.md | 6 +- commands/docs/first.md | 4 +- commands/docs/flatten.md | 4 +- commands/docs/for.md | 2 +- commands/docs/format.md | 2 +- commands/docs/format_bits.md | 10 +- commands/docs/format_date.md | 6 +- commands/docs/format_duration.md | 4 +- commands/docs/format_filesize.md | 4 +- commands/docs/format_number.md | 2 +- commands/docs/format_pattern.md | 4 +- commands/docs/from.md | 2 +- commands/docs/from_csv.md | 2 +- commands/docs/from_eml.md | 2 +- commands/docs/from_ics.md | 2 +- commands/docs/from_ini.md | 2 +- commands/docs/from_json.md | 2 +- commands/docs/from_msgpack.md | 4 +- commands/docs/from_msgpackz.md | 2 +- commands/docs/from_nuon.md | 14 +- commands/docs/from_ods.md | 2 +- commands/docs/from_plist.md | 8 +- commands/docs/from_ssv.md | 2 +- commands/docs/from_toml.md | 2 +- commands/docs/from_tsv.md | 2 +- commands/docs/from_url.md | 2 +- commands/docs/from_vcf.md | 2 +- commands/docs/from_xlsx.md | 2 +- commands/docs/from_xml.md | 2 +- commands/docs/from_yaml.md | 2 +- commands/docs/from_yml.md | 2 +- commands/docs/generate.md | 10 +- commands/docs/get.md | 14 +- commands/docs/glob.md | 4 +- commands/docs/grid.md | 4 +- commands/docs/group-by.md | 4 +- commands/docs/gstat.md | 13 +- commands/docs/hash.md | 2 +- commands/docs/hash_md5.md | 6 +- commands/docs/hash_sha256.md | 6 +- commands/docs/headers.md | 2 +- commands/docs/help.md | 2 +- commands/docs/help_aliases.md | 2 +- commands/docs/help_commands.md | 2 +- commands/docs/help_escapes.md | 2 +- commands/docs/help_externs.md | 2 +- commands/docs/help_modules.md | 2 +- commands/docs/help_operators.md | 2 +- commands/docs/help_pipe-and-redirect.md | 2 +- commands/docs/hide-env.md | 2 +- commands/docs/hide.md | 2 +- commands/docs/histogram.md | 4 +- commands/docs/history.md | 2 +- commands/docs/history_import.md | 6 +- commands/docs/history_session.md | 2 +- commands/docs/http.md | 2 +- commands/docs/http_delete.md | 12 +- commands/docs/http_get.md | 8 +- commands/docs/http_head.md | 12 +- commands/docs/http_options.md | 8 +- commands/docs/http_patch.md | 12 +- commands/docs/http_post.md | 12 +- commands/docs/http_put.md | 12 +- commands/docs/if.md | 2 +- commands/docs/ignore.md | 2 +- commands/docs/inc.md | 9 +- commands/docs/input.md | 24 +- commands/docs/input_list.md | 4 +- commands/docs/input_listen.md | 4 +- commands/docs/insert.md | 4 +- commands/docs/inspect.md | 2 +- commands/docs/interleave.md | 6 +- commands/docs/into.md | 2 +- commands/docs/into_binary.md | 10 +- commands/docs/into_bool.md | 10 +- commands/docs/into_cell-path.md | 18 +- commands/docs/into_datetime.md | 14 +- commands/docs/into_duration.md | 10 +- commands/docs/into_filesize.md | 16 +- commands/docs/into_float.md | 10 +- commands/docs/into_glob.md | 6 +- commands/docs/into_int.md | 24 +- commands/docs/into_record.md | 4 +- commands/docs/into_sqlite.md | 4 +- commands/docs/into_string.md | 16 +- commands/docs/into_value.md | 2 +- commands/docs/is-admin.md | 2 +- commands/docs/is-empty.md | 2 +- commands/docs/is-not-empty.md | 2 +- commands/docs/is-terminal.md | 2 +- commands/docs/items.md | 2 +- commands/docs/job.md | 2 +- commands/docs/job_flush.md | 2 +- commands/docs/job_id.md | 2 +- commands/docs/job_kill.md | 2 +- commands/docs/job_list.md | 2 +- commands/docs/job_recv.md | 4 +- commands/docs/job_send.md | 2 +- commands/docs/job_spawn.md | 2 +- commands/docs/job_tag.md | 2 +- commands/docs/job_unfreeze.md | 2 +- commands/docs/join.md | 2 +- commands/docs/keybindings.md | 2 +- commands/docs/keybindings_default.md | 2 +- commands/docs/keybindings_list.md | 2 +- commands/docs/keybindings_listen.md | 2 +- commands/docs/kill.md | 2 +- commands/docs/last.md | 4 +- commands/docs/length.md | 4 +- commands/docs/let-env.md | 2 +- commands/docs/let.md | 2 +- commands/docs/lines.md | 4 +- commands/docs/load-env.md | 6 +- commands/docs/loop.md | 2 +- commands/docs/ls.md | 2 +- commands/docs/match.md | 14 +- commands/docs/math.md | 2 +- commands/docs/math_abs.md | 10 +- commands/docs/math_arccos.md | 4 +- commands/docs/math_arccosh.md | 4 +- commands/docs/math_arcsin.md | 4 +- commands/docs/math_arcsinh.md | 4 +- commands/docs/math_arctan.md | 4 +- commands/docs/math_arctanh.md | 4 +- commands/docs/math_avg.md | 10 +- commands/docs/math_ceil.md | 6 +- commands/docs/math_cos.md | 4 +- commands/docs/math_cosh.md | 4 +- commands/docs/math_exp.md | 4 +- commands/docs/math_floor.md | 6 +- commands/docs/math_ln.md | 4 +- commands/docs/math_log.md | 6 +- commands/docs/math_max.md | 12 +- commands/docs/math_median.md | 10 +- commands/docs/math_min.md | 12 +- commands/docs/math_mode.md | 8 +- commands/docs/math_product.md | 6 +- commands/docs/math_round.md | 6 +- commands/docs/math_sin.md | 4 +- commands/docs/math_sinh.md | 4 +- commands/docs/math_sqrt.md | 6 +- commands/docs/math_stddev.md | 6 +- commands/docs/math_sum.md | 10 +- commands/docs/math_tan.md | 4 +- commands/docs/math_tanh.md | 4 +- commands/docs/math_variance.md | 6 +- commands/docs/merge.md | 2 +- commands/docs/merge_deep.md | 2 +- commands/docs/metadata.md | 2 +- commands/docs/metadata_access.md | 2 +- commands/docs/metadata_set.md | 2 +- commands/docs/mkdir.md | 2 +- commands/docs/mktemp.md | 2 +- commands/docs/module.md | 2 +- commands/docs/move.md | 2 +- commands/docs/mut.md | 2 +- commands/docs/mv.md | 2 +- commands/docs/nu-check.md | 6 +- commands/docs/nu-highlight.md | 2 +- commands/docs/open.md | 15 +- commands/docs/overlay.md | 2 +- commands/docs/overlay_hide.md | 2 +- commands/docs/overlay_list.md | 4 +- commands/docs/overlay_new.md | 6 +- commands/docs/overlay_use.md | 2 +- commands/docs/panic.md | 2 +- commands/docs/par-each.md | 6 +- commands/docs/parse.md | 15 +- commands/docs/path.md | 2 +- commands/docs/path_basename.md | 4 +- commands/docs/path_dirname.md | 4 +- commands/docs/path_exists.md | 4 +- commands/docs/path_expand.md | 4 +- commands/docs/path_join.md | 8 +- commands/docs/path_parse.md | 4 +- commands/docs/path_relative-to.md | 4 +- commands/docs/path_self.md | 2 +- commands/docs/path_split.md | 6 +- commands/docs/path_type.md | 4 +- commands/docs/plugin.md | 2 +- commands/docs/plugin_add.md | 2 +- commands/docs/plugin_list.md | 6 +- commands/docs/plugin_rm.md | 2 +- commands/docs/plugin_stop.md | 2 +- commands/docs/plugin_use.md | 2 +- commands/docs/polars.md | 262 +++++++++++---------- commands/docs/polars_agg-groups.md | 8 +- commands/docs/polars_agg.md | 8 +- commands/docs/polars_all-false.md | 8 +- commands/docs/polars_all-true.md | 8 +- commands/docs/polars_append.md | 8 +- commands/docs/polars_arg-max.md | 8 +- commands/docs/polars_arg-min.md | 8 +- commands/docs/polars_arg-sort.md | 8 +- commands/docs/polars_arg-true.md | 8 +- commands/docs/polars_arg-unique.md | 8 +- commands/docs/polars_arg-where.md | 8 +- commands/docs/polars_as-date.md | 9 +- commands/docs/polars_as-datetime.md | 19 +- commands/docs/polars_as.md | 8 +- commands/docs/polars_cache.md | 8 +- commands/docs/polars_cast.md | 9 +- commands/docs/polars_col.md | 22 +- commands/docs/polars_collect.md | 8 +- commands/docs/polars_columns.md | 8 +- commands/docs/polars_concat-str.md | 8 +- commands/docs/polars_concat.md | 8 +- commands/docs/polars_contains.md | 9 +- commands/docs/polars_convert-time-zone.md | 32 +-- commands/docs/polars_count-null.md | 8 +- commands/docs/polars_count.md | 8 +- commands/docs/polars_cumulative.md | 9 +- commands/docs/polars_cut.md | 8 +- commands/docs/polars_datepart.md | 41 ++-- commands/docs/polars_decimal.md | 8 +- commands/docs/polars_drop-duplicates.md | 8 +- commands/docs/polars_drop-nulls.md | 8 +- commands/docs/polars_drop.md | 8 +- commands/docs/polars_dummies.md | 8 +- commands/docs/polars_explode.md | 9 +- commands/docs/polars_expr-not.md | 8 +- commands/docs/polars_fetch.md | 8 +- commands/docs/polars_fill-nan.md | 8 +- commands/docs/polars_fill-null.md | 8 +- commands/docs/polars_filter-with.md | 8 +- commands/docs/polars_filter.md | 39 ++- commands/docs/polars_first.md | 22 +- commands/docs/polars_flatten.md | 9 +- commands/docs/polars_get-day.md | 9 +- commands/docs/polars_get-hour.md | 9 +- commands/docs/polars_get-minute.md | 9 +- commands/docs/polars_get-month.md | 9 +- commands/docs/polars_get-nanosecond.md | 9 +- commands/docs/polars_get-ordinal.md | 9 +- commands/docs/polars_get-second.md | 9 +- commands/docs/polars_get-week.md | 9 +- commands/docs/polars_get-weekday.md | 9 +- commands/docs/polars_get-year.md | 9 +- commands/docs/polars_get.md | 8 +- commands/docs/polars_group-by.md | 12 +- commands/docs/polars_horizontal.md | 81 +++++++ commands/docs/polars_implode.md | 8 +- commands/docs/polars_integer.md | 8 +- commands/docs/polars_into-df.md | 8 +- commands/docs/polars_into-dtype.md | 8 +- commands/docs/polars_into-lazy.md | 8 +- commands/docs/polars_into-nu.md | 11 +- commands/docs/polars_into-repr.md | 8 +- commands/docs/polars_into-schema.md | 4 +- commands/docs/polars_is-duplicated.md | 8 +- commands/docs/polars_is-in.md | 26 +- commands/docs/polars_is-not-null.md | 9 +- commands/docs/polars_is-null.md | 9 +- commands/docs/polars_is-unique.md | 8 +- commands/docs/polars_join-where.md | 8 +- commands/docs/polars_join.md | 8 +- commands/docs/polars_last.md | 9 +- commands/docs/polars_len.md | 8 +- commands/docs/polars_list-contains.md | 8 +- commands/docs/polars_lit.md | 8 +- commands/docs/polars_lowercase.md | 9 +- commands/docs/polars_math.md | 111 +++++++++ commands/docs/polars_max.md | 9 +- commands/docs/polars_mean.md | 9 +- commands/docs/polars_median.md | 9 +- commands/docs/polars_min.md | 9 +- commands/docs/polars_n-unique.md | 9 +- commands/docs/polars_not.md | 8 +- commands/docs/polars_open.md | 8 +- commands/docs/polars_otherwise.md | 8 +- commands/docs/polars_over.md | 8 +- commands/docs/polars_pivot.md | 20 +- commands/docs/polars_profile.md | 8 +- commands/docs/polars_qcut.md | 8 +- commands/docs/polars_quantile.md | 9 +- commands/docs/polars_query.md | 8 +- commands/docs/polars_rename.md | 8 +- commands/docs/polars_replace-time-zone.md | 24 +- commands/docs/polars_replace.md | 137 ++++++++--- commands/docs/polars_reverse.md | 8 +- commands/docs/polars_rolling.md | 8 +- commands/docs/polars_sample.md | 8 +- commands/docs/polars_save.md | 2 +- commands/docs/polars_schema.md | 8 +- commands/docs/polars_select.md | 8 +- commands/docs/polars_set-with-idx.md | 8 +- commands/docs/polars_set.md | 8 +- commands/docs/polars_shape.md | 8 +- commands/docs/polars_shift.md | 27 ++- commands/docs/polars_slice.md | 8 +- commands/docs/polars_sort-by.md | 8 +- commands/docs/polars_std.md | 9 +- commands/docs/polars_store-get.md | 9 +- commands/docs/polars_store-ls.md | 8 +- commands/docs/polars_store-rm.md | 4 +- commands/docs/polars_str-join.md | 9 +- commands/docs/polars_str-lengths.md | 9 +- commands/docs/polars_str-replace-all.md | 68 ++++++ commands/docs/polars_str-replace.md | 67 ++++++ commands/docs/polars_str-slice.md | 9 +- commands/docs/polars_str-split.md | 8 +- commands/docs/polars_str-strip-chars.md | 8 +- commands/docs/polars_strftime.md | 9 +- commands/docs/polars_struct-json-encode.md | 52 ++++ commands/docs/polars_sum.md | 9 +- commands/docs/polars_summary.md | 8 +- commands/docs/polars_take.md | 8 +- commands/docs/polars_truncate.md | 16 +- commands/docs/polars_unique.md | 37 ++- commands/docs/polars_unnest.md | 8 +- commands/docs/polars_unpivot.md | 8 +- commands/docs/polars_uppercase.md | 9 +- commands/docs/polars_value-counts.md | 8 +- commands/docs/polars_var.md | 9 +- commands/docs/polars_when.md | 11 +- commands/docs/polars_with-column.md | 28 ++- commands/docs/port.md | 2 +- commands/docs/prepend.md | 4 +- commands/docs/print.md | 4 +- commands/docs/ps.md | 2 +- commands/docs/pwd.md | 9 +- commands/docs/query.md | 8 +- commands/docs/query_db.md | 2 +- commands/docs/query_json.md | 8 +- commands/docs/query_web.md | 8 +- commands/docs/query_webpage-info.md | 2 +- commands/docs/query_xml.md | 9 +- commands/docs/random.md | 2 +- commands/docs/random_binary.md | 2 +- commands/docs/random_bool.md | 2 +- commands/docs/random_chars.md | 4 +- commands/docs/random_dice.md | 4 +- commands/docs/random_float.md | 2 +- commands/docs/random_int.md | 2 +- commands/docs/random_uuid.md | 2 +- commands/docs/reduce.md | 6 +- commands/docs/reject.md | 4 +- commands/docs/rename.md | 2 +- commands/docs/return.md | 2 +- commands/docs/reverse.md | 4 +- commands/docs/rm.md | 2 +- commands/docs/roll.md | 2 +- commands/docs/roll_down.md | 2 +- commands/docs/roll_left.md | 2 +- commands/docs/roll_right.md | 2 +- commands/docs/roll_up.md | 2 +- commands/docs/rotate.md | 6 +- commands/docs/run-external.md | 2 +- commands/docs/save.md | 13 +- commands/docs/schema.md | 2 +- commands/docs/scope.md | 2 +- commands/docs/scope_aliases.md | 2 +- commands/docs/scope_commands.md | 4 +- commands/docs/scope_engine-stats.md | 2 +- commands/docs/scope_externs.md | 2 +- commands/docs/scope_modules.md | 2 +- commands/docs/scope_variables.md | 2 +- commands/docs/select.md | 4 +- commands/docs/seq.md | 4 +- commands/docs/seq_char.md | 4 +- commands/docs/seq_date.md | 6 +- commands/docs/shuffle.md | 4 +- commands/docs/skip.md | 6 +- commands/docs/skip_until.md | 4 +- commands/docs/skip_while.md | 4 +- commands/docs/sleep.md | 2 +- commands/docs/slice.md | 4 +- commands/docs/sort-by.md | 4 +- commands/docs/sort.md | 4 +- commands/docs/source-env.md | 2 +- commands/docs/source.md | 2 +- commands/docs/split.md | 2 +- commands/docs/split_cell-path.md | 41 ++-- commands/docs/split_chars.md | 6 +- commands/docs/split_column.md | 4 +- commands/docs/split_list.md | 4 +- commands/docs/split_row.md | 6 +- commands/docs/split_words.md | 6 +- commands/docs/start.md | 2 +- commands/docs/stor.md | 2 +- commands/docs/stor_create.md | 2 +- commands/docs/stor_delete.md | 2 +- commands/docs/stor_export.md | 2 +- commands/docs/stor_import.md | 2 +- commands/docs/stor_insert.md | 4 +- commands/docs/stor_open.md | 8 +- commands/docs/stor_reset.md | 2 +- commands/docs/stor_update.md | 4 +- commands/docs/str.md | 2 +- commands/docs/str_camel-case.md | 6 +- commands/docs/str_capitalize.md | 6 +- commands/docs/str_contains.md | 6 +- commands/docs/str_distance.md | 4 +- commands/docs/str_downcase.md | 6 +- commands/docs/str_ends-with.md | 6 +- commands/docs/str_expand.md | 6 +- commands/docs/str_index-of.md | 6 +- commands/docs/str_join.md | 4 +- commands/docs/str_kebab-case.md | 6 +- commands/docs/str_length.md | 6 +- commands/docs/str_pascal-case.md | 6 +- commands/docs/str_replace.md | 6 +- commands/docs/str_reverse.md | 6 +- commands/docs/str_screaming-snake-case.md | 6 +- commands/docs/str_snake-case.md | 6 +- commands/docs/str_starts-with.md | 6 +- commands/docs/str_stats.md | 2 +- commands/docs/str_substring.md | 6 +- commands/docs/str_title-case.md | 6 +- commands/docs/str_trim.md | 6 +- commands/docs/str_upcase.md | 6 +- commands/docs/sys.md | 2 +- commands/docs/sys_cpu.md | 2 +- commands/docs/sys_disks.md | 2 +- commands/docs/sys_host.md | 2 +- commands/docs/sys_mem.md | 2 +- commands/docs/sys_net.md | 2 +- commands/docs/sys_temp.md | 2 +- commands/docs/sys_users.md | 2 +- commands/docs/table.md | 14 +- commands/docs/take.md | 8 +- commands/docs/take_until.md | 4 +- commands/docs/take_while.md | 4 +- commands/docs/tee.md | 2 +- commands/docs/term.md | 2 +- commands/docs/term_query.md | 6 +- commands/docs/term_size.md | 4 +- commands/docs/timeit.md | 2 +- commands/docs/to.md | 2 +- commands/docs/to_csv.md | 2 +- commands/docs/to_html.md | 6 +- commands/docs/to_json.md | 2 +- commands/docs/to_md.md | 12 +- commands/docs/to_msgpack.md | 2 +- commands/docs/to_msgpackz.md | 2 +- commands/docs/to_nuon.md | 12 +- commands/docs/to_plist.md | 8 +- commands/docs/to_text.md | 2 +- commands/docs/to_toml.md | 2 +- commands/docs/to_tsv.md | 2 +- commands/docs/to_xml.md | 2 +- commands/docs/to_yaml.md | 2 +- commands/docs/to_yml.md | 2 +- commands/docs/touch.md | 2 +- commands/docs/transpose.md | 4 +- commands/docs/try.md | 2 +- commands/docs/tutor.md | 2 +- commands/docs/ulimit.md | 2 +- commands/docs/uname.md | 2 +- commands/docs/uniq-by.md | 4 +- commands/docs/uniq.md | 4 +- commands/docs/update.md | 4 +- commands/docs/update_cells.md | 2 +- commands/docs/upsert.md | 4 +- commands/docs/url.md | 2 +- commands/docs/url_build-query.md | 4 +- commands/docs/url_decode.md | 6 +- commands/docs/url_encode.md | 6 +- commands/docs/url_join.md | 2 +- commands/docs/url_parse.md | 4 +- commands/docs/url_split-query.md | 4 +- commands/docs/use.md | 2 +- commands/docs/values.md | 6 +- commands/docs/version.md | 2 +- commands/docs/version_check.md | 2 +- commands/docs/view.md | 2 +- commands/docs/view_blocks.md | 4 +- commands/docs/view_files.md | 4 +- commands/docs/view_ir.md | 2 +- commands/docs/view_source.md | 2 +- commands/docs/view_span.md | 2 +- commands/docs/watch.md | 2 +- commands/docs/where.md | 92 ++++++-- commands/docs/which.md | 7 +- commands/docs/while.md | 2 +- commands/docs/whoami.md | 2 +- commands/docs/window.md | 4 +- commands/docs/with-env.md | 2 +- commands/docs/wrap.md | 6 +- commands/docs/zip.md | 6 +- 591 files changed, 2536 insertions(+), 1702 deletions(-) create mode 100644 commands/docs/attr_deprecated.md create mode 100644 commands/docs/debug_env.md create mode 100644 commands/docs/polars_horizontal.md create mode 100644 commands/docs/polars_math.md create mode 100644 commands/docs/polars_str-replace-all.md create mode 100644 commands/docs/polars_str-replace.md create mode 100644 commands/docs/polars_struct-json-encode.md diff --git a/commands/docs/alias.md b/commands/docs/alias.md index fc429973427..269ed3fed22 100644 --- a/commands/docs/alias.md +++ b/commands/docs/alias.md @@ -2,7 +2,7 @@ title: alias categories: | core -version: 0.104.0 +version: 0.105.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 e2179942981..8af9239d7e2 100644 --- a/commands/docs/all.md +++ b/commands/docs/all.md @@ -2,7 +2,7 @@ title: all categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Test if every element of the input fulfills a predicate expression. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | --------- | ------ | -| list\ | bool | +| list<any> | bool | ## Examples Check if a list contains only true values diff --git a/commands/docs/ansi.md b/commands/docs/ansi.md index b6ecb14cf31..a10c53253c5 100644 --- a/commands/docs/ansi.md +++ b/commands/docs/ansi.md @@ -2,7 +2,7 @@ title: ansi categories: | platform -version: 0.104.0 +version: 0.105.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 f77045575a4..43b9ce3e700 100644 --- a/commands/docs/ansi_gradient.md +++ b/commands/docs/ansi_gradient.md @@ -2,7 +2,7 @@ title: ansi gradient categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Add a color gradient (using ANSI color codes) to the given string. usage: | @@ -36,10 +36,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples draw text in a gradient with foreground start and end colors diff --git a/commands/docs/ansi_link.md b/commands/docs/ansi_link.md index 871ad374857..988e63e16e4 100644 --- a/commands/docs/ansi_link.md +++ b/commands/docs/ansi_link.md @@ -2,7 +2,7 @@ title: ansi link categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Add a link (using OSC 8 escape sequence) to the given string. usage: | @@ -34,10 +34,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples Create a link to open some file diff --git a/commands/docs/ansi_strip.md b/commands/docs/ansi_strip.md index e65d2e6070a..55642124061 100644 --- a/commands/docs/ansi_strip.md +++ b/commands/docs/ansi_strip.md @@ -2,7 +2,7 @@ title: ansi strip categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Strip ANSI escape sequences from a string. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples Strip ANSI escape sequences from a string diff --git a/commands/docs/any.md b/commands/docs/any.md index 4d77e9c176b..ed20073f18d 100644 --- a/commands/docs/any.md +++ b/commands/docs/any.md @@ -2,7 +2,7 @@ title: any categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Tests if any element of the input fulfills a predicate expression. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | --------- | ------ | -| list\ | bool | +| list<any> | bool | ## Examples Check if a list contains any true values diff --git a/commands/docs/append.md b/commands/docs/append.md index 5ee42f60bac..23b039c0f42 100644 --- a/commands/docs/append.md +++ b/commands/docs/append.md @@ -2,7 +2,7 @@ title: append categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Append any number of rows to a table. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | ----- | --------- | -| any | list\ | +| any | list<any> | ## Examples Append one int to a list diff --git a/commands/docs/ast.md b/commands/docs/ast.md index 14a9909d5c8..8c8dd00b3aa 100644 --- a/commands/docs/ast.md +++ b/commands/docs/ast.md @@ -2,7 +2,7 @@ title: ast categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | Print the abstract syntax tree (ast) for a pipeline. usage: | @@ -36,6 +36,8 @@ contributors: false | input | output | | ------- | ------ | | nothing | table | +| nothing | record | +| nothing | string | ## Examples Print the ast of a string diff --git a/commands/docs/attr_category.md b/commands/docs/attr_category.md index f31aabe520c..e75a2734a48 100644 --- a/commands/docs/attr_category.md +++ b/commands/docs/attr_category.md @@ -2,7 +2,7 @@ title: attr category categories: | core -version: 0.104.0 +version: 0.105.0 core: | Attribute for adding a category to custom commands. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | ------- | ------------ | -| nothing | list\ | +| nothing | list<string> | ## Examples Add a category to a custom command diff --git a/commands/docs/attr_deprecated.md b/commands/docs/attr_deprecated.md new file mode 100644 index 00000000000..8426fcc37e4 --- /dev/null +++ b/commands/docs/attr_deprecated.md @@ -0,0 +1,63 @@ +--- +title: attr deprecated +categories: | + core +version: 0.105.0 +core: | + Attribute for marking a command or flag as deprecated. +usage: | + Attribute for marking a command or flag as deprecated. +editLink: false +contributors: false +--- + + +# `attr deprecated` for [core](/commands/categories/core.md) + +
Attribute for marking a command or flag as deprecated.
+ +## Signature + +```> attr deprecated {flags} (message)``` + +## Flags + + - `--flag {string}`: Mark a flag as deprecated rather than the command + - `--since, -s {string}`: Denote a version when this item was deprecated + - `--remove, -r {string}`: Denote a version when this item will be removed + - `--report {string}`: How to warn about this item. One of: first (default), every + +## Parameters + + - `message`: Help message to include with deprecation warning. + + +## Input/output types: + +| input | output | +| ------- | ------- | +| nothing | nothing | +| nothing | string | +## Examples + +Add a deprecation warning to a custom command +```nu +> @deprecated + def outdated [] {} + +``` + +Add a deprecation warning with a custom message +```nu +> @deprecated "Use my-new-command instead." + @category deprecated + def my-old-command [] {} +Use my-new-command instead. +``` + +## Notes +Mark a command (default) or flag/switch (--flag) as deprecated. By default, only the first usage will trigger a deprecation warning. + +A help message can be included to provide more context for the deprecation, such as what to use as a replacement. + +Also consider setting the category to deprecated with @category deprecated \ No newline at end of file diff --git a/commands/docs/attr_example.md b/commands/docs/attr_example.md index 772d73da2ab..0f9de6fbbd6 100644 --- a/commands/docs/attr_example.md +++ b/commands/docs/attr_example.md @@ -2,7 +2,7 @@ title: attr example categories: | core -version: 0.104.0 +version: 0.105.0 core: | Attribute for adding examples to custom commands. usage: | @@ -34,7 +34,7 @@ contributors: false | input | output | | ------- | -------------------------------------------- | -| nothing | record\ | +| nothing | record<description: string, example: string> | ## Examples Add examples to custom command diff --git a/commands/docs/attr_search-terms.md b/commands/docs/attr_search-terms.md index a0e73afd6c8..26ed119a0e1 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.104.0 +version: 0.105.0 core: | Attribute for adding search terms to custom commands. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | ------- | ------------ | -| nothing | list\ | +| nothing | list<string> | ## Examples Add search terms to a custom command diff --git a/commands/docs/banner.md b/commands/docs/banner.md index 85765183210..d56b15ccff5 100644 --- a/commands/docs/banner.md +++ b/commands/docs/banner.md @@ -2,7 +2,7 @@ title: banner categories: | default -version: 0.104.0 +version: 0.105.0 default: | Print a banner for Nushell with information about the project usage: | @@ -23,10 +23,3 @@ contributors: false ## Flags - `--short`: Only show startup time - - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | \ No newline at end of file diff --git a/commands/docs/bits.md b/commands/docs/bits.md index 8497cece057..ed94971ad60 100644 --- a/commands/docs/bits.md +++ b/commands/docs/bits.md @@ -2,7 +2,7 @@ title: bits categories: | bits -version: 0.104.0 +version: 0.105.0 bits: | Various commands for working with bits. usage: | diff --git a/commands/docs/bits_and.md b/commands/docs/bits_and.md index 6c0eb0062aa..0b66ad458a1 100644 --- a/commands/docs/bits_and.md +++ b/commands/docs/bits_and.md @@ -2,7 +2,7 @@ title: bits and categories: | bits -version: 0.104.0 +version: 0.105.0 bits: | Performs bitwise and for ints or binary values. usage: | @@ -33,10 +33,10 @@ contributors: false | input | output | | ------------ | ------------ | -| binary | binary | | int | int | -| list\ | list\ | -| list\ | list\ | +| binary | binary | +| list<int> | list<int> | +| list<binary> | list<binary> | ## Examples Apply bitwise and to two numbers diff --git a/commands/docs/bits_not.md b/commands/docs/bits_not.md index b44c002e34d..2d9cb47e2cc 100644 --- a/commands/docs/bits_not.md +++ b/commands/docs/bits_not.md @@ -2,7 +2,7 @@ title: bits not categories: | bits -version: 0.104.0 +version: 0.105.0 bits: | Performs logical negation on each bit. usage: | @@ -30,10 +30,10 @@ contributors: false | input | output | | ------------ | ------------ | -| binary | binary | | int | int | -| list\ | list\ | -| list\ | list\ | +| binary | binary | +| list<int> | list<int> | +| list<binary> | list<binary> | ## Examples Apply logical negation to a list of numbers diff --git a/commands/docs/bits_or.md b/commands/docs/bits_or.md index 0eccce1f7ce..13a6c04665d 100644 --- a/commands/docs/bits_or.md +++ b/commands/docs/bits_or.md @@ -2,7 +2,7 @@ title: bits or categories: | bits -version: 0.104.0 +version: 0.105.0 bits: | Performs bitwise or for ints or binary values. usage: | @@ -33,10 +33,10 @@ contributors: false | input | output | | ------------ | ------------ | -| binary | binary | | int | int | -| list\ | list\ | -| list\ | list\ | +| binary | binary | +| list<int> | list<int> | +| list<binary> | list<binary> | ## Examples Apply bits or to two numbers diff --git a/commands/docs/bits_rol.md b/commands/docs/bits_rol.md index 75f566eb993..5253498e0dc 100644 --- a/commands/docs/bits_rol.md +++ b/commands/docs/bits_rol.md @@ -2,7 +2,7 @@ title: bits rol categories: | bits -version: 0.104.0 +version: 0.105.0 bits: | Bitwise rotate left for ints or binary values. usage: | @@ -34,10 +34,10 @@ contributors: false | input | output | | ------------ | ------------ | -| binary | binary | | int | int | -| list\ | list\ | -| list\ | list\ | +| binary | binary | +| list<int> | list<int> | +| list<binary> | list<binary> | ## Examples Rotate left a number with 2 bits diff --git a/commands/docs/bits_ror.md b/commands/docs/bits_ror.md index a0aff54bc60..f3273c64ce5 100644 --- a/commands/docs/bits_ror.md +++ b/commands/docs/bits_ror.md @@ -2,7 +2,7 @@ title: bits ror categories: | bits -version: 0.104.0 +version: 0.105.0 bits: | Bitwise rotate right for ints or binary values. usage: | @@ -34,10 +34,10 @@ contributors: false | input | output | | ------------ | ------------ | -| binary | binary | | int | int | -| list\ | list\ | -| list\ | list\ | +| binary | binary | +| list<int> | list<int> | +| list<binary> | list<binary> | ## Examples rotate right a number with 2 bits diff --git a/commands/docs/bits_shl.md b/commands/docs/bits_shl.md index 000f0c3ffbb..740377cf3e5 100644 --- a/commands/docs/bits_shl.md +++ b/commands/docs/bits_shl.md @@ -2,7 +2,7 @@ title: bits shl categories: | bits -version: 0.104.0 +version: 0.105.0 bits: | Bitwise shift left for ints or binary values. usage: | @@ -34,10 +34,10 @@ contributors: false | input | output | | ------------ | ------------ | -| binary | binary | | int | int | -| list\ | list\ | -| list\ | list\ | +| binary | binary | +| list<int> | list<int> | +| list<binary> | list<binary> | ## Examples Shift left a number by 7 bits diff --git a/commands/docs/bits_shr.md b/commands/docs/bits_shr.md index 2399e997907..82117335333 100644 --- a/commands/docs/bits_shr.md +++ b/commands/docs/bits_shr.md @@ -2,7 +2,7 @@ title: bits shr categories: | bits -version: 0.104.0 +version: 0.105.0 bits: | Bitwise shift right for ints or binary values. usage: | @@ -34,10 +34,10 @@ contributors: false | input | output | | ------------ | ------------ | -| binary | binary | | int | int | -| list\ | list\ | -| list\ | list\ | +| binary | binary | +| list<int> | list<int> | +| list<binary> | list<binary> | ## Examples Shift right a number with 2 bits diff --git a/commands/docs/bits_xor.md b/commands/docs/bits_xor.md index a7bbf668c89..f21335416b1 100644 --- a/commands/docs/bits_xor.md +++ b/commands/docs/bits_xor.md @@ -2,7 +2,7 @@ title: bits xor categories: | bits -version: 0.104.0 +version: 0.105.0 bits: | Performs bitwise xor for ints or binary values. usage: | @@ -33,10 +33,10 @@ contributors: false | input | output | | ------------ | ------------ | -| binary | binary | | int | int | -| list\ | list\ | -| list\ | list\ | +| binary | binary | +| list<int> | list<int> | +| list<binary> | list<binary> | ## Examples Apply bits xor to two numbers diff --git a/commands/docs/break.md b/commands/docs/break.md index 7a21ef48de0..5e8e881dc9e 100644 --- a/commands/docs/break.md +++ b/commands/docs/break.md @@ -2,7 +2,7 @@ title: break categories: | core -version: 0.104.0 +version: 0.105.0 core: | Break a loop. usage: | diff --git a/commands/docs/bytes.md b/commands/docs/bytes.md index b54dd08c004..9650ecdcc5c 100644 --- a/commands/docs/bytes.md +++ b/commands/docs/bytes.md @@ -2,7 +2,7 @@ title: bytes categories: | bytes -version: 0.104.0 +version: 0.105.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 8ce1a216573..b04c57cfc23 100644 --- a/commands/docs/bytes_add.md +++ b/commands/docs/bytes_add.md @@ -2,7 +2,7 @@ title: bytes add categories: | bytes -version: 0.104.0 +version: 0.105.0 bytes: | Add specified bytes to the input. usage: | @@ -36,9 +36,9 @@ contributors: false | input | output | | ------------ | ------------ | | binary | binary | -| list\ | list\ | -| record | record | +| list<binary> | list<binary> | | table | table | +| record | record | ## Examples Add bytes `0x[AA]` to `0x[1F FF AA AA]` diff --git a/commands/docs/bytes_at.md b/commands/docs/bytes_at.md index 0206aba73de..f941c032e99 100644 --- a/commands/docs/bytes_at.md +++ b/commands/docs/bytes_at.md @@ -2,7 +2,7 @@ title: bytes at categories: | bytes -version: 0.104.0 +version: 0.105.0 bytes: | Get bytes defined by a range. usage: | @@ -31,9 +31,9 @@ contributors: false | input | output | | ------------ | ------------ | | binary | binary | -| list\ | list\ | -| record | record | +| list<binary> | list<binary> | | table | table | +| record | record | ## Examples Extract bytes starting from a specific index diff --git a/commands/docs/bytes_build.md b/commands/docs/bytes_build.md index cb206b2ffcd..8f79dffab5a 100644 --- a/commands/docs/bytes_build.md +++ b/commands/docs/bytes_build.md @@ -2,7 +2,7 @@ title: bytes build categories: | bytes -version: 0.104.0 +version: 0.105.0 bytes: | Create bytes from the arguments. usage: | diff --git a/commands/docs/bytes_collect.md b/commands/docs/bytes_collect.md index e32b219648a..8fe5425f525 100644 --- a/commands/docs/bytes_collect.md +++ b/commands/docs/bytes_collect.md @@ -2,7 +2,7 @@ title: bytes collect categories: | bytes -version: 0.104.0 +version: 0.105.0 bytes: | Concatenate multiple binary into a single binary, with an optional separator between each. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | ------------ | ------ | -| list\ | binary | +| list<binary> | binary | ## Examples Create a byte array from input diff --git a/commands/docs/bytes_ends-with.md b/commands/docs/bytes_ends-with.md index 3e822114a90..48d2d3e18ab 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.104.0 +version: 0.105.0 bytes: | Check if bytes ends with a pattern. usage: | @@ -31,8 +31,8 @@ contributors: false | input | output | | ------ | ------ | | binary | bool | -| record | record | | table | table | +| record | record | ## Examples Checks if binary ends with `0x[AA]` diff --git a/commands/docs/bytes_index-of.md b/commands/docs/bytes_index-of.md index 2589cd549ad..09867efa643 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.104.0 +version: 0.105.0 bytes: | Returns start index of first occurrence of pattern in bytes, or -1 if no match. usage: | @@ -36,8 +36,8 @@ contributors: false | input | output | | ------ | ------ | | binary | any | -| record | record | | table | table | +| record | record | ## Examples Returns index of pattern in bytes diff --git a/commands/docs/bytes_length.md b/commands/docs/bytes_length.md index 37def5b14da..6701c4afe52 100644 --- a/commands/docs/bytes_length.md +++ b/commands/docs/bytes_length.md @@ -2,7 +2,7 @@ title: bytes length categories: | bytes -version: 0.104.0 +version: 0.105.0 bytes: | Output the length of any bytes in the pipeline. usage: | @@ -30,9 +30,9 @@ contributors: false | input | output | | ------------ | --------- | | binary | int | -| list\ | list\ | -| record | record | +| list<binary> | list<int> | | table | table | +| record | record | ## Examples Return the length of a binary diff --git a/commands/docs/bytes_remove.md b/commands/docs/bytes_remove.md index 7166f78bd3c..febaaa8468c 100644 --- a/commands/docs/bytes_remove.md +++ b/commands/docs/bytes_remove.md @@ -2,7 +2,7 @@ title: bytes remove categories: | bytes -version: 0.104.0 +version: 0.105.0 bytes: | Remove bytes. usage: | @@ -36,8 +36,8 @@ contributors: false | input | output | | ------ | ------ | | binary | binary | -| record | record | | table | table | +| record | record | ## Examples Remove contents diff --git a/commands/docs/bytes_replace.md b/commands/docs/bytes_replace.md index 1aa2a660844..27c67d66af5 100644 --- a/commands/docs/bytes_replace.md +++ b/commands/docs/bytes_replace.md @@ -2,7 +2,7 @@ title: bytes replace categories: | bytes -version: 0.104.0 +version: 0.105.0 bytes: | Find and replace binary. usage: | @@ -36,8 +36,8 @@ contributors: false | input | output | | ------ | ------ | | binary | binary | -| record | record | | table | table | +| record | record | ## Examples Find and replace contents diff --git a/commands/docs/bytes_reverse.md b/commands/docs/bytes_reverse.md index 0ad44ea455d..020fb69e2a9 100644 --- a/commands/docs/bytes_reverse.md +++ b/commands/docs/bytes_reverse.md @@ -2,7 +2,7 @@ title: bytes reverse categories: | bytes -version: 0.104.0 +version: 0.105.0 bytes: | Reverse the bytes in the pipeline. usage: | @@ -30,8 +30,8 @@ contributors: false | input | output | | ------ | ------ | | binary | binary | -| record | record | | table | table | +| record | record | ## Examples Reverse bytes `0x[1F FF AA AA]` diff --git a/commands/docs/bytes_split.md b/commands/docs/bytes_split.md index 355d099a11d..8a5ab95bf16 100644 --- a/commands/docs/bytes_split.md +++ b/commands/docs/bytes_split.md @@ -2,7 +2,7 @@ title: bytes split categories: | bytes -version: 0.104.0 +version: 0.105.0 bytes: | Split input into multiple items using a separator. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | ------ | ------------ | -| binary | list\ | +| binary | list<binary> | ## Examples Split a binary value using a binary separator diff --git a/commands/docs/bytes_starts-with.md b/commands/docs/bytes_starts-with.md index 2af77026b10..77f86528104 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.104.0 +version: 0.105.0 bytes: | Check if bytes starts with a pattern. usage: | @@ -31,8 +31,8 @@ contributors: false | input | output | | ------ | ------ | | binary | bool | -| record | record | | table | table | +| record | record | ## Examples Checks if binary starts with `0x[1F FF AA]` diff --git a/commands/docs/cal.md b/commands/docs/cal.md index 03ea802fbb2..952cf0bf57a 100644 --- a/commands/docs/cal.md +++ b/commands/docs/cal.md @@ -2,7 +2,7 @@ title: cal categories: | generators -version: 0.104.0 +version: 0.105.0 generators: | Display a calendar. usage: | @@ -35,6 +35,7 @@ contributors: false | input | output | | ------- | ------ | +| nothing | string | | nothing | table | ## Examples diff --git a/commands/docs/cd.md b/commands/docs/cd.md index f0840d6d7e1..c1fa7f0653b 100644 --- a/commands/docs/cd.md +++ b/commands/docs/cd.md @@ -2,7 +2,7 @@ title: cd categories: | filesystem -version: 0.104.0 +version: 0.105.0 filesystem: | Change directory. usage: | diff --git a/commands/docs/char.md b/commands/docs/char.md index 8e0a30ec77c..22a3c3c4897 100644 --- a/commands/docs/char.md +++ b/commands/docs/char.md @@ -2,7 +2,7 @@ title: char categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Output special characters (e.g., 'newline'). usage: | diff --git a/commands/docs/chunk-by.md b/commands/docs/chunk-by.md index 6ace54eeb2e..f6687f34b38 100644 --- a/commands/docs/chunk-by.md +++ b/commands/docs/chunk-by.md @@ -2,7 +2,7 @@ title: chunk-by categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Divides a sequence into sub-sequences based on a closure. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | --------- | --------------- | -| list\ | list\\> | -| range | list\\> | +| list<any> | list<list<any>> | +| range | list<list<any>> | ## Examples Chunk data into runs of larger than zero or not. diff --git a/commands/docs/chunks.md b/commands/docs/chunks.md index e2eb25c8ab7..f51634a7ec5 100644 --- a/commands/docs/chunks.md +++ b/commands/docs/chunks.md @@ -2,7 +2,7 @@ title: chunks categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Divide a list, table or binary input into chunks of `chunk_size`. usage: | @@ -29,9 +29,9 @@ contributors: false | input | output | | --------- | --------------- | -| binary | list\ | -| list\ | list\\> | -| table | list\ | +| table | list<table> | +| list<any> | list<list<any>> | +| binary | list<binary> | ## Examples Chunk a list into pairs diff --git a/commands/docs/clear.md b/commands/docs/clear.md index 16777a483fb..dc0dce843ef 100644 --- a/commands/docs/clear.md +++ b/commands/docs/clear.md @@ -2,7 +2,7 @@ title: clear categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Clear the terminal. usage: | diff --git a/commands/docs/collect.md b/commands/docs/collect.md index 6c38bf2aee4..5634a216ce7 100644 --- a/commands/docs/collect.md +++ b/commands/docs/collect.md @@ -2,7 +2,7 @@ title: collect categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Collect a stream into a value. usage: | diff --git a/commands/docs/columns.md b/commands/docs/columns.md index a3649f8c208..b5fe35f77b9 100644 --- a/commands/docs/columns.md +++ b/commands/docs/columns.md @@ -2,7 +2,7 @@ title: columns categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Given a record or table, produce a list of its columns' names. usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------ | ------------ | -| record | list\ | -| table | list\ | +| table | list<string> | +| record | list<string> | ## Examples Get the columns from the record diff --git a/commands/docs/commandline.md b/commands/docs/commandline.md index 3ec278ace37..3f90fe75a57 100644 --- a/commands/docs/commandline.md +++ b/commands/docs/commandline.md @@ -2,7 +2,7 @@ title: commandline categories: | core -version: 0.104.0 +version: 0.105.0 core: | View the current command line input buffer. usage: | diff --git a/commands/docs/commandline_edit.md b/commands/docs/commandline_edit.md index 25016598440..e8ee95c7afa 100644 --- a/commands/docs/commandline_edit.md +++ b/commands/docs/commandline_edit.md @@ -2,7 +2,7 @@ title: commandline edit categories: | core -version: 0.104.0 +version: 0.105.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 69535597518..2c4a810b2ff 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.104.0 +version: 0.105.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 f5c65b1383e..af996a8ec5f 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.104.0 +version: 0.105.0 core: | Set the current cursor position. usage: | diff --git a/commands/docs/compact.md b/commands/docs/compact.md index 89c04b19e9a..61e0c32a2de 100644 --- a/commands/docs/compact.md +++ b/commands/docs/compact.md @@ -2,7 +2,7 @@ title: compact categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Creates a table with non-empty rows. usage: | @@ -33,7 +33,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | ## Examples Filter out all records where 'Hello' is null diff --git a/commands/docs/complete.md b/commands/docs/complete.md index a8f41426c56..f17b35aacb3 100644 --- a/commands/docs/complete.md +++ b/commands/docs/complete.md @@ -2,7 +2,7 @@ title: complete categories: | system -version: 0.104.0 +version: 0.105.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 05a5d377952..351e5f0af6f 100644 --- a/commands/docs/config.md +++ b/commands/docs/config.md @@ -2,7 +2,7 @@ title: config categories: | env -version: 0.104.0 +version: 0.105.0 env: | Edit nushell configuration files. usage: | diff --git a/commands/docs/config_env.md b/commands/docs/config_env.md index 3f3035c64d5..1f87bf8bebb 100644 --- a/commands/docs/config_env.md +++ b/commands/docs/config_env.md @@ -2,7 +2,7 @@ title: config env categories: | env -version: 0.104.0 +version: 0.105.0 env: | Edit nu environment configurations. usage: | diff --git a/commands/docs/config_flatten.md b/commands/docs/config_flatten.md index e3472aac8cf..83d03f07258 100644 --- a/commands/docs/config_flatten.md +++ b/commands/docs/config_flatten.md @@ -2,7 +2,7 @@ title: config flatten categories: | debug -version: 0.104.0 +version: 0.105.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 0c765bfa69d..8a10b0fa09e 100644 --- a/commands/docs/config_nu.md +++ b/commands/docs/config_nu.md @@ -2,7 +2,7 @@ title: config nu categories: | env -version: 0.104.0 +version: 0.105.0 env: | Edit nu configurations. usage: | diff --git a/commands/docs/config_reset.md b/commands/docs/config_reset.md index 9b2f15cb6a9..cfba7230b9b 100644 --- a/commands/docs/config_reset.md +++ b/commands/docs/config_reset.md @@ -2,7 +2,7 @@ title: config reset categories: | env -version: 0.104.0 +version: 0.105.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 cfd1a5b0fd9..42c071d86cd 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.104.0 +version: 0.105.0 env: | Get the configuration for color output. usage: | diff --git a/commands/docs/const.md b/commands/docs/const.md index 682f62c55a9..d9b652c9e02 100644 --- a/commands/docs/const.md +++ b/commands/docs/const.md @@ -2,7 +2,7 @@ title: const categories: | core -version: 0.104.0 +version: 0.105.0 core: | Create a parse-time constant. usage: | diff --git a/commands/docs/continue.md b/commands/docs/continue.md index 46cbb1fe59a..aaf8584898b 100644 --- a/commands/docs/continue.md +++ b/commands/docs/continue.md @@ -2,7 +2,7 @@ title: continue categories: | core -version: 0.104.0 +version: 0.105.0 core: | Continue a loop from the next iteration. usage: | diff --git a/commands/docs/cp.md b/commands/docs/cp.md index 23a1251efef..ab4a57de407 100644 --- a/commands/docs/cp.md +++ b/commands/docs/cp.md @@ -2,7 +2,7 @@ title: cp categories: | filesystem -version: 0.104.0 +version: 0.105.0 filesystem: | Copy files using uutils/coreutils cp. usage: | diff --git a/commands/docs/date.md b/commands/docs/date.md index 5c511878bf9..275916b2375 100644 --- a/commands/docs/date.md +++ b/commands/docs/date.md @@ -2,7 +2,7 @@ title: date categories: | date -version: 0.104.0 +version: 0.105.0 date: | Date-related commands. usage: | diff --git a/commands/docs/date_format.md b/commands/docs/date_format.md index 9ca5f254aed..86a11a956e5 100644 --- a/commands/docs/date_format.md +++ b/commands/docs/date_format.md @@ -2,7 +2,7 @@ title: date format categories: | removed -version: 0.104.0 +version: 0.105.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 8adcfcb6c8f..c006bf5ee96 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.104.0 +version: 0.105.0 date: | Convert a human readable datetime string to a datetime. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------- | -------- | -| nothing | table | | string | datetime | +| nothing | table | ## Examples Parsing human readable datetime diff --git a/commands/docs/date_humanize.md b/commands/docs/date_humanize.md index f215092fdd6..5ac7fb9bf89 100644 --- a/commands/docs/date_humanize.md +++ b/commands/docs/date_humanize.md @@ -2,7 +2,7 @@ title: date humanize categories: | date -version: 0.104.0 +version: 0.105.0 date: | Print a 'humanized' format for the date, relative to now. usage: | diff --git a/commands/docs/date_list-timezone.md b/commands/docs/date_list-timezone.md index b29a9248f92..fc54b49b6ef 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.104.0 +version: 0.105.0 date: | List supported time zones. usage: | diff --git a/commands/docs/date_now.md b/commands/docs/date_now.md index 4874205ce31..4af2e1de19b 100644 --- a/commands/docs/date_now.md +++ b/commands/docs/date_now.md @@ -2,7 +2,7 @@ title: date now categories: | date -version: 0.104.0 +version: 0.105.0 date: | Get the current date. usage: | diff --git a/commands/docs/date_to-timezone.md b/commands/docs/date_to-timezone.md index 64d5d0e6122..bf490bfde05 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.104.0 +version: 0.105.0 date: | Convert a date to a given time zone. usage: | diff --git a/commands/docs/debug.md b/commands/docs/debug.md index 09d40e2fee9..7b87fcdb9bd 100644 --- a/commands/docs/debug.md +++ b/commands/docs/debug.md @@ -2,7 +2,7 @@ title: debug categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | Debug print the value(s) piped in. usage: | @@ -30,8 +30,8 @@ contributors: false | input | output | | --------- | ------------ | +| list<any> | list<string> | | any | string | -| list\ | list\ | ## Examples Debug print a string @@ -69,7 +69,8 @@ Debug print an ansi escape encoded string and get the raw value ## Subcommands: -| name | description | type | -| -------------------------------------------------- | --------------------------------------- | -------- | -| [`debug info`](/commands/docs/debug_info.md) | View process memory info. | built-in | -| [`debug profile`](/commands/docs/debug_profile.md) | Profile pipeline elements in a closure. | built-in | \ No newline at end of file +| name | description | type | +| -------------------------------------------------- | ------------------------------------------------------------- | -------- | +| [`debug env`](/commands/docs/debug_env.md) | Show environment variables as external commands would get it. | built-in | +| [`debug info`](/commands/docs/debug_info.md) | View process memory info. | built-in | +| [`debug profile`](/commands/docs/debug_profile.md) | Profile pipeline elements in a closure. | built-in | \ No newline at end of file diff --git a/commands/docs/debug_env.md b/commands/docs/debug_env.md new file mode 100644 index 00000000000..c0a6bd0fa0f --- /dev/null +++ b/commands/docs/debug_env.md @@ -0,0 +1,41 @@ +--- +title: debug env +categories: | + debug +version: 0.105.0 +debug: | + Show environment variables as external commands would get it. +usage: | + Show environment variables as external commands would get it. +editLink: false +contributors: false +--- + + +# `debug env` for [debug](/commands/categories/debug.md) + +
Show environment variables as external commands would get it.
+ +## Signature + +```> debug env {flags} ``` + + +## Input/output types: + +| input | output | +| ------- | ------ | +| nothing | record | +## Examples + +Get PATH variable that externals see +```nu +> debug env | get PATH! + +``` + +Create a .env file +```nu +> debug env | transpose key value | each {$"($in.key)=($in.value | to json)"} | save .env + +``` diff --git a/commands/docs/debug_info.md b/commands/docs/debug_info.md index 6ba46ecec1f..526b27436c0 100644 --- a/commands/docs/debug_info.md +++ b/commands/docs/debug_info.md @@ -2,7 +2,7 @@ title: debug info categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | View process memory info. usage: | diff --git a/commands/docs/debug_profile.md b/commands/docs/debug_profile.md index a844916753a..84a07c580d3 100644 --- a/commands/docs/debug_profile.md +++ b/commands/docs/debug_profile.md @@ -2,7 +2,7 @@ title: debug profile categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | Profile pipeline elements in a closure. usage: | diff --git a/commands/docs/decode.md b/commands/docs/decode.md index 177705d34f8..d0da7bed9ef 100644 --- a/commands/docs/decode.md +++ b/commands/docs/decode.md @@ -2,7 +2,7 @@ title: decode categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Decode bytes into a string. usage: | diff --git a/commands/docs/decode_base32.md b/commands/docs/decode_base32.md index 4a2e6bf080e..c8a8190117b 100644 --- a/commands/docs/decode_base32.md +++ b/commands/docs/decode_base32.md @@ -2,7 +2,7 @@ title: decode base32 categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Decode a Base32 value. usage: | diff --git a/commands/docs/decode_base32hex.md b/commands/docs/decode_base32hex.md index 8cd4aa81521..bfc46c4cb0e 100644 --- a/commands/docs/decode_base32hex.md +++ b/commands/docs/decode_base32hex.md @@ -2,7 +2,7 @@ title: decode base32hex categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Encode a base32hex value. usage: | diff --git a/commands/docs/decode_base64.md b/commands/docs/decode_base64.md index ea7247e9d79..d54a4007a32 100644 --- a/commands/docs/decode_base64.md +++ b/commands/docs/decode_base64.md @@ -2,7 +2,7 @@ title: decode base64 categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Decode a Base64 value. usage: | diff --git a/commands/docs/decode_hex.md b/commands/docs/decode_hex.md index a62251be0a1..3fe628c8bec 100644 --- a/commands/docs/decode_hex.md +++ b/commands/docs/decode_hex.md @@ -2,7 +2,7 @@ title: decode hex categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Hex decode a value. usage: | diff --git a/commands/docs/def.md b/commands/docs/def.md index b6fca256668..a8c45226c67 100644 --- a/commands/docs/def.md +++ b/commands/docs/def.md @@ -2,7 +2,7 @@ title: def categories: | core -version: 0.104.0 +version: 0.105.0 core: | Define a custom command. usage: | diff --git a/commands/docs/default.md b/commands/docs/default.md index 34e613f8994..0ef94ab56b6 100644 --- a/commands/docs/default.md +++ b/commands/docs/default.md @@ -2,7 +2,7 @@ title: default categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Sets a default value if a row's column is missing or null. usage: | @@ -18,7 +18,7 @@ contributors: false ## Signature -```> default {flags} (default value) (column name)``` +```> default {flags} (default value) ...rest``` ## Flags @@ -27,7 +27,7 @@ contributors: false ## Parameters - `default value`: The value to use as a default. - - `column name`: The name of the column. + - `...rest`: The name of the column. ## Input/output types: @@ -84,3 +84,21 @@ Replace the empty string in the "a" column of a list ╰───┴─────┴───╯ ``` + +Generate a default value from a closure +```nu +> null | default { 1 + 2 } +3 +``` + +Fill missing column values based on other columns +```nu +> [{a:1 b:2} {b:1}] | upsert a {|rc| default { $rc.b + 1 } } +╭───┬───┬───╮ +│ # │ a │ b │ +├───┼───┼───┤ +│ 0 │ 1 │ 2 │ +│ 1 │ 2 │ 1 │ +╰───┴───┴───╯ + +``` diff --git a/commands/docs/describe.md b/commands/docs/describe.md index c7a80c79bd9..f0c040ea06d 100644 --- a/commands/docs/describe.md +++ b/commands/docs/describe.md @@ -2,7 +2,7 @@ title: describe categories: | core -version: 0.104.0 +version: 0.105.0 core: | Describe the type and structure of the value(s) piped in. usage: | @@ -116,7 +116,7 @@ Describe the type of a record in a detailed way │ │ │ │ │ detailed_type │ datetime │ │ │ │ │ │ │ │ rust_type │ chrono::datetime::DateTime │ │ │ -│ │ │ │ │ value │ 5 years ago │ │ │ +│ │ │ │ │ value │ 6 years ago │ │ │ │ │ │ │ ╰───────────────┴──────────────────────────────────────────────────────────────╯ │ │ │ │ │ │ ╭───────────────┬────────────╮ │ │ │ │ │ my_duration │ │ type │ duration │ │ │ diff --git a/commands/docs/detect_columns.md b/commands/docs/detect_columns.md index fb5a4386e76..35f9f0a44b5 100644 --- a/commands/docs/detect_columns.md +++ b/commands/docs/detect_columns.md @@ -2,7 +2,7 @@ title: detect columns categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Attempt to automatically split text into multiple columns. usage: | diff --git a/commands/docs/do.md b/commands/docs/do.md index f4ff4a0b87f..87305c009ae 100644 --- a/commands/docs/do.md +++ b/commands/docs/do.md @@ -2,7 +2,7 @@ title: do categories: | core -version: 0.104.0 +version: 0.105.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 0ac08c5b847..96ee0cc9ca2 100644 --- a/commands/docs/drop.md +++ b/commands/docs/drop.md @@ -2,7 +2,7 @@ title: drop categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Remove items/rows from the end of the input list/table. Counterpart of `skip`. Opposite of `last`. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | | table | table | +| list<any> | list<any> | ## Examples Remove the last item of a list diff --git a/commands/docs/drop_column.md b/commands/docs/drop_column.md index 4fe95c43cfa..5b69b22cc52 100644 --- a/commands/docs/drop_column.md +++ b/commands/docs/drop_column.md @@ -2,7 +2,7 @@ title: drop column categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Remove N columns at the right-hand end of the input table. To remove columns by name, use `reject`. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------ | ------ | -| record | record | | table | table | +| record | record | ## Examples Remove the last column of a table diff --git a/commands/docs/drop_nth.md b/commands/docs/drop_nth.md index 4a58fbad2cb..904ffa88cc5 100644 --- a/commands/docs/drop_nth.md +++ b/commands/docs/drop_nth.md @@ -2,7 +2,7 @@ title: drop nth categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Drop the selected rows. usage: | @@ -30,8 +30,8 @@ contributors: false | input | output | | --------- | ------------ | -| list\ | list\ | -| range | list\ | +| range | list<number> | +| list<any> | list<any> | ## Examples Drop the first, second, and third row diff --git a/commands/docs/du.md b/commands/docs/du.md index bcb2f7f25d1..65de348fb8f 100644 --- a/commands/docs/du.md +++ b/commands/docs/du.md @@ -2,7 +2,7 @@ title: du categories: | filesystem -version: 0.104.0 +version: 0.105.0 filesystem: | Find disk usage sizes of specified items. usage: | diff --git a/commands/docs/each.md b/commands/docs/each.md index 273fa041616..5cae68178b1 100644 --- a/commands/docs/each.md +++ b/commands/docs/each.md @@ -2,7 +2,7 @@ title: each categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Run a closure on each row of the input list, creating a new list with the results. usage: | @@ -33,9 +33,9 @@ contributors: false | input | output | | --------- | --------- | +| list<any> | list<any> | +| table | list<any> | | any | any | -| list\ | list\ | -| table | list\ | ## Examples Multiplies elements in the list diff --git a/commands/docs/each_while.md b/commands/docs/each_while.md index 6611bf4a513..8e4d4075b25 100644 --- a/commands/docs/each_while.md +++ b/commands/docs/each_while.md @@ -2,7 +2,7 @@ title: each while categories: | filters -version: 0.104.0 +version: 0.105.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: | @@ -29,7 +29,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | ## Examples Produces a list of each element before the 3, doubled diff --git a/commands/docs/echo.md b/commands/docs/echo.md index fb569d65c6d..63aa0dad780 100644 --- a/commands/docs/echo.md +++ b/commands/docs/echo.md @@ -2,7 +2,7 @@ title: echo categories: | core -version: 0.104.0 +version: 0.105.0 core: | Returns its arguments, ignoring the piped-in value. usage: | diff --git a/commands/docs/encode.md b/commands/docs/encode.md index 3305f67e51d..671e3932491 100644 --- a/commands/docs/encode.md +++ b/commands/docs/encode.md @@ -2,7 +2,7 @@ title: encode categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Encode a string into bytes. usage: | diff --git a/commands/docs/encode_base32.md b/commands/docs/encode_base32.md index c62e6950ae7..05b95f0916c 100644 --- a/commands/docs/encode_base32.md +++ b/commands/docs/encode_base32.md @@ -2,7 +2,7 @@ title: encode base32 categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Encode a string or binary value using Base32. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------ | ------ | -| binary | string | | string | string | +| binary | string | ## Examples Encode a binary value diff --git a/commands/docs/encode_base32hex.md b/commands/docs/encode_base32hex.md index fcbe3a3ec18..e7d24a1316d 100644 --- a/commands/docs/encode_base32hex.md +++ b/commands/docs/encode_base32hex.md @@ -2,7 +2,7 @@ title: encode base32hex categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Encode a binary value or a string using base32hex. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------ | ------ | -| binary | string | | string | string | +| binary | string | ## Examples Encode a binary value diff --git a/commands/docs/encode_base64.md b/commands/docs/encode_base64.md index dc733567bfc..dacb656f0ce 100644 --- a/commands/docs/encode_base64.md +++ b/commands/docs/encode_base64.md @@ -2,7 +2,7 @@ title: encode base64 categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Encode a string or binary value using Base64. usage: | @@ -30,8 +30,8 @@ contributors: false | input | output | | ------ | ------ | -| binary | string | | string | string | +| binary | string | ## Examples Encode a string with Base64 diff --git a/commands/docs/encode_hex.md b/commands/docs/encode_hex.md index 0d916f3dac0..4125c8d39ce 100644 --- a/commands/docs/encode_hex.md +++ b/commands/docs/encode_hex.md @@ -2,7 +2,7 @@ title: encode hex categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Hex encode a binary value or a string. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------ | ------ | -| binary | string | | string | string | +| binary | string | ## Examples Encode a binary value diff --git a/commands/docs/enumerate.md b/commands/docs/enumerate.md index 7a192757d66..b0ed7a57bd4 100644 --- a/commands/docs/enumerate.md +++ b/commands/docs/enumerate.md @@ -2,7 +2,7 @@ title: enumerate categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Enumerate the elements in a stream. usage: | diff --git a/commands/docs/error_make.md b/commands/docs/error_make.md index c5e707a8e33..33632741d4b 100644 --- a/commands/docs/error_make.md +++ b/commands/docs/error_make.md @@ -2,7 +2,7 @@ title: error make categories: | core -version: 0.104.0 +version: 0.105.0 core: | Create an error. usage: | @@ -33,7 +33,7 @@ contributors: false | input | output | | ------- | ------ | -| nothing | any | +| nothing | error | ## Examples Create a simple custom error diff --git a/commands/docs/every.md b/commands/docs/every.md index 7b7757f72fe..9a45d18e912 100644 --- a/commands/docs/every.md +++ b/commands/docs/every.md @@ -2,7 +2,7 @@ title: every categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Show (or skip) every n-th row, starting from the first one. usage: | @@ -33,7 +33,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | ## Examples Get every second row diff --git a/commands/docs/exec.md b/commands/docs/exec.md index 8add578e0cf..83ffed24cda 100644 --- a/commands/docs/exec.md +++ b/commands/docs/exec.md @@ -2,7 +2,7 @@ title: exec categories: | system -version: 0.104.0 +version: 0.105.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 50084c19933..03a178b9443 100644 --- a/commands/docs/exit.md +++ b/commands/docs/exit.md @@ -2,7 +2,7 @@ title: exit categories: | shells -version: 0.104.0 +version: 0.105.0 shells: | Exit Nu. usage: | diff --git a/commands/docs/explain.md b/commands/docs/explain.md index a5e461d0178..d85f9a52eb1 100644 --- a/commands/docs/explain.md +++ b/commands/docs/explain.md @@ -2,7 +2,7 @@ title: explain categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | Explain closure contents. usage: | diff --git a/commands/docs/explore.md b/commands/docs/explore.md index 049f2d29a06..1182df492b5 100644 --- a/commands/docs/explore.md +++ b/commands/docs/explore.md @@ -2,7 +2,7 @@ title: explore categories: | viewers -version: 0.104.0 +version: 0.105.0 viewers: | Explore acts as a table pager, just like `less` does for text. usage: | diff --git a/commands/docs/export-env.md b/commands/docs/export-env.md index e505660a2e0..bde3bf1c500 100644 --- a/commands/docs/export-env.md +++ b/commands/docs/export-env.md @@ -2,7 +2,7 @@ title: export-env categories: | env -version: 0.104.0 +version: 0.105.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 5d10b612d3c..a7ee5e113ab 100644 --- a/commands/docs/export.md +++ b/commands/docs/export.md @@ -2,7 +2,7 @@ title: export categories: | core -version: 0.104.0 +version: 0.105.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 4ac0458c588..a63f9292f1f 100644 --- a/commands/docs/export_alias.md +++ b/commands/docs/export_alias.md @@ -2,7 +2,7 @@ title: export alias categories: | core -version: 0.104.0 +version: 0.105.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 a1ffe25118a..fbf4be734c4 100644 --- a/commands/docs/export_const.md +++ b/commands/docs/export_const.md @@ -2,7 +2,7 @@ title: export const categories: | core -version: 0.104.0 +version: 0.105.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 2a87a995693..b46e951cafd 100644 --- a/commands/docs/export_def.md +++ b/commands/docs/export_def.md @@ -2,7 +2,7 @@ title: export def categories: | core -version: 0.104.0 +version: 0.105.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 9bdd2c7b83b..410ffd610c2 100644 --- a/commands/docs/export_extern.md +++ b/commands/docs/export_extern.md @@ -2,7 +2,7 @@ title: export extern categories: | core -version: 0.104.0 +version: 0.105.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 eb21cbc72e3..4f6de86b67d 100644 --- a/commands/docs/export_module.md +++ b/commands/docs/export_module.md @@ -2,7 +2,7 @@ title: export module categories: | core -version: 0.104.0 +version: 0.105.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 89236adcb0b..684128de7cf 100644 --- a/commands/docs/export_use.md +++ b/commands/docs/export_use.md @@ -2,7 +2,7 @@ title: export use categories: | core -version: 0.104.0 +version: 0.105.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 08016984939..55606d9e349 100644 --- a/commands/docs/extern.md +++ b/commands/docs/extern.md @@ -2,7 +2,7 @@ title: extern categories: | core -version: 0.104.0 +version: 0.105.0 core: | Define a signature for an external command. usage: | diff --git a/commands/docs/fill.md b/commands/docs/fill.md index 2df6ed720b3..8af0ce2dca6 100644 --- a/commands/docs/fill.md +++ b/commands/docs/fill.md @@ -2,7 +2,7 @@ title: fill categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Fill and Align. usage: | @@ -31,15 +31,15 @@ contributors: false | input | output | | -------------- | ------------ | -| filesize | string | -| float | string | | int | string | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | +| float | string | | string | string | +| filesize | string | +| list<int> | list<string> | +| list<float> | list<string> | +| list<string> | list<string> | +| list<filesize> | list<string> | +| list<any> | list<string> | ## Examples Fill a string on the left side to a width of 15 with the character '─' diff --git a/commands/docs/filter.md b/commands/docs/filter.md index b5b1d71bf17..315fcbc4cce 100644 --- a/commands/docs/filter.md +++ b/commands/docs/filter.md @@ -2,7 +2,7 @@ title: filter categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Filter values based on a predicate closure. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | -| range | list\ | +| list<any> | list<any> | +| range | list<any> | ## Examples Filter items of a list according to a condition @@ -82,5 +82,5 @@ List all numbers above 3, using an existing closure condition ``` ## Notes -This command works similar to 'where' but allows reading the predicate closure from -a variable. On the other hand, the "row condition" syntax is not supported. \ No newline at end of file +This command works similar to 'where' but can only use a closure as a predicate. +The "row condition" syntax is not supported. \ No newline at end of file diff --git a/commands/docs/find.md b/commands/docs/find.md index 9f2bf2c283e..bb50a700c1e 100644 --- a/commands/docs/find.md +++ b/commands/docs/find.md @@ -2,7 +2,7 @@ title: find categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Searches terms in the input. usage: | @@ -27,7 +27,7 @@ contributors: false - `--multiline, -m`: multi-line regex mode: ^ and $ match begin/end of line; equivalent to (?m) - `--dotall, -s`: dotall regex mode: allow a dot . to match newlines \n; equivalent to (?s) - `--columns, -c {list}`: column names to be searched (with rest parameter, not regex yet) - - `--no-highlight, -n`: no-highlight mode: find without marking with ascii code + - `--no-highlight, -n`: no-highlight mode: find without marking with ansi code - `--invert, -v`: invert the match ## Parameters @@ -39,7 +39,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | | string | any | ## Examples diff --git a/commands/docs/first.md b/commands/docs/first.md index 20a768e2677..7da88d575cb 100644 --- a/commands/docs/first.md +++ b/commands/docs/first.md @@ -2,7 +2,7 @@ title: first categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | --------- | ------ | +| list<any> | any | | binary | binary | -| list\ | any | | range | any | ## Examples diff --git a/commands/docs/flatten.md b/commands/docs/flatten.md index dc8d8da2edf..e30ffce2d4a 100644 --- a/commands/docs/flatten.md +++ b/commands/docs/flatten.md @@ -2,7 +2,7 @@ title: flatten categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Flatten the table. usage: | @@ -33,7 +33,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | | record | table | ## Examples diff --git a/commands/docs/for.md b/commands/docs/for.md index 99327091e4b..56e2e8b87c1 100644 --- a/commands/docs/for.md +++ b/commands/docs/for.md @@ -2,7 +2,7 @@ title: for categories: | core -version: 0.104.0 +version: 0.105.0 core: | Loop over a range. usage: | diff --git a/commands/docs/format.md b/commands/docs/format.md index 3397e6c914d..05e726b0964 100644 --- a/commands/docs/format.md +++ b/commands/docs/format.md @@ -2,7 +2,7 @@ title: format categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Various commands for formatting data. usage: | diff --git a/commands/docs/format_bits.md b/commands/docs/format_bits.md index 46d026e6dbe..b99684f249f 100644 --- a/commands/docs/format_bits.md +++ b/commands/docs/format_bits.md @@ -2,7 +2,7 @@ title: format bits categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert value to a string of binary data represented by 0 and 1. usage: | @@ -30,13 +30,13 @@ contributors: false | input | output | | -------- | ------ | | binary | string | -| bool | string | -| duration | string | -| filesize | string | | int | string | -| record | record | +| filesize | string | +| duration | string | | string | string | +| bool | string | | table | table | +| record | record | ## Examples convert a binary value into a string, padded to 8 places with 0s diff --git a/commands/docs/format_date.md b/commands/docs/format_date.md index 736059e3f97..11d106e60a3 100644 --- a/commands/docs/format_date.md +++ b/commands/docs/format_date.md @@ -2,7 +2,7 @@ title: format date categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Format a given date using a format string. usage: | @@ -33,10 +33,10 @@ contributors: false | input | output | | -------- | ------ | -| any | table | | datetime | string | -| nothing | table | | string | string | +| nothing | table | +| any | table | ## Examples Format a given date-time using the default format (RFC 2822). diff --git a/commands/docs/format_duration.md b/commands/docs/format_duration.md index 8acc98f8a7e..7a7bf259dc3 100644 --- a/commands/docs/format_duration.md +++ b/commands/docs/format_duration.md @@ -2,7 +2,7 @@ title: format duration categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Outputs duration with a specified unit of time. usage: | @@ -31,7 +31,7 @@ contributors: false | input | output | | -------------- | ------------ | | duration | string | -| list\ | list\ | +| list<duration> | list<string> | | table | table | ## Examples diff --git a/commands/docs/format_filesize.md b/commands/docs/format_filesize.md index 5e4b5afe31f..e8f00849ffb 100644 --- a/commands/docs/format_filesize.md +++ b/commands/docs/format_filesize.md @@ -2,7 +2,7 @@ title: format filesize categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Converts a column of filesizes to some specified format. usage: | @@ -31,8 +31,8 @@ contributors: false | input | output | | -------- | ------ | | filesize | string | -| record | record | | table | table | +| record | record | ## Examples Convert the size column to KB diff --git a/commands/docs/format_number.md b/commands/docs/format_number.md index fad219747b0..95e67e185cf 100644 --- a/commands/docs/format_number.md +++ b/commands/docs/format_number.md @@ -2,7 +2,7 @@ title: format number categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Format a number. usage: | diff --git a/commands/docs/format_pattern.md b/commands/docs/format_pattern.md index ef6e8c4fb53..e920cac7aba 100644 --- a/commands/docs/format_pattern.md +++ b/commands/docs/format_pattern.md @@ -2,7 +2,7 @@ title: format pattern categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Format columns into a string using a simple pattern. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------ | ------------ | +| table | list<string> | | record | any | -| table | list\ | ## Examples Print filenames with their sizes diff --git a/commands/docs/from.md b/commands/docs/from.md index 0b385d2320f..891ef48febf 100644 --- a/commands/docs/from.md +++ b/commands/docs/from.md @@ -2,7 +2,7 @@ title: from categories: | formats -version: 0.104.0 +version: 0.105.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 bbb4d474064..630452624a3 100644 --- a/commands/docs/from_csv.md +++ b/commands/docs/from_csv.md @@ -2,7 +2,7 @@ title: from csv categories: | formats -version: 0.104.0 +version: 0.105.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 66b3180e1c9..4449a461ea8 100644 --- a/commands/docs/from_eml.md +++ b/commands/docs/from_eml.md @@ -2,7 +2,7 @@ title: from eml categories: | formats -version: 0.104.0 +version: 0.105.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 6408e854c93..f019aec39ad 100644 --- a/commands/docs/from_ics.md +++ b/commands/docs/from_ics.md @@ -2,7 +2,7 @@ title: from ics categories: | formats -version: 0.104.0 +version: 0.105.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 43f6fb5716e..d1e2bb61efa 100644 --- a/commands/docs/from_ini.md +++ b/commands/docs/from_ini.md @@ -2,7 +2,7 @@ title: from ini categories: | formats -version: 0.104.0 +version: 0.105.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 e53d8b18395..1e53839d50b 100644 --- a/commands/docs/from_json.md +++ b/commands/docs/from_json.md @@ -2,7 +2,7 @@ title: from json categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert from json to structured data. usage: | diff --git a/commands/docs/from_msgpack.md b/commands/docs/from_msgpack.md index 05e8e3a8a65..a8228f6026a 100644 --- a/commands/docs/from_msgpack.md +++ b/commands/docs/from_msgpack.md @@ -2,7 +2,7 @@ title: from msgpack categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert MessagePack data into Nu values. usage: | @@ -62,7 +62,7 @@ Read a table from MessagePack │ # │ event_name │ time │ ├───┼──────────────────────┼──────────────┤ │ 0 │ Apollo 11 Landing │ 55 years ago │ -│ 1 │ Nushell first commit │ 5 years ago │ +│ 1 │ Nushell first commit │ 6 years ago │ ╰───┴──────────────────────┴──────────────╯ ``` diff --git a/commands/docs/from_msgpackz.md b/commands/docs/from_msgpackz.md index 48f9d7e58cb..82773a302b0 100644 --- a/commands/docs/from_msgpackz.md +++ b/commands/docs/from_msgpackz.md @@ -2,7 +2,7 @@ title: from msgpackz categories: | formats -version: 0.104.0 +version: 0.105.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 1aa710a674e..736cf5b4076 100644 --- a/commands/docs/from_nuon.md +++ b/commands/docs/from_nuon.md @@ -2,7 +2,7 @@ title: from nuon categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert from nuon to structured data. usage: | @@ -47,3 +47,15 @@ Converts nuon formatted string to table │ │ ╰───┴───╯ │ ╰───┴───────────╯ ``` + +Converts raw nuon formatted string to table +```nu +> '{a:1,b:[1,2]}' | from nuon +╭───┬───────────╮ +│ a │ 1 │ +│ │ ╭───┬───╮ │ +│ b │ │ 0 │ 1 │ │ +│ │ │ 1 │ 2 │ │ +│ │ ╰───┴───╯ │ +╰───┴───────────╯ +``` diff --git a/commands/docs/from_ods.md b/commands/docs/from_ods.md index 41d7feb4cf7..62ecd9d9629 100644 --- a/commands/docs/from_ods.md +++ b/commands/docs/from_ods.md @@ -2,7 +2,7 @@ title: from ods categories: | formats -version: 0.104.0 +version: 0.105.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 4fc26efadd4..865bcd6893a 100644 --- a/commands/docs/from_plist.md +++ b/commands/docs/from_plist.md @@ -2,7 +2,7 @@ title: from plist categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert plist to Nushell values usage: | @@ -27,12 +27,6 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ```> from plist {flags} ``` - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | ## Examples Convert a table into a plist file diff --git a/commands/docs/from_ssv.md b/commands/docs/from_ssv.md index 388f3fc383c..ce9360a13d6 100644 --- a/commands/docs/from_ssv.md +++ b/commands/docs/from_ssv.md @@ -2,7 +2,7 @@ title: from ssv categories: | formats -version: 0.104.0 +version: 0.105.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 cc14f202b87..2706ff380c2 100644 --- a/commands/docs/from_toml.md +++ b/commands/docs/from_toml.md @@ -2,7 +2,7 @@ title: from toml categories: | formats -version: 0.104.0 +version: 0.105.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 1c262aec2b4..22cf6d29bef 100644 --- a/commands/docs/from_tsv.md +++ b/commands/docs/from_tsv.md @@ -2,7 +2,7 @@ title: from tsv categories: | formats -version: 0.104.0 +version: 0.105.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 6ed5416890a..2552275d08f 100644 --- a/commands/docs/from_url.md +++ b/commands/docs/from_url.md @@ -2,7 +2,7 @@ title: from url categories: | formats -version: 0.104.0 +version: 0.105.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 4f20fce7111..598ec69e327 100644 --- a/commands/docs/from_vcf.md +++ b/commands/docs/from_vcf.md @@ -2,7 +2,7 @@ title: from vcf categories: | formats -version: 0.104.0 +version: 0.105.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 974597d16ad..803b87845d2 100644 --- a/commands/docs/from_xlsx.md +++ b/commands/docs/from_xlsx.md @@ -2,7 +2,7 @@ title: from xlsx categories: | formats -version: 0.104.0 +version: 0.105.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 57c6a0c79c0..ad31bd990cd 100644 --- a/commands/docs/from_xml.md +++ b/commands/docs/from_xml.md @@ -2,7 +2,7 @@ title: from xml categories: | formats -version: 0.104.0 +version: 0.105.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 c5f98db70bb..d4468dffdea 100644 --- a/commands/docs/from_yaml.md +++ b/commands/docs/from_yaml.md @@ -2,7 +2,7 @@ title: from yaml categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Parse text as .yaml/.yml and create table. usage: | diff --git a/commands/docs/from_yml.md b/commands/docs/from_yml.md index db02dd6d283..502e093c87d 100644 --- a/commands/docs/from_yml.md +++ b/commands/docs/from_yml.md @@ -2,7 +2,7 @@ title: from yml categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Parse text as .yaml/.yml and create table. usage: | diff --git a/commands/docs/generate.md b/commands/docs/generate.md index 6698de24e7c..df1104aba34 100644 --- a/commands/docs/generate.md +++ b/commands/docs/generate.md @@ -2,7 +2,7 @@ title: generate categories: | generators -version: 0.104.0 +version: 0.105.0 generators: | Generate a list of values by successively invoking a closure. usage: | @@ -30,10 +30,10 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | -| nothing | list\ | -| range | list\ | -| table | list\ | +| nothing | list<any> | +| list<any> | list<any> | +| table | list<any> | +| range | list<any> | ## Examples Generate a sequence of numbers diff --git a/commands/docs/get.md b/commands/docs/get.md index 935eec73d12..aa04eae62f9 100644 --- a/commands/docs/get.md +++ b/commands/docs/get.md @@ -2,7 +2,7 @@ title: get categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Extract data using a cell path. usage: | @@ -23,7 +23,7 @@ contributors: false ## Flags - `--ignore-errors, -i`: ignore missing data (make all cell path members optional) - - `--sensitive, -s`: get path in a case sensitive manner + - `--sensitive, -s`: get path in a case sensitive manner (deprecated) ## Parameters @@ -35,10 +35,10 @@ contributors: false | input | output | | --------- | ------- | -| list\ | any | -| nothing | nothing | -| record | any | +| list<any> | any | | table | any | +| record | any | +| nothing | nothing | ## Examples Get an item from a list @@ -76,13 +76,13 @@ Extract the name of the 3rd record in a list Getting Path/PATH in a case insensitive way ```nu -> $env | get paTH +> $env | get paTH! ``` Getting Path in a case sensitive way, won't work for 'PATH' ```nu -> $env | get --sensitive Path +> $env | get Path ``` diff --git a/commands/docs/glob.md b/commands/docs/glob.md index 059750bbbf0..d9867830e27 100644 --- a/commands/docs/glob.md +++ b/commands/docs/glob.md @@ -2,7 +2,7 @@ title: glob categories: | filesystem -version: 0.104.0 +version: 0.105.0 filesystem: | Creates a list of files and/or folders based on the glob pattern provided. usage: | @@ -38,7 +38,7 @@ contributors: false | input | output | | ------- | ------------ | -| nothing | list\ | +| nothing | list<string> | ## Examples Search for *.rs files diff --git a/commands/docs/grid.md b/commands/docs/grid.md index 2ce3213a56e..bf8608359ec 100644 --- a/commands/docs/grid.md +++ b/commands/docs/grid.md @@ -2,7 +2,7 @@ title: grid categories: | viewers -version: 0.104.0 +version: 0.105.0 viewers: | Renders the output to a textual terminal grid. usage: | @@ -32,7 +32,7 @@ contributors: false | input | output | | --------- | ------ | -| list\ | string | +| list<any> | string | | record | string | ## Examples diff --git a/commands/docs/group-by.md b/commands/docs/group-by.md index c9681e8ff0d..79f5c0710f6 100644 --- a/commands/docs/group-by.md +++ b/commands/docs/group-by.md @@ -2,7 +2,7 @@ title: group-by categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Splits a list or table into groups, and returns a record containing those groups. usage: | @@ -33,7 +33,7 @@ contributors: false | input | output | | --------- | ------ | -| list\ | any | +| list<any> | any | ## Examples Group items by the "type" column's values diff --git a/commands/docs/gstat.md b/commands/docs/gstat.md index 231792e526f..78434a73491 100644 --- a/commands/docs/gstat.md +++ b/commands/docs/gstat.md @@ -2,7 +2,7 @@ title: gstat categories: | prompt -version: 0.104.0 +version: 0.105.0 prompt: | Get the git status of a repo usage: | @@ -27,13 +27,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ```> gstat {flags} (path)``` -## Parameters - - - `path`: path to repo +## Flags + - `--no-tag`: Disable git tag resolving -## Input/output types: +## Parameters -| input | output | -| ----- | ------ | -| any | any | \ No newline at end of file + - `path`: path to repo diff --git a/commands/docs/hash.md b/commands/docs/hash.md index 23d30b79342..243d09e0b42 100644 --- a/commands/docs/hash.md +++ b/commands/docs/hash.md @@ -2,7 +2,7 @@ title: hash categories: | hash -version: 0.104.0 +version: 0.105.0 hash: | Apply hash function. usage: | diff --git a/commands/docs/hash_md5.md b/commands/docs/hash_md5.md index d153e4b510e..3928285084d 100644 --- a/commands/docs/hash_md5.md +++ b/commands/docs/hash_md5.md @@ -2,7 +2,7 @@ title: hash md5 categories: | hash -version: 0.104.0 +version: 0.105.0 hash: | Hash a value using the md5 hash algorithm. usage: | @@ -33,10 +33,10 @@ contributors: false | input | output | | ------ | ------ | -| binary | any | -| record | record | | string | any | +| binary | any | | table | table | +| record | record | ## Examples Return the md5 hash of a string, hex-encoded diff --git a/commands/docs/hash_sha256.md b/commands/docs/hash_sha256.md index 2ea1944a0f7..cf2b66b7b3e 100644 --- a/commands/docs/hash_sha256.md +++ b/commands/docs/hash_sha256.md @@ -2,7 +2,7 @@ title: hash sha256 categories: | hash -version: 0.104.0 +version: 0.105.0 hash: | Hash a value using the sha256 hash algorithm. usage: | @@ -33,10 +33,10 @@ contributors: false | input | output | | ------ | ------ | -| binary | any | -| record | record | | string | any | +| binary | any | | table | table | +| record | record | ## Examples Return the sha256 hash of a string, hex-encoded diff --git a/commands/docs/headers.md b/commands/docs/headers.md index cd64c66820b..c0cf0d329f2 100644 --- a/commands/docs/headers.md +++ b/commands/docs/headers.md @@ -2,7 +2,7 @@ title: headers categories: | filters -version: 0.104.0 +version: 0.105.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 db01ed4b586..d510f695869 100644 --- a/commands/docs/help.md +++ b/commands/docs/help.md @@ -2,7 +2,7 @@ title: help categories: | core -version: 0.104.0 +version: 0.105.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 2da6bd5dc83..0744ab07b57 100644 --- a/commands/docs/help_aliases.md +++ b/commands/docs/help_aliases.md @@ -2,7 +2,7 @@ title: help aliases categories: | core -version: 0.104.0 +version: 0.105.0 core: | Show help on nushell aliases. usage: | diff --git a/commands/docs/help_commands.md b/commands/docs/help_commands.md index e83c9b2fcaf..5f8d518a85f 100644 --- a/commands/docs/help_commands.md +++ b/commands/docs/help_commands.md @@ -2,7 +2,7 @@ title: help commands categories: | core -version: 0.104.0 +version: 0.105.0 core: | Show help on nushell commands. usage: | diff --git a/commands/docs/help_escapes.md b/commands/docs/help_escapes.md index 028038ac006..711808d5daf 100644 --- a/commands/docs/help_escapes.md +++ b/commands/docs/help_escapes.md @@ -2,7 +2,7 @@ title: help escapes categories: | core -version: 0.104.0 +version: 0.105.0 core: | Show help on nushell string escapes. usage: | diff --git a/commands/docs/help_externs.md b/commands/docs/help_externs.md index fb8c6a56025..8dd87001074 100644 --- a/commands/docs/help_externs.md +++ b/commands/docs/help_externs.md @@ -2,7 +2,7 @@ title: help externs categories: | core -version: 0.104.0 +version: 0.105.0 core: | Show help on nushell externs. usage: | diff --git a/commands/docs/help_modules.md b/commands/docs/help_modules.md index fc4927a215b..b76810b67f6 100644 --- a/commands/docs/help_modules.md +++ b/commands/docs/help_modules.md @@ -2,7 +2,7 @@ title: help modules categories: | core -version: 0.104.0 +version: 0.105.0 core: | Show help on nushell modules. usage: | diff --git a/commands/docs/help_operators.md b/commands/docs/help_operators.md index 55e2ae74358..62e6f350133 100644 --- a/commands/docs/help_operators.md +++ b/commands/docs/help_operators.md @@ -2,7 +2,7 @@ title: help operators categories: | core -version: 0.104.0 +version: 0.105.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 9a4f5125efa..e4a6fdbfc03 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.104.0 +version: 0.105.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 35018d1a1fa..96b69b89512 100644 --- a/commands/docs/hide-env.md +++ b/commands/docs/hide-env.md @@ -2,7 +2,7 @@ title: hide-env categories: | core -version: 0.104.0 +version: 0.105.0 core: | Hide environment variables in the current scope. usage: | diff --git a/commands/docs/hide.md b/commands/docs/hide.md index c811e59ff60..bf16b2ef47d 100644 --- a/commands/docs/hide.md +++ b/commands/docs/hide.md @@ -2,7 +2,7 @@ title: hide categories: | core -version: 0.104.0 +version: 0.105.0 core: | Hide definitions in the current scope. usage: | diff --git a/commands/docs/histogram.md b/commands/docs/histogram.md index 5754aff9d1d..500ac85e5be 100644 --- a/commands/docs/histogram.md +++ b/commands/docs/histogram.md @@ -2,7 +2,7 @@ title: histogram categories: | chart -version: 0.104.0 +version: 0.105.0 chart: | Creates a new table with a histogram based on the column name passed in. usage: | @@ -34,7 +34,7 @@ contributors: false | input | output | | --------- | ------ | -| list\ | table | +| list<any> | table | ## Examples Compute a histogram of file types diff --git a/commands/docs/history.md b/commands/docs/history.md index ebb67ef21aa..cf133a8eb13 100644 --- a/commands/docs/history.md +++ b/commands/docs/history.md @@ -2,7 +2,7 @@ title: history categories: | history -version: 0.104.0 +version: 0.105.0 history: | Get the command history. usage: | diff --git a/commands/docs/history_import.md b/commands/docs/history_import.md index 80dd393b850..d25877ddf49 100644 --- a/commands/docs/history_import.md +++ b/commands/docs/history_import.md @@ -2,7 +2,7 @@ title: history import categories: | history -version: 0.104.0 +version: 0.105.0 history: | Import command line history. usage: | @@ -25,9 +25,9 @@ contributors: false | input | output | | ------------ | ------- | -| list\ | nothing | | nothing | nothing | | string | nothing | +| list<string> | nothing | | table | nothing | ## Examples @@ -51,7 +51,7 @@ Append `foo` ran from `/home` to the current history ## Notes Can import history from input, either successive command lines or more detailed records. If providing records, available fields are: - command_line, id, start_timestamp, hostname, cwd, duration, exit_status. + command, start_timestamp, hostname, cwd, duration, exit_status. If no input is provided, will import all history items from existing history in the other format: if current history is stored in sqlite, it will store it in plain text and vice versa. diff --git a/commands/docs/history_session.md b/commands/docs/history_session.md index a7913b7166e..d28e1435d60 100644 --- a/commands/docs/history_session.md +++ b/commands/docs/history_session.md @@ -2,7 +2,7 @@ title: history session categories: | history -version: 0.104.0 +version: 0.105.0 history: | Get the command history session. usage: | diff --git a/commands/docs/http.md b/commands/docs/http.md index 8adf5b8177f..e4f6dd29848 100644 --- a/commands/docs/http.md +++ b/commands/docs/http.md @@ -2,7 +2,7 @@ title: http categories: | network -version: 0.104.0 +version: 0.105.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 316309080fe..a428e4d60d2 100644 --- a/commands/docs/http_delete.md +++ b/commands/docs/http_delete.md @@ -2,7 +2,7 @@ title: http delete categories: | network -version: 0.104.0 +version: 0.105.0 network: | Delete the specified resource. usage: | @@ -58,9 +58,15 @@ http delete from example.com, with username and password ``` -http delete from example.com, with custom header +http delete from example.com, with custom header using a record ```nu -> http delete --headers [my-header-key my-header-value] https://www.example.com +> http delete --headers {my-header-key: my-header-value} https://www.example.com + +``` + +http delete from example.com, with custom header using a list +```nu +> http delete --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com ``` diff --git a/commands/docs/http_get.md b/commands/docs/http_get.md index efc416ec4d8..65527757c70 100644 --- a/commands/docs/http_get.md +++ b/commands/docs/http_get.md @@ -2,7 +2,7 @@ title: http get categories: | network -version: 0.104.0 +version: 0.105.0 network: | Fetch the contents from a URL. usage: | @@ -56,13 +56,13 @@ Get content from example.com, with username and password ``` -Get content from example.com, with custom header +Get content from example.com, with custom header using a record ```nu -> http get --headers [my-header-key my-header-value] https://www.example.com +> http get --headers {my-header-key: my-header-value} https://www.example.com ``` -Get content from example.com, with custom headers +Get content from example.com, with custom headers using a list ```nu > http get --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com diff --git a/commands/docs/http_head.md b/commands/docs/http_head.md index 452ca01998c..e839f70c9dc 100644 --- a/commands/docs/http_head.md +++ b/commands/docs/http_head.md @@ -2,7 +2,7 @@ title: http head categories: | network -version: 0.104.0 +version: 0.105.0 network: | Get the headers from a URL. usage: | @@ -53,9 +53,15 @@ Get headers from example.com, with username and password ``` -Get headers from example.com, with custom header +Get headers from example.com, with custom header using a record ```nu -> http head --headers [my-header-key my-header-value] https://www.example.com +> http head --headers {my-header-key: my-header-value} https://www.example.com + +``` + +Get headers from example.com, with custom header using a list +```nu +> http head --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com ``` diff --git a/commands/docs/http_options.md b/commands/docs/http_options.md index 5caa499ec03..612b3a0912d 100644 --- a/commands/docs/http_options.md +++ b/commands/docs/http_options.md @@ -2,7 +2,7 @@ title: http options categories: | network -version: 0.104.0 +version: 0.105.0 network: | Requests permitted communication options for a given URL. usage: | @@ -53,13 +53,13 @@ Get options from example.com, with username and password ``` -Get options from example.com, with custom header +Get options from example.com, with custom header using a record ```nu -> http options --headers [my-header-key my-header-value] https://www.example.com +> http options --headers {my-header-key: my-header-value} https://www.example.com ``` -Get options from example.com, with custom headers +Get options from example.com, with custom headers using a list ```nu > http options --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com diff --git a/commands/docs/http_patch.md b/commands/docs/http_patch.md index d4e249ccd57..474893fb276 100644 --- a/commands/docs/http_patch.md +++ b/commands/docs/http_patch.md @@ -2,7 +2,7 @@ title: http patch categories: | network -version: 0.104.0 +version: 0.105.0 network: | Patch a body to a URL. usage: | @@ -58,9 +58,15 @@ Patch content to example.com, with username and password ``` -Patch content to example.com, with custom header +Patch content to example.com, with custom header using a record ```nu -> http patch --headers [my-header-key my-header-value] https://www.example.com +> http patch --headers {my-header-key: my-header-value} https://www.example.com + +``` + +Patch content to example.com, with custom header using a list +```nu +> http patch --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com ``` diff --git a/commands/docs/http_post.md b/commands/docs/http_post.md index 181fbf8f3ee..f7c38718da2 100644 --- a/commands/docs/http_post.md +++ b/commands/docs/http_post.md @@ -2,7 +2,7 @@ title: http post categories: | network -version: 0.104.0 +version: 0.105.0 network: | Post a body to a URL. usage: | @@ -58,9 +58,15 @@ Post content to example.com, with username and password ``` -Post content to example.com, with custom header +Post content to example.com, with custom header using a record ```nu -> http post --headers [my-header-key my-header-value] https://www.example.com +> http post --headers {my-header-key: my-header-value} https://www.example.com + +``` + +Post content to example.com, with custom header using a list +```nu +> http post --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com ``` diff --git a/commands/docs/http_put.md b/commands/docs/http_put.md index 881f838373f..3b4b5fe58fc 100644 --- a/commands/docs/http_put.md +++ b/commands/docs/http_put.md @@ -2,7 +2,7 @@ title: http put categories: | network -version: 0.104.0 +version: 0.105.0 network: | Put a body to a URL. usage: | @@ -58,9 +58,15 @@ Put content to example.com, with username and password ``` -Put content to example.com, with custom header +Put content to example.com, with custom header using a record ```nu -> http put --headers [my-header-key my-header-value] https://www.example.com +> http put --headers {my-header-key: my-header-value} https://www.example.com + +``` + +Put content to example.com, with custom header using a list +```nu +> http put --headers [my-header-key-A my-header-value-A my-header-key-B my-header-value-B] https://www.example.com ``` diff --git a/commands/docs/if.md b/commands/docs/if.md index 8293752b8fa..6bbe9ed3866 100644 --- a/commands/docs/if.md +++ b/commands/docs/if.md @@ -2,7 +2,7 @@ title: if categories: | core -version: 0.104.0 +version: 0.105.0 core: | Conditionally run a block. usage: | diff --git a/commands/docs/ignore.md b/commands/docs/ignore.md index 4a9991918c1..1f3ecd242b9 100644 --- a/commands/docs/ignore.md +++ b/commands/docs/ignore.md @@ -2,7 +2,7 @@ title: ignore categories: | core -version: 0.104.0 +version: 0.105.0 core: | Ignore the output of the previous command in the pipeline. usage: | diff --git a/commands/docs/inc.md b/commands/docs/inc.md index d6423804131..d383ec3b5ab 100644 --- a/commands/docs/inc.md +++ b/commands/docs/inc.md @@ -2,7 +2,7 @@ title: inc categories: | default -version: 0.104.0 +version: 0.105.0 default: | Increment a value or version. Optionally use the column of a table. usage: | @@ -36,10 +36,3 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Parameters - `cell_path`: cell path to update - - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | \ No newline at end of file diff --git a/commands/docs/input.md b/commands/docs/input.md index 840bc97a287..f0bf6d7df94 100644 --- a/commands/docs/input.md +++ b/commands/docs/input.md @@ -2,7 +2,7 @@ title: input categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Get input from the user. usage: | @@ -25,6 +25,9 @@ contributors: false - `--bytes-until-any, -u {string}`: read bytes (not text) until any of the given stop bytes is seen - `--numchar, -n {int}`: number of characters to read; suppresses output - `--default, -d {string}`: default value if no input is provided + - `--reedline`: use the reedline library, defaults to false + - `--history-file {path}`: Path to a file to read and write command history. This is a text file and will be created if it doesn't exist. Will be used as the selection list. + - `--max-history {int}`: The maximum number of entries to keep in the history, defaults to $env.config.history.max_size. - `--suppress-output, -s`: don't print keystroke values ## Parameters @@ -34,9 +37,10 @@ contributors: false ## Input/output types: -| input | output | -| ------- | ------ | -| nothing | any | +| input | output | +| ------------ | ------ | +| nothing | any | +| list<string> | any | ## Examples Get input from the user, and assign to a variable @@ -57,6 +61,18 @@ Get input from the user with default value, and assign to a variable ``` +Get input from the user with history, and assign to a variable +```nu +> let user_input = ([past,command,entries] | input ) + +``` + +Get input from the user with history backed by a file, and assign to a variable +```nu +> let user_input = (input --history-file ./history.txt) + +``` + ## Subcommands: diff --git a/commands/docs/input_list.md b/commands/docs/input_list.md index 37492d5fb69..3f7d82bbe3f 100644 --- a/commands/docs/input_list.md +++ b/commands/docs/input_list.md @@ -2,7 +2,7 @@ title: input list categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Interactive list selection. usage: | @@ -36,7 +36,7 @@ contributors: false | input | output | | --------- | ------ | -| list\ | any | +| list<any> | any | | range | int | ## Examples diff --git a/commands/docs/input_listen.md b/commands/docs/input_listen.md index 1a558303f2d..8ee6196acc9 100644 --- a/commands/docs/input_listen.md +++ b/commands/docs/input_listen.md @@ -2,7 +2,7 @@ title: input listen categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Listen for user interface event. usage: | @@ -30,7 +30,7 @@ contributors: false | input | output | | ------- | ------------------------------------------------ | -| nothing | record\\> | +| nothing | record<keycode: 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 a92ec2b4899..a3a67021580 100644 --- a/commands/docs/insert.md +++ b/commands/docs/insert.md @@ -2,7 +2,7 @@ title: insert categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Insert a new column, using an expression or closure to create each row's values. usage: | @@ -30,9 +30,9 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | | record | record | | table | table | +| list<any> | list<any> | ## Examples Insert a new entry into a single record diff --git a/commands/docs/inspect.md b/commands/docs/inspect.md index a120daec9a1..2c55aa7522b 100644 --- a/commands/docs/inspect.md +++ b/commands/docs/inspect.md @@ -2,7 +2,7 @@ title: inspect categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | Inspect pipeline results while running a pipeline. usage: | diff --git a/commands/docs/interleave.md b/commands/docs/interleave.md index a3c657fc57f..335a1826c1f 100644 --- a/commands/docs/interleave.md +++ b/commands/docs/interleave.md @@ -2,7 +2,7 @@ title: interleave categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Read multiple streams in parallel and combine them into one stream. usage: | @@ -33,8 +33,8 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | -| nothing | list\ | +| list<any> | list<any> | +| nothing | list<any> | ## Examples Read two sequences of numbers into separate columns of a table. diff --git a/commands/docs/into.md b/commands/docs/into.md index 30b963095d0..63a027fc391 100644 --- a/commands/docs/into.md +++ b/commands/docs/into.md @@ -2,7 +2,7 @@ title: into categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Commands to convert data from one type to another. usage: | diff --git a/commands/docs/into_binary.md b/commands/docs/into_binary.md index afd4c13cba9..dacebbc5450 100644 --- a/commands/docs/into_binary.md +++ b/commands/docs/into_binary.md @@ -2,7 +2,7 @@ title: into binary categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert value to a binary primitive. usage: | @@ -34,14 +34,14 @@ contributors: false | input | output | | -------- | ------ | | binary | binary | -| bool | binary | -| datetime | binary | -| filesize | binary | | int | binary | | number | binary | -| record | record | | string | binary | +| bool | binary | +| filesize | binary | +| datetime | binary | | table | table | +| record | record | ## Examples convert string to a nushell binary primitive diff --git a/commands/docs/into_bool.md b/commands/docs/into_bool.md index eb532f2fa85..8828274351a 100644 --- a/commands/docs/into_bool.md +++ b/commands/docs/into_bool.md @@ -2,7 +2,7 @@ title: into bool categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert value to boolean. usage: | @@ -33,14 +33,14 @@ contributors: false | input | output | | --------- | ------ | -| bool | bool | | int | bool | -| list\ | table | -| nothing | bool | | number | bool | -| record | record | | string | bool | +| bool | bool | +| nothing | bool | +| list<any> | table | | table | table | +| record | record | ## Examples Convert value to boolean in table diff --git a/commands/docs/into_cell-path.md b/commands/docs/into_cell-path.md index 668984b0543..2948aea4a6f 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.104.0 +version: 0.105.0 conversions: | Convert value to a cell-path. usage: | @@ -23,12 +23,12 @@ contributors: false ## Input/output types: -| input | output | -| ---------------------------------------- | --------- | -| cell-path | cell-path | -| int | cell-path | -| list\ | cell-path | -| list\\> | cell-path | +| input | output | +| ----------------------------------------------------------- | --------- | +| cell-path | cell-path | +| int | cell-path | +| list<any> | cell-path | +| list<record<value: any, optional: bool, insensitive: bool>> | cell-path | ## Examples Convert integer into cell path @@ -57,8 +57,8 @@ $.5.c.7.h Convert table into cell path ```nu -> [[value, optional]; [5 true] [c false]] | into cell-path -$.5?.c +> [[value, optional, insensitive]; [5 true false] [c false false] [d false true]] | into cell-path +$.5?.c.d! ``` ## Notes diff --git a/commands/docs/into_datetime.md b/commands/docs/into_datetime.md index 23142a0a0cf..ac91fb3a7d1 100644 --- a/commands/docs/into_datetime.md +++ b/commands/docs/into_datetime.md @@ -2,7 +2,7 @@ title: into datetime categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert text or timestamp into a datetime. usage: | @@ -36,14 +36,16 @@ contributors: false | input | output | | ------------ | -------------- | -| any | table | | datetime | datetime | | int | datetime | -| list\ | list\ | -| nothing | table | -| record | any | | string | datetime | +| list<string> | list<datetime> | | table | table | +| nothing | table | +| record | any | +| record | record | +| record | datetime | +| any | table | ## Examples Convert timestamp string to datetime with timezone offset @@ -91,7 +93,7 @@ Sat, 27 Feb 2021 13:55:40 +0000 (4 years ago) Using a record as input ```nu > {year: 2025, month: 3, day: 30, hour: 12, minute: 15, second: 59, timezone: '+02:00'} | into datetime -Sun, 30 Mar 2025 10:15:59 +0000 (a month ago) +Sun, 30 Mar 2025 10:15:59 +0000 (2 months ago) ``` Convert list of timestamps to datetimes diff --git a/commands/docs/into_duration.md b/commands/docs/into_duration.md index fd7100f7301..876e003aa8a 100644 --- a/commands/docs/into_duration.md +++ b/commands/docs/into_duration.md @@ -2,7 +2,7 @@ title: into duration categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert value to duration. usage: | @@ -33,11 +33,13 @@ contributors: false | input | output | | -------- | -------- | -| duration | duration | -| float | duration | | int | duration | -| record | any | +| float | duration | | string | duration | +| duration | duration | +| record | any | +| record | record | +| record | duration | | table | table | ## Examples diff --git a/commands/docs/into_filesize.md b/commands/docs/into_filesize.md index ce2b271dd50..dc605c88c0f 100644 --- a/commands/docs/into_filesize.md +++ b/commands/docs/into_filesize.md @@ -2,7 +2,7 @@ title: into filesize categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert value to filesize. usage: | @@ -29,17 +29,17 @@ contributors: false | input | output | | -------------- | -------------- | -| filesize | filesize | | int | filesize | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | | number | filesize | -| record | record | | string | filesize | +| filesize | filesize | | table | table | +| record | record | +| list<int> | list<filesize> | +| list<number> | list<filesize> | +| list<string> | list<filesize> | +| list<filesize> | list<filesize> | +| list<any> | list<filesize> | ## Examples Convert string to filesize in table diff --git a/commands/docs/into_float.md b/commands/docs/into_float.md index 26314e83681..b3cb4ecf52d 100644 --- a/commands/docs/into_float.md +++ b/commands/docs/into_float.md @@ -2,7 +2,7 @@ title: into float categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert data into floating point number. usage: | @@ -29,13 +29,13 @@ contributors: false | input | output | | --------- | ----------- | -| bool | float | -| float | float | | int | float | -| list\ | list\ | -| record | record | | string | float | +| bool | float | +| float | float | | table | table | +| record | record | +| list<any> | list<float> | ## Examples Convert string to float in table diff --git a/commands/docs/into_glob.md b/commands/docs/into_glob.md index d32881383a2..ea129924b39 100644 --- a/commands/docs/into_glob.md +++ b/commands/docs/into_glob.md @@ -2,7 +2,7 @@ title: into glob categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert value to glob. usage: | @@ -30,10 +30,10 @@ contributors: false | input | output | | ------------ | ---------- | | glob | glob | -| list\ | list\ | -| record | record | | string | glob | +| list<string> | list<glob> | | table | table | +| record | record | ## Examples convert string to glob diff --git a/commands/docs/into_int.md b/commands/docs/into_int.md index f8b76c84d4d..33f3047e912 100644 --- a/commands/docs/into_int.md +++ b/commands/docs/into_int.md @@ -2,7 +2,7 @@ title: into int categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert value to integer. usage: | @@ -35,22 +35,22 @@ contributors: false | input | output | | -------------- | --------- | -| binary | int | +| string | int | +| number | int | | bool | int | | datetime | int | | duration | int | | filesize | int | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | -| number | int | -| record | record | -| string | int | +| binary | int | | table | table | +| record | record | +| list<string> | list<int> | +| list<number> | list<int> | +| list<bool> | list<int> | +| list<datetime> | list<int> | +| list<duration> | list<int> | +| list<filesize> | list<int> | +| list<any> | list<int> | ## Examples Convert string to int in table diff --git a/commands/docs/into_record.md b/commands/docs/into_record.md index 16b5507888f..a0c3e8898d2 100644 --- a/commands/docs/into_record.md +++ b/commands/docs/into_record.md @@ -2,7 +2,7 @@ title: into record categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert value to record. usage: | @@ -27,7 +27,7 @@ contributors: false | --------- | ------ | | datetime | record | | duration | record | -| list\ | record | +| list<any> | record | | record | record | ## Examples diff --git a/commands/docs/into_sqlite.md b/commands/docs/into_sqlite.md index be6f7771e3b..3fcc6e08b38 100644 --- a/commands/docs/into_sqlite.md +++ b/commands/docs/into_sqlite.md @@ -2,7 +2,7 @@ title: into sqlite categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert table into a SQLite database. usage: | @@ -33,8 +33,8 @@ contributors: false | input | output | | ------ | ------- | -| record | nothing | | table | nothing | +| record | nothing | ## Examples Convert ls entries into a SQLite database with 'main' as the table name diff --git a/commands/docs/into_string.md b/commands/docs/into_string.md index 7e9ea60ef41..e47de5aec9c 100644 --- a/commands/docs/into_string.md +++ b/commands/docs/into_string.md @@ -2,7 +2,7 @@ title: into string categories: | conversions -version: 0.104.0 +version: 0.105.0 conversions: | Convert value to string. usage: | @@ -35,18 +35,18 @@ contributors: false | input | output | | --------- | ------------ | | binary | string | +| int | string | +| number | string | +| string | string | +| glob | string | | bool | string | +| filesize | string | | datetime | string | | duration | string | -| filesize | string | -| glob | string | -| int | string | -| list\ | list\ | -| number | string | | range | string | -| record | record | -| string | string | +| list<any> | list<string> | | table | table | +| record | record | ## Examples convert int to string and append three decimal places diff --git a/commands/docs/into_value.md b/commands/docs/into_value.md index cd30caccd39..4e9082a86da 100644 --- a/commands/docs/into_value.md +++ b/commands/docs/into_value.md @@ -2,7 +2,7 @@ title: into value categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Infer Nushell datatype for each cell. usage: | diff --git a/commands/docs/is-admin.md b/commands/docs/is-admin.md index 80edd8757bd..83c6bcb70b2 100644 --- a/commands/docs/is-admin.md +++ b/commands/docs/is-admin.md @@ -2,7 +2,7 @@ title: is-admin categories: | core -version: 0.104.0 +version: 0.105.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 35b70eff393..4f9b3059075 100644 --- a/commands/docs/is-empty.md +++ b/commands/docs/is-empty.md @@ -2,7 +2,7 @@ title: is-empty categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Check for empty values. usage: | diff --git a/commands/docs/is-not-empty.md b/commands/docs/is-not-empty.md index 746cf74aa2c..6b10eed7af2 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.104.0 +version: 0.105.0 filters: | Check for non-empty values. usage: | diff --git a/commands/docs/is-terminal.md b/commands/docs/is-terminal.md index 3c7440f2c5c..5f899c1f740 100644 --- a/commands/docs/is-terminal.md +++ b/commands/docs/is-terminal.md @@ -2,7 +2,7 @@ title: is-terminal categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Check if stdin, stdout, or stderr is a terminal. usage: | diff --git a/commands/docs/items.md b/commands/docs/items.md index 4071fa328ae..97c975b7e5f 100644 --- a/commands/docs/items.md +++ b/commands/docs/items.md @@ -2,7 +2,7 @@ title: items categories: | filters -version: 0.104.0 +version: 0.105.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 3fe9c1670ef..fea8db06cf5 100644 --- a/commands/docs/job.md +++ b/commands/docs/job.md @@ -2,7 +2,7 @@ title: job categories: | experimental -version: 0.104.0 +version: 0.105.0 experimental: | Various commands for working with background jobs. usage: | diff --git a/commands/docs/job_flush.md b/commands/docs/job_flush.md index 405f7272b1b..5cf4497054e 100644 --- a/commands/docs/job_flush.md +++ b/commands/docs/job_flush.md @@ -2,7 +2,7 @@ title: job flush categories: | experimental -version: 0.104.0 +version: 0.105.0 experimental: | Clear this job's mailbox. usage: | diff --git a/commands/docs/job_id.md b/commands/docs/job_id.md index d1299049703..d25f147c70d 100644 --- a/commands/docs/job_id.md +++ b/commands/docs/job_id.md @@ -2,7 +2,7 @@ title: job id categories: | experimental -version: 0.104.0 +version: 0.105.0 experimental: | Get id of current job. usage: | diff --git a/commands/docs/job_kill.md b/commands/docs/job_kill.md index 26157f8f81a..1058043a42d 100644 --- a/commands/docs/job_kill.md +++ b/commands/docs/job_kill.md @@ -2,7 +2,7 @@ title: job kill categories: | experimental -version: 0.104.0 +version: 0.105.0 experimental: | Kill a background job. usage: | diff --git a/commands/docs/job_list.md b/commands/docs/job_list.md index 9ebef6123fe..1c5c128a378 100644 --- a/commands/docs/job_list.md +++ b/commands/docs/job_list.md @@ -2,7 +2,7 @@ title: job list categories: | experimental -version: 0.104.0 +version: 0.105.0 experimental: | List background jobs. usage: | diff --git a/commands/docs/job_recv.md b/commands/docs/job_recv.md index 5bf353b08f3..5fa3029fecd 100644 --- a/commands/docs/job_recv.md +++ b/commands/docs/job_recv.md @@ -2,7 +2,7 @@ title: job recv categories: | experimental -version: 0.104.0 +version: 0.105.0 experimental: | Read a message from the mailbox. usage: | @@ -54,7 +54,7 @@ Get a message or fail if no message is available immediately ## Notes When messages are sent to the current process, they get stored in what is called the "mailbox". This commands reads and returns a message from the mailbox, in a first-in-first-out fashion. -j + Messages may have numeric flags attached to them. This commands supports filtering out messages that do not satisfy a given tag, by using the `tag` flag. If no tag is specified, this command will accept any message. diff --git a/commands/docs/job_send.md b/commands/docs/job_send.md index c631550fd4c..9a848b3f218 100644 --- a/commands/docs/job_send.md +++ b/commands/docs/job_send.md @@ -2,7 +2,7 @@ title: job send categories: | experimental -version: 0.104.0 +version: 0.105.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 fa066fdb32b..58f8ea86040 100644 --- a/commands/docs/job_spawn.md +++ b/commands/docs/job_spawn.md @@ -2,7 +2,7 @@ title: job spawn categories: | experimental -version: 0.104.0 +version: 0.105.0 experimental: | Spawn a background job and retrieve its ID. usage: | diff --git a/commands/docs/job_tag.md b/commands/docs/job_tag.md index 09e7d85f3f4..e5c53310083 100644 --- a/commands/docs/job_tag.md +++ b/commands/docs/job_tag.md @@ -2,7 +2,7 @@ title: job tag categories: | experimental -version: 0.104.0 +version: 0.105.0 experimental: | Add a description tag to a background job. usage: | diff --git a/commands/docs/job_unfreeze.md b/commands/docs/job_unfreeze.md index 7aef8388db3..7473084c8ec 100644 --- a/commands/docs/job_unfreeze.md +++ b/commands/docs/job_unfreeze.md @@ -2,7 +2,7 @@ title: job unfreeze categories: | experimental -version: 0.104.0 +version: 0.105.0 experimental: | Unfreeze a frozen process job in foreground. usage: | diff --git a/commands/docs/join.md b/commands/docs/join.md index 34b6dc3e3e9..9dec58b72f5 100644 --- a/commands/docs/join.md +++ b/commands/docs/join.md @@ -2,7 +2,7 @@ title: join categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Join two tables. usage: | diff --git a/commands/docs/keybindings.md b/commands/docs/keybindings.md index cce61e6125b..613d03f2caa 100644 --- a/commands/docs/keybindings.md +++ b/commands/docs/keybindings.md @@ -2,7 +2,7 @@ title: keybindings categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Keybindings related commands. usage: | diff --git a/commands/docs/keybindings_default.md b/commands/docs/keybindings_default.md index 8e06d78d3d2..fa74df29eee 100644 --- a/commands/docs/keybindings_default.md +++ b/commands/docs/keybindings_default.md @@ -2,7 +2,7 @@ title: keybindings default categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | List default keybindings. usage: | diff --git a/commands/docs/keybindings_list.md b/commands/docs/keybindings_list.md index 396c68af2ca..ae385660e57 100644 --- a/commands/docs/keybindings_list.md +++ b/commands/docs/keybindings_list.md @@ -2,7 +2,7 @@ title: keybindings list categories: | platform -version: 0.104.0 +version: 0.105.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 2583236e45a..5a7ba957ca6 100644 --- a/commands/docs/keybindings_listen.md +++ b/commands/docs/keybindings_listen.md @@ -2,7 +2,7 @@ title: keybindings listen categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Get input from the user. usage: | diff --git a/commands/docs/kill.md b/commands/docs/kill.md index 20fa5863fee..c6292509ab2 100644 --- a/commands/docs/kill.md +++ b/commands/docs/kill.md @@ -2,7 +2,7 @@ title: kill categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Kill a process using the process id. usage: | diff --git a/commands/docs/last.md b/commands/docs/last.md index 3feaaa5e6ef..0c1e65f0820 100644 --- a/commands/docs/last.md +++ b/commands/docs/last.md @@ -2,7 +2,7 @@ title: last categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Return only the last several rows of the input. Counterpart of `first`. Opposite of `drop`. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | --------- | ------ | +| list<any> | any | | binary | binary | -| list\ | any | | range | any | ## Examples diff --git a/commands/docs/length.md b/commands/docs/length.md index d4bfe4437fd..861c4ea159a 100644 --- a/commands/docs/length.md +++ b/commands/docs/length.md @@ -2,7 +2,7 @@ title: length categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Count the number of items in an input list, rows in a table, or bytes in binary data. usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | --------- | ------ | +| list<any> | int | | binary | int | -| list\ | int | | nothing | int | ## Examples diff --git a/commands/docs/let-env.md b/commands/docs/let-env.md index af55fbfd5fa..3ddf5d5c600 100644 --- a/commands/docs/let-env.md +++ b/commands/docs/let-env.md @@ -2,7 +2,7 @@ title: let-env categories: | removed -version: 0.104.0 +version: 0.105.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 8682b480bd6..b09475f63ab 100644 --- a/commands/docs/let.md +++ b/commands/docs/let.md @@ -2,7 +2,7 @@ title: let categories: | core -version: 0.104.0 +version: 0.105.0 core: | Create a variable and give it a value. usage: | diff --git a/commands/docs/lines.md b/commands/docs/lines.md index c9c976e72f2..723bab3330a 100644 --- a/commands/docs/lines.md +++ b/commands/docs/lines.md @@ -2,7 +2,7 @@ title: lines categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Converts input to lines. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | ----- | ------------ | -| any | list\ | +| any | list<string> | ## Examples Split multi-line string into lines diff --git a/commands/docs/load-env.md b/commands/docs/load-env.md index c3ba5f4d266..b6d8bd17331 100644 --- a/commands/docs/load-env.md +++ b/commands/docs/load-env.md @@ -2,7 +2,7 @@ title: load-env categories: | filesystem -version: 0.104.0 +version: 0.105.0 filesystem: | Loads an environment update from a record. usage: | @@ -29,9 +29,9 @@ contributors: false | input | output | | ------- | ------- | -| any | nothing | -| nothing | nothing | | record | nothing | +| nothing | nothing | +| any | nothing | ## Examples Load variables from an input stream diff --git a/commands/docs/loop.md b/commands/docs/loop.md index 66b8a6add65..fe672520cf8 100644 --- a/commands/docs/loop.md +++ b/commands/docs/loop.md @@ -2,7 +2,7 @@ title: loop categories: | core -version: 0.104.0 +version: 0.105.0 core: | Run a block in a loop. usage: | diff --git a/commands/docs/ls.md b/commands/docs/ls.md index d3bf7cf8135..a5be382f196 100644 --- a/commands/docs/ls.md +++ b/commands/docs/ls.md @@ -2,7 +2,7 @@ title: ls categories: | filesystem -version: 0.104.0 +version: 0.105.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 19dd3dfa7f9..53839644f7e 100644 --- a/commands/docs/match.md +++ b/commands/docs/match.md @@ -2,7 +2,7 @@ title: match categories: | core -version: 0.104.0 +version: 0.105.0 core: | Conditionally run a block on a matched value. usage: | @@ -33,6 +33,18 @@ contributors: false | any | any | ## Examples +Match on a value +```nu +> match 3 { 1 => 'one', 2 => 'two', 3 => 'three' } +three +``` + +Match against alternative values +```nu +> match 'three' { 1 | 'one' => '-', 2 | 'two' => '--', 3 | 'three' => '---' } +--- +``` + Match on a value in range ```nu > match 3 { 1..10 => 'yes!' } diff --git a/commands/docs/math.md b/commands/docs/math.md index e9d1ed9c736..41392c7c2f8 100644 --- a/commands/docs/math.md +++ b/commands/docs/math.md @@ -2,7 +2,7 @@ title: math categories: | math -version: 0.104.0 +version: 0.105.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 d2e5f2175f7..442d8ecbefc 100644 --- a/commands/docs/math_abs.md +++ b/commands/docs/math_abs.md @@ -2,7 +2,7 @@ title: math abs categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the absolute value of a number. usage: | @@ -25,11 +25,11 @@ contributors: false | input | output | | -------------- | -------------- | -| duration | duration | -| list\ | list\ | -| list\ | list\ | | number | number | -| range | list\ | +| duration | duration | +| list<number> | list<number> | +| list<duration> | list<duration> | +| range | list<number> | ## Examples Compute absolute value of each number in a list of numbers diff --git a/commands/docs/math_arccos.md b/commands/docs/math_arccos.md index 283dd03ffd3..6d0457822da 100644 --- a/commands/docs/math_arccos.md +++ b/commands/docs/math_arccos.md @@ -2,7 +2,7 @@ title: math arccos categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the arccosine of the number. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Get the arccosine of 1 diff --git a/commands/docs/math_arccosh.md b/commands/docs/math_arccosh.md index b2036170d7c..4d9857fbec7 100644 --- a/commands/docs/math_arccosh.md +++ b/commands/docs/math_arccosh.md @@ -2,7 +2,7 @@ title: math arccosh categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the inverse of the hyperbolic cosine function. usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Get the arccosh of 1 diff --git a/commands/docs/math_arcsin.md b/commands/docs/math_arcsin.md index 1cb6f914884..8321576ae5f 100644 --- a/commands/docs/math_arcsin.md +++ b/commands/docs/math_arcsin.md @@ -2,7 +2,7 @@ title: math arcsin categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the arcsine of the number. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Get the arcsine of 1 diff --git a/commands/docs/math_arcsinh.md b/commands/docs/math_arcsinh.md index e72ecdc48a3..ae7a24621f5 100644 --- a/commands/docs/math_arcsinh.md +++ b/commands/docs/math_arcsinh.md @@ -2,7 +2,7 @@ title: math arcsinh categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the inverse of the hyperbolic sine function. usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Get the arcsinh of 0 diff --git a/commands/docs/math_arctan.md b/commands/docs/math_arctan.md index b7410096067..781df6fbdfb 100644 --- a/commands/docs/math_arctan.md +++ b/commands/docs/math_arctan.md @@ -2,7 +2,7 @@ title: math arctan categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the arctangent of the number. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Get the arctangent of 1 diff --git a/commands/docs/math_arctanh.md b/commands/docs/math_arctanh.md index ea90af9102b..27f6f7d3449 100644 --- a/commands/docs/math_arctanh.md +++ b/commands/docs/math_arctanh.md @@ -2,7 +2,7 @@ title: math arctanh categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the inverse of the hyperbolic tangent function. usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Get the arctanh of 1 diff --git a/commands/docs/math_avg.md b/commands/docs/math_avg.md index 51252f5abb7..f2d4646b459 100644 --- a/commands/docs/math_avg.md +++ b/commands/docs/math_avg.md @@ -2,7 +2,7 @@ title: math avg categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the average of a list of numbers. usage: | @@ -25,15 +25,15 @@ contributors: false | input | output | | -------------- | -------- | +| list<duration> | duration | | duration | duration | +| list<filesize> | filesize | | filesize | filesize | -| list\ | duration | -| list\ | filesize | -| list\ | number | +| list<number> | number | | number | number | | range | number | -| record | record | | table | record | +| record | record | ## Examples Compute the average of a list of numbers diff --git a/commands/docs/math_ceil.md b/commands/docs/math_ceil.md index 83010108a6a..fa0d3fb36e8 100644 --- a/commands/docs/math_ceil.md +++ b/commands/docs/math_ceil.md @@ -2,7 +2,7 @@ title: math ceil categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the ceil of a number (smallest integer greater than or equal to that number). usage: | @@ -25,9 +25,9 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | | number | int | -| range | list\ | +| list<number> | list<int> | +| range | list<number> | ## Examples Apply the ceil function to a list of numbers diff --git a/commands/docs/math_cos.md b/commands/docs/math_cos.md index 181f8bf9f96..a1be9c5492d 100644 --- a/commands/docs/math_cos.md +++ b/commands/docs/math_cos.md @@ -2,7 +2,7 @@ title: math cos categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the cosine of the number. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Apply the cosine to π diff --git a/commands/docs/math_cosh.md b/commands/docs/math_cosh.md index a7af86cb5a8..96f9fa763f5 100644 --- a/commands/docs/math_cosh.md +++ b/commands/docs/math_cosh.md @@ -2,7 +2,7 @@ title: math cosh categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the hyperbolic cosine of the number. usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Apply the hyperbolic cosine to 1 diff --git a/commands/docs/math_exp.md b/commands/docs/math_exp.md index 132b9646cba..3ddf700fe18 100644 --- a/commands/docs/math_exp.md +++ b/commands/docs/math_exp.md @@ -2,7 +2,7 @@ title: math exp categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns e raised to the power of x. usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Get e raised to the power of zero diff --git a/commands/docs/math_floor.md b/commands/docs/math_floor.md index ab1e19b19c5..fc790aecc3a 100644 --- a/commands/docs/math_floor.md +++ b/commands/docs/math_floor.md @@ -2,7 +2,7 @@ title: math floor categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the floor of a number (largest integer less than or equal to that number). usage: | @@ -25,9 +25,9 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | | number | int | -| range | list\ | +| list<number> | list<int> | +| range | list<number> | ## Examples Apply the floor function to a list of numbers diff --git a/commands/docs/math_ln.md b/commands/docs/math_ln.md index 7602deaeeae..d378e0da6f3 100644 --- a/commands/docs/math_ln.md +++ b/commands/docs/math_ln.md @@ -2,7 +2,7 @@ title: math ln categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the natural logarithm. Base: (math e). usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Get the natural logarithm of e diff --git a/commands/docs/math_log.md b/commands/docs/math_log.md index 9214d4384af..5f9126c24b7 100644 --- a/commands/docs/math_log.md +++ b/commands/docs/math_log.md @@ -2,7 +2,7 @@ title: math log categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the logarithm for an arbitrary base. usage: | @@ -29,9 +29,9 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | | number | float | -| range | list\ | +| list<number> | list<float> | +| range | list<number> | ## Examples Get the logarithm of 100 to the base 10 diff --git a/commands/docs/math_max.md b/commands/docs/math_max.md index ecf53340cae..f5a0ded038d 100644 --- a/commands/docs/math_max.md +++ b/commands/docs/math_max.md @@ -2,7 +2,7 @@ title: math max categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the maximum of a list of values, or of columns in a table. usage: | @@ -25,13 +25,13 @@ contributors: false | input | output | | -------------- | -------- | -| list\ | any | -| list\ | duration | -| list\ | filesize | -| list\ | number | +| list<number> | number | +| list<duration> | duration | +| list<filesize> | filesize | +| list<any> | any | | range | number | -| record | record | | table | record | +| record | record | ## Examples Find the maximum of a list of numbers diff --git a/commands/docs/math_median.md b/commands/docs/math_median.md index eebdde6325f..2753db2fabe 100644 --- a/commands/docs/math_median.md +++ b/commands/docs/math_median.md @@ -2,7 +2,7 @@ title: math median categories: | math -version: 0.104.0 +version: 0.105.0 math: | Computes the median of a list of numbers. usage: | @@ -25,12 +25,12 @@ contributors: false | input | output | | -------------- | -------- | -| list\ | duration | -| list\ | filesize | -| list\ | number | +| list<number> | number | +| list<duration> | duration | +| list<filesize> | filesize | | range | number | -| record | record | | table | record | +| record | record | ## Examples Compute the median of a list of numbers diff --git a/commands/docs/math_min.md b/commands/docs/math_min.md index 9dd8af144aa..d07b0a39fb4 100644 --- a/commands/docs/math_min.md +++ b/commands/docs/math_min.md @@ -2,7 +2,7 @@ title: math min categories: | math -version: 0.104.0 +version: 0.105.0 math: | Finds the minimum within a list of values or tables. usage: | @@ -25,13 +25,13 @@ contributors: false | input | output | | -------------- | -------- | -| list\ | any | -| list\ | duration | -| list\ | filesize | -| list\ | number | +| list<number> | number | +| list<duration> | duration | +| list<filesize> | filesize | +| list<any> | any | | range | number | -| record | record | | table | record | +| record | record | ## Examples Compute the minimum of a list of numbers diff --git a/commands/docs/math_mode.md b/commands/docs/math_mode.md index 9048b41a4cc..b466a14ae38 100644 --- a/commands/docs/math_mode.md +++ b/commands/docs/math_mode.md @@ -2,7 +2,7 @@ title: math mode categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the most frequent element(s) from a list of numbers or tables. usage: | @@ -25,9 +25,9 @@ contributors: false | input | output | | -------------- | -------------- | -| list\ | list\ | -| list\ | list\ | -| list\ | list\ | +| list<number> | list<number> | +| list<duration> | list<duration> | +| list<filesize> | list<filesize> | | table | record | ## Examples diff --git a/commands/docs/math_product.md b/commands/docs/math_product.md index 7f02c481720..52d2bb125f1 100644 --- a/commands/docs/math_product.md +++ b/commands/docs/math_product.md @@ -2,7 +2,7 @@ title: math product categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the product of a list of numbers or the products of each column of a table. usage: | @@ -25,10 +25,10 @@ contributors: false | input | output | | ------------ | ------ | -| list\ | number | +| list<number> | number | | range | number | -| record | record | | table | record | +| record | record | ## Examples Compute the product of a list of numbers diff --git a/commands/docs/math_round.md b/commands/docs/math_round.md index 07adc5061e5..3f14b79c773 100644 --- a/commands/docs/math_round.md +++ b/commands/docs/math_round.md @@ -2,7 +2,7 @@ title: math round categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the input number rounded to the specified precision. usage: | @@ -29,9 +29,9 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | | number | number | -| range | list\ | +| list<number> | list<number> | +| range | list<number> | ## Examples Apply the round function to a list of numbers diff --git a/commands/docs/math_sin.md b/commands/docs/math_sin.md index 5f30710d92c..9d65761c841 100644 --- a/commands/docs/math_sin.md +++ b/commands/docs/math_sin.md @@ -2,7 +2,7 @@ title: math sin categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the sine of the number. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Apply the sine to π/2 diff --git a/commands/docs/math_sinh.md b/commands/docs/math_sinh.md index 9cb8e9c2c66..fcf44fd7caa 100644 --- a/commands/docs/math_sinh.md +++ b/commands/docs/math_sinh.md @@ -2,7 +2,7 @@ title: math sinh categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the hyperbolic sine of the number. usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Apply the hyperbolic sine to 1 diff --git a/commands/docs/math_sqrt.md b/commands/docs/math_sqrt.md index 3013ae1d340..6ab6c193bb5 100644 --- a/commands/docs/math_sqrt.md +++ b/commands/docs/math_sqrt.md @@ -2,7 +2,7 @@ title: math sqrt categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the square root of the input number. usage: | @@ -25,9 +25,9 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | | number | float | -| range | list\ | +| list<number> | list<float> | +| range | list<number> | ## Examples Compute the square root of each number in a list diff --git a/commands/docs/math_stddev.md b/commands/docs/math_stddev.md index 5fc7505a049..a03342be67b 100644 --- a/commands/docs/math_stddev.md +++ b/commands/docs/math_stddev.md @@ -2,7 +2,7 @@ title: math stddev categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the standard deviation of a list of numbers, or of each column in a table. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------ | -| list\ | number | +| list<number> | number | | range | number | -| record | record | | table | record | +| record | record | ## Examples Compute the standard deviation of a list of numbers diff --git a/commands/docs/math_sum.md b/commands/docs/math_sum.md index 07ef191bbe0..ca7d5826870 100644 --- a/commands/docs/math_sum.md +++ b/commands/docs/math_sum.md @@ -2,7 +2,7 @@ title: math sum categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the sum of a list of numbers or of each column in a table. usage: | @@ -25,12 +25,12 @@ contributors: false | input | output | | -------------- | -------- | -| list\ | duration | -| list\ | filesize | -| list\ | number | +| list<number> | number | +| list<duration> | duration | +| list<filesize> | filesize | | range | number | -| record | record | | table | record | +| record | record | ## Examples Sum a list of numbers diff --git a/commands/docs/math_tan.md b/commands/docs/math_tan.md index a3164a45c1e..3e4f298e3ed 100644 --- a/commands/docs/math_tan.md +++ b/commands/docs/math_tan.md @@ -2,7 +2,7 @@ title: math tan categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the tangent of the number. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Apply the tangent to π/4 diff --git a/commands/docs/math_tanh.md b/commands/docs/math_tanh.md index 4d46a85e775..0c02e8d0897 100644 --- a/commands/docs/math_tanh.md +++ b/commands/docs/math_tanh.md @@ -2,7 +2,7 @@ title: math tanh categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the hyperbolic tangent of the number. usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------------ | ----------- | -| list\ | list\ | | number | float | +| list<number> | list<float> | ## Examples Apply the hyperbolic tangent to 10*π diff --git a/commands/docs/math_variance.md b/commands/docs/math_variance.md index fbacf655a87..23ff3b430db 100644 --- a/commands/docs/math_variance.md +++ b/commands/docs/math_variance.md @@ -2,7 +2,7 @@ title: math variance categories: | math -version: 0.104.0 +version: 0.105.0 math: | Returns the variance of a list of numbers or of each column in a table. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------ | -| list\ | number | +| list<number> | number | | range | number | -| record | record | | table | record | +| record | record | ## Examples Get the variance of a list of numbers diff --git a/commands/docs/merge.md b/commands/docs/merge.md index 0ef57ccdd94..042d10879ee 100644 --- a/commands/docs/merge.md +++ b/commands/docs/merge.md @@ -2,7 +2,7 @@ title: merge categories: | filters -version: 0.104.0 +version: 0.105.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 ab4dfcc59c7..471d877b6e7 100644 --- a/commands/docs/merge_deep.md +++ b/commands/docs/merge_deep.md @@ -2,7 +2,7 @@ title: merge deep categories: | filters -version: 0.104.0 +version: 0.105.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 b91862c152b..5249c39e927 100644 --- a/commands/docs/metadata.md +++ b/commands/docs/metadata.md @@ -2,7 +2,7 @@ title: metadata categories: | debug -version: 0.104.0 +version: 0.105.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 9cda4c26b67..3696a8779d3 100644 --- a/commands/docs/metadata_access.md +++ b/commands/docs/metadata_access.md @@ -2,7 +2,7 @@ title: metadata access categories: | debug -version: 0.104.0 +version: 0.105.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 1b4c6caba70..8caa5203456 100644 --- a/commands/docs/metadata_set.md +++ b/commands/docs/metadata_set.md @@ -2,7 +2,7 @@ title: metadata set categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | Set the metadata for items in the stream. usage: | diff --git a/commands/docs/mkdir.md b/commands/docs/mkdir.md index 70bba0408ac..348764f9318 100644 --- a/commands/docs/mkdir.md +++ b/commands/docs/mkdir.md @@ -2,7 +2,7 @@ title: mkdir categories: | filesystem -version: 0.104.0 +version: 0.105.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 efabb053056..736d0327ed9 100644 --- a/commands/docs/mktemp.md +++ b/commands/docs/mktemp.md @@ -2,7 +2,7 @@ title: mktemp categories: | filesystem -version: 0.104.0 +version: 0.105.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 319ee755984..64f93da9766 100644 --- a/commands/docs/module.md +++ b/commands/docs/module.md @@ -2,7 +2,7 @@ title: module categories: | core -version: 0.104.0 +version: 0.105.0 core: | Define a custom module. usage: | diff --git a/commands/docs/move.md b/commands/docs/move.md index 686e587c2c7..0181851f623 100644 --- a/commands/docs/move.md +++ b/commands/docs/move.md @@ -2,7 +2,7 @@ title: move categories: | filters -version: 0.104.0 +version: 0.105.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 8726fb865b9..f1c2080946e 100644 --- a/commands/docs/mut.md +++ b/commands/docs/mut.md @@ -2,7 +2,7 @@ title: mut categories: | core -version: 0.104.0 +version: 0.105.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 c05d5acc91d..eba4b2953e2 100644 --- a/commands/docs/mv.md +++ b/commands/docs/mv.md @@ -2,7 +2,7 @@ title: mv categories: | filesystem -version: 0.104.0 +version: 0.105.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 db21550a494..b68db43fbdc 100644 --- a/commands/docs/nu-check.md +++ b/commands/docs/nu-check.md @@ -2,7 +2,7 @@ title: nu-check categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Validate and parse input content. usage: | @@ -34,10 +34,10 @@ contributors: false | input | output | | --------- | ------ | -| any | bool | -| list\ | bool | | nothing | bool | | string | bool | +| list<any> | bool | +| any | bool | ## Examples Parse a input file as script(Default) diff --git a/commands/docs/nu-highlight.md b/commands/docs/nu-highlight.md index 260c04f5033..fb7a1d2ea4b 100644 --- a/commands/docs/nu-highlight.md +++ b/commands/docs/nu-highlight.md @@ -2,7 +2,7 @@ title: nu-highlight categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Syntax highlight the input string. usage: | diff --git a/commands/docs/open.md b/commands/docs/open.md index 4c8c1c9fe21..fb4f26b3f82 100644 --- a/commands/docs/open.md +++ b/commands/docs/open.md @@ -2,7 +2,7 @@ title: open categories: | filesystem -version: 0.104.0 +version: 0.105.0 filesystem: | Load a file into a cell, converting to table if possible (avoid by appending '--raw'). usage: | @@ -33,9 +33,9 @@ contributors: false | input | output | | ------- | ------ | -| any | any | | nothing | any | | string | any | +| any | any | ## Examples Open a file, with structure (based on file extension or SQLite database header) @@ -66,6 +66,17 @@ Create a custom `from` parser to open newline-delimited JSON files with `open` ```nu > def "from ndjson" [] { from json -o }; open myfile.ndjson +``` + +Show the extensions for which the `open` command will automatically parse +```nu +> scope commands + | where name starts-with "from " + | insert extension { get name | str replace -r "^from " "" | $"*.($in)" } + | select extension name + | rename extension command + + ``` ## Notes diff --git a/commands/docs/overlay.md b/commands/docs/overlay.md index 8697b9296dd..2617a5d6554 100644 --- a/commands/docs/overlay.md +++ b/commands/docs/overlay.md @@ -2,7 +2,7 @@ title: overlay categories: | core -version: 0.104.0 +version: 0.105.0 core: | Commands for manipulating overlays. usage: | diff --git a/commands/docs/overlay_hide.md b/commands/docs/overlay_hide.md index 4d093edd5fb..4bcfc40e686 100644 --- a/commands/docs/overlay_hide.md +++ b/commands/docs/overlay_hide.md @@ -2,7 +2,7 @@ title: overlay hide categories: | core -version: 0.104.0 +version: 0.105.0 core: | Hide an active overlay. usage: | diff --git a/commands/docs/overlay_list.md b/commands/docs/overlay_list.md index 58347cb5a8f..853c46d9b01 100644 --- a/commands/docs/overlay_list.md +++ b/commands/docs/overlay_list.md @@ -2,7 +2,7 @@ title: overlay list categories: | core -version: 0.104.0 +version: 0.105.0 core: | List all active overlays. usage: | @@ -25,7 +25,7 @@ contributors: false | input | output | | ------- | ------------ | -| nothing | list\ | +| nothing | list<string> | ## Examples Get the last activated overlay diff --git a/commands/docs/overlay_new.md b/commands/docs/overlay_new.md index db2fd9f9cbb..e529681d13d 100644 --- a/commands/docs/overlay_new.md +++ b/commands/docs/overlay_new.md @@ -2,7 +2,7 @@ title: overlay new categories: | core -version: 0.104.0 +version: 0.105.0 core: | Create an empty overlay. usage: | @@ -20,6 +20,10 @@ contributors: false ```> overlay new {flags} (name)``` +## Flags + + - `--reload, -r`: If the overlay already exists, reload its environment. + ## Parameters - `name`: Name of the overlay. diff --git a/commands/docs/overlay_use.md b/commands/docs/overlay_use.md index 380b50ddf33..31ab5c65ea1 100644 --- a/commands/docs/overlay_use.md +++ b/commands/docs/overlay_use.md @@ -2,7 +2,7 @@ title: overlay use categories: | core -version: 0.104.0 +version: 0.105.0 core: | Use definitions from a module as an overlay. usage: | diff --git a/commands/docs/panic.md b/commands/docs/panic.md index 4b634a9cb67..4c2e6303699 100644 --- a/commands/docs/panic.md +++ b/commands/docs/panic.md @@ -2,7 +2,7 @@ title: panic categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | Causes nushell to panic. usage: | diff --git a/commands/docs/par-each.md b/commands/docs/par-each.md index 9af497e244b..a7d26b6547c 100644 --- a/commands/docs/par-each.md +++ b/commands/docs/par-each.md @@ -2,7 +2,7 @@ title: par-each categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Run a closure on each row of the input list in parallel, creating a new list with the results. usage: | @@ -34,9 +34,9 @@ contributors: false | input | output | | --------- | --------- | +| list<any> | list<any> | +| table | list<any> | | any | any | -| list\ | list\ | -| table | list\ | ## Examples Multiplies each number. Note that the list will become arbitrarily disordered. diff --git a/commands/docs/parse.md b/commands/docs/parse.md index b3d9d654b94..23385db0698 100644 --- a/commands/docs/parse.md +++ b/commands/docs/parse.md @@ -2,7 +2,7 @@ title: parse categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Parse columns from string data using a simple pattern or a supplied regular expression. usage: | @@ -33,8 +33,8 @@ contributors: false | input | output | | --------- | ------ | -| list\ | table | | string | table | +| list<any> | table | ## Examples Parse a string into two named columns @@ -48,6 +48,17 @@ Parse a string into two named columns ``` +Parse a string, ignoring a column with _ +```nu +> "hello world" | parse "{foo} {_}" +╭───┬───────╮ +│ # │ foo │ +├───┼───────┤ +│ 0 │ hello │ +╰───┴───────╯ + +``` + This is how the first example is interpreted in the source code ```nu > "hi there" | parse --regex '(?s)\A(?P.*?) (?P.*?)\z' diff --git a/commands/docs/path.md b/commands/docs/path.md index a63598efa60..5a7db89430d 100644 --- a/commands/docs/path.md +++ b/commands/docs/path.md @@ -2,7 +2,7 @@ title: path categories: | path -version: 0.104.0 +version: 0.105.0 path: | Explore and manipulate paths. usage: | diff --git a/commands/docs/path_basename.md b/commands/docs/path_basename.md index 66714c38d53..cf7c24a1c71 100644 --- a/commands/docs/path_basename.md +++ b/commands/docs/path_basename.md @@ -2,7 +2,7 @@ title: path basename categories: | path -version: 0.104.0 +version: 0.105.0 path: | Get the final component of a path. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | | string | string | +| list<string> | list<string> | ## Examples Get basename of a path diff --git a/commands/docs/path_dirname.md b/commands/docs/path_dirname.md index 607c2c5e74f..3e4b46ae7ae 100644 --- a/commands/docs/path_dirname.md +++ b/commands/docs/path_dirname.md @@ -2,7 +2,7 @@ title: path dirname categories: | path -version: 0.104.0 +version: 0.105.0 path: | Get the parent directory of a path. usage: | @@ -30,8 +30,8 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | | string | string | +| list<string> | list<string> | ## Examples Get dirname of a path diff --git a/commands/docs/path_exists.md b/commands/docs/path_exists.md index 9db9a43f780..554d4f217d9 100644 --- a/commands/docs/path_exists.md +++ b/commands/docs/path_exists.md @@ -2,7 +2,7 @@ title: path exists categories: | path -version: 0.104.0 +version: 0.105.0 path: | Check whether a path exists. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------------ | ---------- | -| list\ | list\ | | string | bool | +| list<string> | list<bool> | ## Examples Check if a file exists diff --git a/commands/docs/path_expand.md b/commands/docs/path_expand.md index 449549977aa..ae675c16390 100644 --- a/commands/docs/path_expand.md +++ b/commands/docs/path_expand.md @@ -2,7 +2,7 @@ title: path expand categories: | path -version: 0.104.0 +version: 0.105.0 path: | Try to expand a path to its absolute form. usage: | @@ -30,8 +30,8 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | | string | string | +| list<string> | list<string> | ## Examples Expand an absolute path diff --git a/commands/docs/path_join.md b/commands/docs/path_join.md index f6c416acc81..57cd6dc6ca2 100644 --- a/commands/docs/path_join.md +++ b/commands/docs/path_join.md @@ -2,7 +2,7 @@ title: path join categories: | path -version: 0.104.0 +version: 0.105.0 path: | Join a structured path or a list of path parts. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | string | -| record | string | | string | string | -| table | list\ | +| list<string> | string | +| record | string | +| table | list<string> | ## Examples Append a filename to a path diff --git a/commands/docs/path_parse.md b/commands/docs/path_parse.md index 0ee25f470a4..423ce38e4f3 100644 --- a/commands/docs/path_parse.md +++ b/commands/docs/path_parse.md @@ -2,7 +2,7 @@ title: path parse categories: | path -version: 0.104.0 +version: 0.105.0 path: | Convert a path into structured data. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------------ | ------ | -| list\ | table | | string | record | +| list<string> | table | ## Examples Parse a path diff --git a/commands/docs/path_relative-to.md b/commands/docs/path_relative-to.md index 5d135af8e96..96f5c6b9042 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.104.0 +version: 0.105.0 path: | Express a path as relative to another path. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | | string | string | +| list<string> | list<string> | ## Examples Find a relative path from two absolute paths diff --git a/commands/docs/path_self.md b/commands/docs/path_self.md index 4fc7bbd742f..134c63dc17a 100644 --- a/commands/docs/path_self.md +++ b/commands/docs/path_self.md @@ -2,7 +2,7 @@ title: path self categories: | path -version: 0.104.0 +version: 0.105.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 ee17ae2dd47..2732447a625 100644 --- a/commands/docs/path_split.md +++ b/commands/docs/path_split.md @@ -2,7 +2,7 @@ title: path split categories: | path -version: 0.104.0 +version: 0.105.0 path: | Split a path into a list based on the system's path separator. usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------------ | ------------------ | -| list\ | list\\> | -| string | list\ | +| string | list<string> | +| list<string> | list<list<string>> | ## Examples Split a path into parts diff --git a/commands/docs/path_type.md b/commands/docs/path_type.md index e39fb6016ac..2e0f7c95a44 100644 --- a/commands/docs/path_type.md +++ b/commands/docs/path_type.md @@ -2,7 +2,7 @@ title: path type categories: | path -version: 0.104.0 +version: 0.105.0 path: | Get the type of the object a path refers to (e.g., file, dir, symlink). usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | | string | string | +| list<string> | list<string> | ## Examples Show type of a filepath diff --git a/commands/docs/plugin.md b/commands/docs/plugin.md index fd6e70cb74e..5fbd1a4c549 100644 --- a/commands/docs/plugin.md +++ b/commands/docs/plugin.md @@ -2,7 +2,7 @@ title: plugin categories: | plugin -version: 0.104.0 +version: 0.105.0 plugin: | Commands for managing plugins. usage: | diff --git a/commands/docs/plugin_add.md b/commands/docs/plugin_add.md index 26b8b021a84..636b1f596cd 100644 --- a/commands/docs/plugin_add.md +++ b/commands/docs/plugin_add.md @@ -2,7 +2,7 @@ title: plugin add categories: | plugin -version: 0.104.0 +version: 0.105.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 27874e383c0..320c5273d4e 100644 --- a/commands/docs/plugin_list.md +++ b/commands/docs/plugin_list.md @@ -2,7 +2,7 @@ title: plugin list categories: | plugin -version: 0.104.0 +version: 0.105.0 plugin: | List loaded and installed plugins. usage: | @@ -31,7 +31,7 @@ contributors: false | input | output | | ------- | ----------------------------------------------------------------------------------------------------------------------- | -| nothing | table\\> | +| nothing | table<name: string, version: string, status: string, pid: int, filename: string, shell: string, commands: list<string>> | ## Examples List installed plugins. @@ -40,7 +40,7 @@ List installed plugins. ╭─────┬────────┬──────────────────────┬───────────┬──────────┬────────────────────────────────┬────────┬──────────────╮ │ # │ name │ version │ status │ pid │ filename │ shell │ commands │ ├─────┼────────┼──────────────────────┼───────────┼──────────┼────────────────────────────────┼────────┼──────────────┤ -│ 0 │ inc │ 0.104.0 │ running │ 106480 │ /opt/nu/plugins/nu_plugin_inc │ │ ╭───┬─────╮ │ +│ 0 │ inc │ 0.105.0 │ running │ 106480 │ /opt/nu/plugins/nu_plugin_inc │ │ ╭───┬─────╮ │ │ │ │ │ │ │ │ │ │ 0 │ inc │ │ │ │ │ │ │ │ │ │ ╰───┴─────╯ │ ╰─────┴────────┴──────────────────────┴───────────┴──────────┴────────────────────────────────┴────────┴──────────────╯ diff --git a/commands/docs/plugin_rm.md b/commands/docs/plugin_rm.md index 77ef2072172..ce62f5b5390 100644 --- a/commands/docs/plugin_rm.md +++ b/commands/docs/plugin_rm.md @@ -2,7 +2,7 @@ title: plugin rm categories: | plugin -version: 0.104.0 +version: 0.105.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 191d696026b..2d8d57acdf1 100644 --- a/commands/docs/plugin_stop.md +++ b/commands/docs/plugin_stop.md @@ -2,7 +2,7 @@ title: plugin stop categories: | plugin -version: 0.104.0 +version: 0.105.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 0d4070cc8c6..0c008b77ee2 100644 --- a/commands/docs/plugin_use.md +++ b/commands/docs/plugin_use.md @@ -2,7 +2,7 @@ title: plugin use categories: | plugin -version: 0.104.0 +version: 0.105.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 e8bc81c07f4..f6e62974cbe 100644 --- a/commands/docs/polars.md +++ b/commands/docs/polars.md @@ -2,7 +2,7 @@ title: polars categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Operate with data in a dataframe format. usage: | @@ -52,131 +52,135 @@ to the `polars agg` command with some column expressions for aggregation which t ## Subcommands: -| name | description | type | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | -| [`polars agg`](/commands/docs/polars_agg.md) | Performs a series of aggregations from a group-by. | plugin | -| [`polars agg-groups`](/commands/docs/polars_agg-groups.md) | Creates an agg_groups expression. | plugin | -| [`polars all-false`](/commands/docs/polars_all-false.md) | Returns true if all values are false. | plugin | -| [`polars all-true`](/commands/docs/polars_all-true.md) | Returns true if all values are true. | plugin | -| [`polars append`](/commands/docs/polars_append.md) | Appends a new dataframe. | plugin | -| [`polars arg-max`](/commands/docs/polars_arg-max.md) | Return index for max value in series. | plugin | -| [`polars arg-min`](/commands/docs/polars_arg-min.md) | Return index for min value in series. | plugin | -| [`polars arg-sort`](/commands/docs/polars_arg-sort.md) | Returns indexes for a sorted series. | plugin | -| [`polars arg-true`](/commands/docs/polars_arg-true.md) | Returns indexes where values are true. | plugin | -| [`polars arg-unique`](/commands/docs/polars_arg-unique.md) | Returns indexes for unique values. | plugin | -| [`polars arg-where`](/commands/docs/polars_arg-where.md) | Creates an expression that returns the arguments where expression is true. | plugin | -| [`polars as`](/commands/docs/polars_as.md) | Creates an alias expression. | plugin | -| [`polars as-date`](/commands/docs/polars_as-date.md) | Converts string to date. | plugin | -| [`polars as-datetime`](/commands/docs/polars_as-datetime.md) | Converts string to datetime. | plugin | -| [`polars cache`](/commands/docs/polars_cache.md) | Caches operations in a new LazyFrame. | plugin | -| [`polars cast`](/commands/docs/polars_cast.md) | Cast a column to a different dtype. | plugin | -| [`polars col`](/commands/docs/polars_col.md) | Creates a named column expression. | plugin | -| [`polars collect`](/commands/docs/polars_collect.md) | Collect lazy dataframe into eager dataframe. | plugin | -| [`polars columns`](/commands/docs/polars_columns.md) | Show dataframe columns. | plugin | -| [`polars concat`](/commands/docs/polars_concat.md) | Concatenate two or more dataframes. | plugin | -| [`polars concat-str`](/commands/docs/polars_concat-str.md) | Creates a concat string expression. | plugin | -| [`polars contains`](/commands/docs/polars_contains.md) | Checks if a pattern is contained in a string. | plugin | -| [`polars convert-time-zone`](/commands/docs/polars_convert-time-zone.md) | Convert datetime to target timezone. | plugin | -| [`polars count`](/commands/docs/polars_count.md) | Returns the number of non-null values in the column. | plugin | -| [`polars count-null`](/commands/docs/polars_count-null.md) | Counts null values. | plugin | -| [`polars cumulative`](/commands/docs/polars_cumulative.md) | Cumulative calculation for a column or series. | plugin | -| [`polars cut`](/commands/docs/polars_cut.md) | Bin continuous values into discrete categories for a series. | plugin | -| [`polars datepart`](/commands/docs/polars_datepart.md) | Creates an expression for capturing the specified datepart in a column. | plugin | -| [`polars decimal`](/commands/docs/polars_decimal.md) | Converts a string column into a decimal column | plugin | -| [`polars drop`](/commands/docs/polars_drop.md) | Creates a new dataframe by dropping the selected columns. | plugin | -| [`polars drop-duplicates`](/commands/docs/polars_drop-duplicates.md) | Drops duplicate values in dataframe. | plugin | -| [`polars drop-nulls`](/commands/docs/polars_drop-nulls.md) | Drops null values in dataframe. | plugin | -| [`polars dummies`](/commands/docs/polars_dummies.md) | Creates a new dataframe with dummy variables. | plugin | -| [`polars explode`](/commands/docs/polars_explode.md) | Explodes a dataframe or creates a explode expression. | plugin | -| [`polars expr-not`](/commands/docs/polars_expr-not.md) | Creates a not expression. | plugin | -| [`polars fetch`](/commands/docs/polars_fetch.md) | Collects the lazyframe to the selected rows. | plugin | -| [`polars fill-nan`](/commands/docs/polars_fill-nan.md) | Replaces NaN values with the given expression. | plugin | -| [`polars fill-null`](/commands/docs/polars_fill-null.md) | Replaces NULL values with the given expression. | plugin | -| [`polars filter`](/commands/docs/polars_filter.md) | Filter dataframe based in expression. | plugin | -| [`polars filter-with`](/commands/docs/polars_filter-with.md) | Filters dataframe using a mask or expression as reference. | plugin | -| [`polars first`](/commands/docs/polars_first.md) | Show only the first number of rows or create a first expression | plugin | -| [`polars flatten`](/commands/docs/polars_flatten.md) | An alias for polars explode. | plugin | -| [`polars get`](/commands/docs/polars_get.md) | Creates dataframe with the selected columns. | plugin | -| [`polars get-day`](/commands/docs/polars_get-day.md) | Gets day from date. | plugin | -| [`polars get-hour`](/commands/docs/polars_get-hour.md) | Gets hour from datetime. | plugin | -| [`polars get-minute`](/commands/docs/polars_get-minute.md) | Gets minute from date. | plugin | -| [`polars get-month`](/commands/docs/polars_get-month.md) | Gets month from date. | plugin | -| [`polars get-nanosecond`](/commands/docs/polars_get-nanosecond.md) | Gets nanosecond from date. | plugin | -| [`polars get-ordinal`](/commands/docs/polars_get-ordinal.md) | Gets ordinal from date. | plugin | -| [`polars get-second`](/commands/docs/polars_get-second.md) | Gets second from date. | plugin | -| [`polars get-week`](/commands/docs/polars_get-week.md) | Gets week from date. | plugin | -| [`polars get-weekday`](/commands/docs/polars_get-weekday.md) | Gets weekday from date. | plugin | -| [`polars get-year`](/commands/docs/polars_get-year.md) | Gets year from date. | plugin | -| [`polars group-by`](/commands/docs/polars_group-by.md) | Creates a group-by object that can be used for other aggregations. | plugin | -| [`polars implode`](/commands/docs/polars_implode.md) | Aggregates values into a list. | plugin | -| [`polars integer`](/commands/docs/polars_integer.md) | Converts a string column into a integer column | plugin | -| [`polars into-df`](/commands/docs/polars_into-df.md) | Converts a list, table or record into a dataframe. | plugin | -| [`polars into-dtype`](/commands/docs/polars_into-dtype.md) | Convert a string to a specific datatype. | plugin | -| [`polars into-lazy`](/commands/docs/polars_into-lazy.md) | Converts a dataframe into a lazy dataframe. | plugin | -| [`polars into-nu`](/commands/docs/polars_into-nu.md) | Converts a dataframe or an expression into nushell value for access and exploration. | plugin | -| [`polars into-repr`](/commands/docs/polars_into-repr.md) | Display a dataframe in its repr format. | plugin | -| [`polars into-schema`](/commands/docs/polars_into-schema.md) | Convert a value to a polars schema object | plugin | -| [`polars is-duplicated`](/commands/docs/polars_is-duplicated.md) | Creates mask indicating duplicated values. | plugin | -| [`polars is-in`](/commands/docs/polars_is-in.md) | Creates an is-in expression or checks to see if the elements are contained in the right series | plugin | -| [`polars is-not-null`](/commands/docs/polars_is-not-null.md) | Creates mask where value is not null. | plugin | -| [`polars is-null`](/commands/docs/polars_is-null.md) | Creates mask where value is null. | plugin | -| [`polars is-unique`](/commands/docs/polars_is-unique.md) | Creates mask indicating unique values. | plugin | -| [`polars join`](/commands/docs/polars_join.md) | Joins a lazy frame with other lazy frame. | plugin | -| [`polars join-where`](/commands/docs/polars_join-where.md) | Joins a lazy frame with other lazy frame based on conditions. | plugin | -| [`polars last`](/commands/docs/polars_last.md) | Creates new dataframe with tail rows or creates a last expression. | plugin | -| [`polars len`](/commands/docs/polars_len.md) | Return the number of rows in the context. This is similar to COUNT(*) in SQL. | plugin | -| [`polars list-contains`](/commands/docs/polars_list-contains.md) | Checks if an element is contained in a list. | plugin | -| [`polars lit`](/commands/docs/polars_lit.md) | Creates a literal expression. | plugin | -| [`polars lowercase`](/commands/docs/polars_lowercase.md) | Lowercase the strings in the column. | plugin | -| [`polars max`](/commands/docs/polars_max.md) | Creates a max expression or aggregates columns to their max value. | plugin | -| [`polars mean`](/commands/docs/polars_mean.md) | Creates a mean expression for an aggregation or aggregates columns to their mean value. | plugin | -| [`polars median`](/commands/docs/polars_median.md) | Median value from columns in a dataframe or creates expression for an aggregation | plugin | -| [`polars min`](/commands/docs/polars_min.md) | Creates a min expression or aggregates columns to their min value. | plugin | -| [`polars n-unique`](/commands/docs/polars_n-unique.md) | Counts unique values. | plugin | -| [`polars not`](/commands/docs/polars_not.md) | Inverts boolean mask. | plugin | -| [`polars open`](/commands/docs/polars_open.md) | Opens CSV, JSON, NDJSON/JSON lines, arrow, avro, or parquet file to create dataframe. A lazy dataframe will be created by default, if supported. | plugin | -| [`polars otherwise`](/commands/docs/polars_otherwise.md) | Completes a when expression. | plugin | -| [`polars over`](/commands/docs/polars_over.md) | Compute expressions over a window group defined by partition expressions. | plugin | -| [`polars pivot`](/commands/docs/polars_pivot.md) | Pivot a DataFrame from long to wide format. | plugin | -| [`polars profile`](/commands/docs/polars_profile.md) | Profile a lazy dataframe. | plugin | -| [`polars qcut`](/commands/docs/polars_qcut.md) | Bin continuous values into discrete categories based on their quantiles for a series. | plugin | -| [`polars quantile`](/commands/docs/polars_quantile.md) | Aggregates the columns to the selected quantile. | plugin | -| [`polars query`](/commands/docs/polars_query.md) | Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. | plugin | -| [`polars rename`](/commands/docs/polars_rename.md) | Rename a dataframe column. | plugin | -| [`polars replace`](/commands/docs/polars_replace.md) | Replace the leftmost (sub)string by a regex pattern. | plugin | -| [`polars replace-all`](/commands/docs/polars_replace-all.md) | Replace all (sub)strings by a regex pattern. | 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 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 | -| [`polars select`](/commands/docs/polars_select.md) | Selects columns from lazyframe. | plugin | -| [`polars set`](/commands/docs/polars_set.md) | Sets value where given mask is true. | plugin | -| [`polars set-with-idx`](/commands/docs/polars_set-with-idx.md) | Sets value in the given index. | plugin | -| [`polars shape`](/commands/docs/polars_shape.md) | Shows column and row size for a dataframe. | plugin | -| [`polars shift`](/commands/docs/polars_shift.md) | Shifts the values by a given period. | plugin | -| [`polars slice`](/commands/docs/polars_slice.md) | Creates new dataframe from a slice of rows. | plugin | -| [`polars sort-by`](/commands/docs/polars_sort-by.md) | Sorts a lazy dataframe based on expression(s). | plugin | -| [`polars std`](/commands/docs/polars_std.md) | Creates a std expression for an aggregation of std value from columns in a dataframe. | plugin | -| [`polars store-get`](/commands/docs/polars_store-get.md) | Gets a Dataframe or other object from the plugin cache. | plugin | -| [`polars store-ls`](/commands/docs/polars_store-ls.md) | Lists stored polars objects. | plugin | -| [`polars store-rm`](/commands/docs/polars_store-rm.md) | Removes a stored Dataframe or other object from the plugin cache. | plugin | -| [`polars str-join`](/commands/docs/polars_str-join.md) | Concatenates strings within a column or dataframes | plugin | -| [`polars str-lengths`](/commands/docs/polars_str-lengths.md) | Get lengths of all strings. | plugin | -| [`polars str-slice`](/commands/docs/polars_str-slice.md) | Slices the string from the start position until the selected length. | plugin | -| [`polars str-split`](/commands/docs/polars_str-split.md) | Split the string by a substring. The resulting dtype is list\. | plugin | -| [`polars str-strip-chars`](/commands/docs/polars_str-strip-chars.md) | Strips specified characters from strings in a column | plugin | -| [`polars strftime`](/commands/docs/polars_strftime.md) | Formats date based on string rule. | plugin | -| [`polars sum`](/commands/docs/polars_sum.md) | Creates a sum expression for an aggregation or aggregates columns to their sum value. | plugin | -| [`polars summary`](/commands/docs/polars_summary.md) | For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. | plugin | -| [`polars take`](/commands/docs/polars_take.md) | Creates new dataframe using the given indices. | plugin | -| [`polars truncate`](/commands/docs/polars_truncate.md) | Divide the date/datetime range into buckets. | plugin | -| [`polars unique`](/commands/docs/polars_unique.md) | Returns unique values from a dataframe. | plugin | -| [`polars unnest`](/commands/docs/polars_unnest.md) | 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. | plugin | -| [`polars unpivot`](/commands/docs/polars_unpivot.md) | Unpivot a DataFrame from wide to long format. | plugin | -| [`polars uppercase`](/commands/docs/polars_uppercase.md) | Uppercase the strings in the column. | plugin | -| [`polars value-counts`](/commands/docs/polars_value-counts.md) | Returns a dataframe with the counts for unique values in series. | plugin | -| [`polars var`](/commands/docs/polars_var.md) | Create a var expression for an aggregation. | plugin | -| [`polars when`](/commands/docs/polars_when.md) | Creates and modifies a when expression. | plugin | -| [`polars with-column`](/commands/docs/polars_with-column.md) | Adds a series to the dataframe. | plugin | \ No newline at end of file +| name | description | type | +| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | +| [`polars agg`](/commands/docs/polars_agg.md) | Performs a series of aggregations from a group-by. | plugin | +| [`polars agg-groups`](/commands/docs/polars_agg-groups.md) | Creates an agg_groups expression. | plugin | +| [`polars all-false`](/commands/docs/polars_all-false.md) | Returns true if all values are false. | plugin | +| [`polars all-true`](/commands/docs/polars_all-true.md) | Returns true if all values are true. | plugin | +| [`polars append`](/commands/docs/polars_append.md) | Appends a new dataframe. | plugin | +| [`polars arg-max`](/commands/docs/polars_arg-max.md) | Return index for max value in series. | plugin | +| [`polars arg-min`](/commands/docs/polars_arg-min.md) | Return index for min value in series. | plugin | +| [`polars arg-sort`](/commands/docs/polars_arg-sort.md) | Returns indexes for a sorted series. | plugin | +| [`polars arg-true`](/commands/docs/polars_arg-true.md) | Returns indexes where values are true. | plugin | +| [`polars arg-unique`](/commands/docs/polars_arg-unique.md) | Returns indexes for unique values. | plugin | +| [`polars arg-where`](/commands/docs/polars_arg-where.md) | Creates an expression that returns the arguments where expression is true. | plugin | +| [`polars as`](/commands/docs/polars_as.md) | Creates an alias expression. | plugin | +| [`polars as-date`](/commands/docs/polars_as-date.md) | Converts string to date. | plugin | +| [`polars as-datetime`](/commands/docs/polars_as-datetime.md) | Converts string to datetime. | plugin | +| [`polars cache`](/commands/docs/polars_cache.md) | Caches operations in a new LazyFrame. | plugin | +| [`polars cast`](/commands/docs/polars_cast.md) | Cast a column to a different dtype. | plugin | +| [`polars col`](/commands/docs/polars_col.md) | Creates a named column expression. | plugin | +| [`polars collect`](/commands/docs/polars_collect.md) | Collect lazy dataframe into eager dataframe. | plugin | +| [`polars columns`](/commands/docs/polars_columns.md) | Show dataframe columns. | plugin | +| [`polars concat`](/commands/docs/polars_concat.md) | Concatenate two or more dataframes. | plugin | +| [`polars concat-str`](/commands/docs/polars_concat-str.md) | Creates a concat string expression. | plugin | +| [`polars contains`](/commands/docs/polars_contains.md) | Checks if a pattern is contained in a string. | plugin | +| [`polars convert-time-zone`](/commands/docs/polars_convert-time-zone.md) | Convert datetime to target timezone. | plugin | +| [`polars count`](/commands/docs/polars_count.md) | Returns the number of non-null values in the column. | plugin | +| [`polars count-null`](/commands/docs/polars_count-null.md) | Counts null values. | plugin | +| [`polars cumulative`](/commands/docs/polars_cumulative.md) | Cumulative calculation for a column or series. | plugin | +| [`polars cut`](/commands/docs/polars_cut.md) | Bin continuous values into discrete categories for a series. | plugin | +| [`polars datepart`](/commands/docs/polars_datepart.md) | Creates an expression for capturing the specified datepart in a column. | plugin | +| [`polars decimal`](/commands/docs/polars_decimal.md) | Converts a string column into a decimal column | plugin | +| [`polars drop`](/commands/docs/polars_drop.md) | Creates a new dataframe by dropping the selected columns. | plugin | +| [`polars drop-duplicates`](/commands/docs/polars_drop-duplicates.md) | Drops duplicate values in dataframe. | plugin | +| [`polars drop-nulls`](/commands/docs/polars_drop-nulls.md) | Drops null values in dataframe. | plugin | +| [`polars dummies`](/commands/docs/polars_dummies.md) | Creates a new dataframe with dummy variables. | plugin | +| [`polars explode`](/commands/docs/polars_explode.md) | Explodes a dataframe or creates a explode expression. | plugin | +| [`polars expr-not`](/commands/docs/polars_expr-not.md) | Creates a not expression. | plugin | +| [`polars fetch`](/commands/docs/polars_fetch.md) | Collects the lazyframe to the selected rows. | plugin | +| [`polars fill-nan`](/commands/docs/polars_fill-nan.md) | Replaces NaN values with the given expression. | plugin | +| [`polars fill-null`](/commands/docs/polars_fill-null.md) | Replaces NULL values with the given expression. | plugin | +| [`polars filter`](/commands/docs/polars_filter.md) | Filter dataframe based in expression. | plugin | +| [`polars filter-with`](/commands/docs/polars_filter-with.md) | Filters dataframe using a mask or expression as reference. | plugin | +| [`polars first`](/commands/docs/polars_first.md) | Show only the first number of rows or create a first expression | plugin | +| [`polars flatten`](/commands/docs/polars_flatten.md) | An alias for polars explode. | plugin | +| [`polars get`](/commands/docs/polars_get.md) | Creates dataframe with the selected columns. | plugin | +| [`polars get-day`](/commands/docs/polars_get-day.md) | Gets day from date. | plugin | +| [`polars get-hour`](/commands/docs/polars_get-hour.md) | Gets hour from datetime. | plugin | +| [`polars get-minute`](/commands/docs/polars_get-minute.md) | Gets minute from date. | plugin | +| [`polars get-month`](/commands/docs/polars_get-month.md) | Gets month from date. | plugin | +| [`polars get-nanosecond`](/commands/docs/polars_get-nanosecond.md) | Gets nanosecond from date. | plugin | +| [`polars get-ordinal`](/commands/docs/polars_get-ordinal.md) | Gets ordinal from date. | plugin | +| [`polars get-second`](/commands/docs/polars_get-second.md) | Gets second from date. | plugin | +| [`polars get-week`](/commands/docs/polars_get-week.md) | Gets week from date. | plugin | +| [`polars get-weekday`](/commands/docs/polars_get-weekday.md) | Gets weekday from date. | plugin | +| [`polars get-year`](/commands/docs/polars_get-year.md) | Gets year from date. | plugin | +| [`polars group-by`](/commands/docs/polars_group-by.md) | Creates a group-by object that can be used for other aggregations. | plugin | +| [`polars horizontal`](/commands/docs/polars_horizontal.md) | Horizontal calculation across multiple columns. | plugin | +| [`polars implode`](/commands/docs/polars_implode.md) | Aggregates values into a list. | plugin | +| [`polars integer`](/commands/docs/polars_integer.md) | Converts a string column into a integer column | plugin | +| [`polars into-df`](/commands/docs/polars_into-df.md) | Converts a list, table or record into a dataframe. | plugin | +| [`polars into-dtype`](/commands/docs/polars_into-dtype.md) | Convert a string to a specific datatype. | plugin | +| [`polars into-lazy`](/commands/docs/polars_into-lazy.md) | Converts a dataframe into a lazy dataframe. | plugin | +| [`polars into-nu`](/commands/docs/polars_into-nu.md) | Converts a dataframe or an expression into nushell value for access and exploration. | plugin | +| [`polars into-repr`](/commands/docs/polars_into-repr.md) | Display a dataframe in its repr format. | plugin | +| [`polars into-schema`](/commands/docs/polars_into-schema.md) | Convert a value to a polars schema object | plugin | +| [`polars is-duplicated`](/commands/docs/polars_is-duplicated.md) | Creates mask indicating duplicated values. | plugin | +| [`polars is-in`](/commands/docs/polars_is-in.md) | Creates an is-in expression or checks to see if the elements are contained in the right series | plugin | +| [`polars is-not-null`](/commands/docs/polars_is-not-null.md) | Creates mask where value is not null. | plugin | +| [`polars is-null`](/commands/docs/polars_is-null.md) | Creates mask where value is null. | plugin | +| [`polars is-unique`](/commands/docs/polars_is-unique.md) | Creates mask indicating unique values. | plugin | +| [`polars join`](/commands/docs/polars_join.md) | Joins a lazy frame with other lazy frame. | plugin | +| [`polars join-where`](/commands/docs/polars_join-where.md) | Joins a lazy frame with other lazy frame based on conditions. | plugin | +| [`polars last`](/commands/docs/polars_last.md) | Creates new dataframe with tail rows or creates a last expression. | plugin | +| [`polars len`](/commands/docs/polars_len.md) | Return the number of rows in the context. This is similar to COUNT(*) in SQL. | plugin | +| [`polars list-contains`](/commands/docs/polars_list-contains.md) | Checks if an element is contained in a list. | plugin | +| [`polars lit`](/commands/docs/polars_lit.md) | Creates a literal expression. | plugin | +| [`polars lowercase`](/commands/docs/polars_lowercase.md) | Lowercase the strings in the column. | plugin | +| [`polars math`](/commands/docs/polars_math.md) | Collection of math functions to be applied on one or more column expressions | plugin | +| [`polars max`](/commands/docs/polars_max.md) | Creates a max expression or aggregates columns to their max value. | plugin | +| [`polars mean`](/commands/docs/polars_mean.md) | Creates a mean expression for an aggregation or aggregates columns to their mean value. | plugin | +| [`polars median`](/commands/docs/polars_median.md) | Median value from columns in a dataframe or creates expression for an aggregation | plugin | +| [`polars min`](/commands/docs/polars_min.md) | Creates a min expression or aggregates columns to their min value. | plugin | +| [`polars n-unique`](/commands/docs/polars_n-unique.md) | Counts unique values. | plugin | +| [`polars not`](/commands/docs/polars_not.md) | Inverts boolean mask. | plugin | +| [`polars open`](/commands/docs/polars_open.md) | Opens CSV, JSON, NDJSON/JSON lines, arrow, avro, or parquet file to create dataframe. A lazy dataframe will be created by default, if supported. | plugin | +| [`polars otherwise`](/commands/docs/polars_otherwise.md) | Completes a when expression. | plugin | +| [`polars over`](/commands/docs/polars_over.md) | Compute expressions over a window group defined by partition expressions. | plugin | +| [`polars pivot`](/commands/docs/polars_pivot.md) | Pivot a DataFrame from long to wide format. | plugin | +| [`polars profile`](/commands/docs/polars_profile.md) | Profile a lazy dataframe. | plugin | +| [`polars qcut`](/commands/docs/polars_qcut.md) | Bin continuous values into discrete categories based on their quantiles for a series. | plugin | +| [`polars quantile`](/commands/docs/polars_quantile.md) | Aggregates the columns to the selected quantile. | plugin | +| [`polars query`](/commands/docs/polars_query.md) | Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. | plugin | +| [`polars rename`](/commands/docs/polars_rename.md) | Rename a dataframe column. | plugin | +| [`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 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 | +| [`polars select`](/commands/docs/polars_select.md) | Selects columns from lazyframe. | plugin | +| [`polars set`](/commands/docs/polars_set.md) | Sets value where given mask is true. | plugin | +| [`polars set-with-idx`](/commands/docs/polars_set-with-idx.md) | Sets value in the given index. | plugin | +| [`polars shape`](/commands/docs/polars_shape.md) | Shows column and row size for a dataframe. | plugin | +| [`polars shift`](/commands/docs/polars_shift.md) | Shifts the values by a given period. | plugin | +| [`polars slice`](/commands/docs/polars_slice.md) | Creates new dataframe from a slice of rows. | plugin | +| [`polars sort-by`](/commands/docs/polars_sort-by.md) | Sorts a lazy dataframe based on expression(s). | plugin | +| [`polars std`](/commands/docs/polars_std.md) | Creates a std expression for an aggregation of std value from columns in a dataframe. | plugin | +| [`polars store-get`](/commands/docs/polars_store-get.md) | Gets a Dataframe or other object from the plugin cache. | plugin | +| [`polars store-ls`](/commands/docs/polars_store-ls.md) | Lists stored polars objects. | plugin | +| [`polars store-rm`](/commands/docs/polars_store-rm.md) | Removes a stored Dataframe or other object from the plugin cache. | plugin | +| [`polars str-join`](/commands/docs/polars_str-join.md) | Concatenates strings within a column or dataframes | plugin | +| [`polars str-lengths`](/commands/docs/polars_str-lengths.md) | Get lengths of all strings. | plugin | +| [`polars str-replace`](/commands/docs/polars_str-replace.md) | Replace the leftmost (sub)string by a regex pattern. | plugin | +| [`polars str-replace-all`](/commands/docs/polars_str-replace-all.md) | Replace all (sub)strings by a regex pattern. | plugin | +| [`polars str-slice`](/commands/docs/polars_str-slice.md) | Slices the string from the start position until the selected length. | plugin | +| [`polars str-split`](/commands/docs/polars_str-split.md) | Split the string by a substring. The resulting dtype is list\. | plugin | +| [`polars str-strip-chars`](/commands/docs/polars_str-strip-chars.md) | Strips specified characters from strings in a column | plugin | +| [`polars strftime`](/commands/docs/polars_strftime.md) | Formats date based on string rule. | plugin | +| [`polars struct-json-encode`](/commands/docs/polars_struct-json-encode.md) | Convert this struct to a string column with json values. | plugin | +| [`polars sum`](/commands/docs/polars_sum.md) | Creates a sum expression for an aggregation or aggregates columns to their sum value. | plugin | +| [`polars summary`](/commands/docs/polars_summary.md) | For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. | plugin | +| [`polars take`](/commands/docs/polars_take.md) | Creates new dataframe using the given indices. | plugin | +| [`polars truncate`](/commands/docs/polars_truncate.md) | Divide the date/datetime range into buckets. | plugin | +| [`polars unique`](/commands/docs/polars_unique.md) | Returns unique values from a dataframe. | plugin | +| [`polars unnest`](/commands/docs/polars_unnest.md) | 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. | plugin | +| [`polars unpivot`](/commands/docs/polars_unpivot.md) | Unpivot a DataFrame from wide to long format. | plugin | +| [`polars uppercase`](/commands/docs/polars_uppercase.md) | Uppercase the strings in the column. | plugin | +| [`polars value-counts`](/commands/docs/polars_value-counts.md) | Returns a dataframe with the counts for unique values in series. | plugin | +| [`polars var`](/commands/docs/polars_var.md) | Create a var expression for an aggregation. | plugin | +| [`polars when`](/commands/docs/polars_when.md) | Creates and modifies a when expression. | plugin | +| [`polars with-column`](/commands/docs/polars_with-column.md) | Adds a series to the dataframe. | plugin | \ No newline at end of file diff --git a/commands/docs/polars_agg-groups.md b/commands/docs/polars_agg-groups.md index 424df5975e5..ab57e5dca1c 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.104.0 +version: 0.105.0 dataframe: | Creates an agg_groups expression. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Get the group index of the group by operations. diff --git a/commands/docs/polars_agg.md b/commands/docs/polars_agg.md index cb30e8e7544..c0e944362fd 100644 --- a/commands/docs/polars_agg.md +++ b/commands/docs/polars_agg.md @@ -2,7 +2,7 @@ title: polars agg categories: | lazyframe -version: 0.104.0 +version: 0.105.0 lazyframe: | Performs a series of aggregations from a group-by. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Group by and perform an aggregation diff --git a/commands/docs/polars_all-false.md b/commands/docs/polars_all-false.md index b63b73260bb..57edf6a12e1 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.104.0 +version: 0.105.0 dataframe: | Returns true if all values are false. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Returns true if all values are false diff --git a/commands/docs/polars_all-true.md b/commands/docs/polars_all-true.md index d4f4373509e..beff918b2c8 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.104.0 +version: 0.105.0 dataframe: | Returns true if all values are true. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Returns true if all values are true diff --git a/commands/docs/polars_append.md b/commands/docs/polars_append.md index 2d8292e0181..9fdbb4073ae 100644 --- a/commands/docs/polars_append.md +++ b/commands/docs/polars_append.md @@ -2,7 +2,7 @@ title: polars append categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Appends a new dataframe. usage: | @@ -38,9 +38,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Appends a dataframe as new columns diff --git a/commands/docs/polars_arg-max.md b/commands/docs/polars_arg-max.md index 8c8cb1ca800..57cb5bcfc5d 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.104.0 +version: 0.105.0 dataframe: | Return index for max value in series. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Returns index for max value diff --git a/commands/docs/polars_arg-min.md b/commands/docs/polars_arg-min.md index 21a0ae373df..768659dd9a3 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.104.0 +version: 0.105.0 dataframe: | Return index for min value in series. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Returns index for min value diff --git a/commands/docs/polars_arg-sort.md b/commands/docs/polars_arg-sort.md index 337e7a85b7b..4595cf7d29d 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.104.0 +version: 0.105.0 dataframe: | Returns indexes for a sorted series. usage: | @@ -36,9 +36,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Returns indexes for a sorted series diff --git a/commands/docs/polars_arg-true.md b/commands/docs/polars_arg-true.md index 17147061ea8..8ae3a8411c1 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.104.0 +version: 0.105.0 dataframe: | Returns indexes where values are true. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Returns indexes where values are true diff --git a/commands/docs/polars_arg-unique.md b/commands/docs/polars_arg-unique.md index 4161637969c..50748657f47 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.104.0 +version: 0.105.0 dataframe: | Returns indexes for unique values. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Returns indexes for unique values diff --git a/commands/docs/polars_arg-where.md b/commands/docs/polars_arg-where.md index 7477418a4df..e9b1bf019ec 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.104.0 +version: 0.105.0 expression: | Creates an expression that returns the arguments where expression is true. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ----- | ---------- | +| any | expression | ## Examples Return a dataframe where the value match the expression diff --git a/commands/docs/polars_as-date.md b/commands/docs/polars_as-date.md index 78526d404c0..7bb37272aa1 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.104.0 +version: 0.105.0 dataframe: | Converts string to date. usage: | @@ -38,9 +38,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Converts string to date diff --git a/commands/docs/polars_as-datetime.md b/commands/docs/polars_as-datetime.md index c5847209c28..b63b054faa1 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.104.0 +version: 0.105.0 dataframe: | Converts string to datetime. usage: | @@ -31,7 +31,7 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. - `--not-exact, -n`: the format string may be contained in the date (e.g. foo-2021-01-01-bar could match 2021-01-01) - `--naive`: the input datetimes should be parsed as naive (i.e., not timezone-aware). Ignored if input is an expression. - - `--ambiguous, -a {one_of(string, nothing)}`: Determine how to deal with ambiguous datetimes: + - `--ambiguous, -a {oneof}`: Determine how to deal with ambiguous datetimes: `raise` (default): raise error `earliest`: use the earliest datetime `latest`: use the latest datetime @@ -45,9 +45,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Converts string to datetime @@ -91,10 +92,10 @@ Converts string to datetime using the `--not-exact` flag even with excessive sym ╭───┬─────────────╮ │ # │ datetime │ ├───┼─────────────┤ -│ 0 │ in 6 months │ -│ 1 │ in 6 months │ -│ 2 │ in 6 months │ -│ 3 │ in 6 months │ +│ 0 │ in 4 months │ +│ 1 │ in 4 months │ +│ 2 │ in 4 months │ +│ 3 │ in 4 months │ ╰───┴─────────────╯ ``` diff --git a/commands/docs/polars_as.md b/commands/docs/polars_as.md index 769dfb8ae6f..6cdd89235b4 100644 --- a/commands/docs/polars_as.md +++ b/commands/docs/polars_as.md @@ -2,7 +2,7 @@ title: polars as categories: | expression -version: 0.104.0 +version: 0.105.0 expression: | Creates an alias expression. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Creates and alias expression diff --git a/commands/docs/polars_cache.md b/commands/docs/polars_cache.md index 04508153b33..485dd26c2fa 100644 --- a/commands/docs/polars_cache.md +++ b/commands/docs/polars_cache.md @@ -2,7 +2,7 @@ title: polars cache categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Caches operations in a new LazyFrame. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Caches the result into a new LazyFrame diff --git a/commands/docs/polars_cast.md b/commands/docs/polars_cast.md index 56b90b82144..013961baf65 100644 --- a/commands/docs/polars_cast.md +++ b/commands/docs/polars_cast.md @@ -2,7 +2,7 @@ title: polars cast categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Cast a column to a different dtype. usage: | @@ -35,9 +35,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Cast a column in a dataframe to a different dtype diff --git a/commands/docs/polars_col.md b/commands/docs/polars_col.md index 7188c99a473..7d32e459f89 100644 --- a/commands/docs/polars_col.md +++ b/commands/docs/polars_col.md @@ -2,7 +2,7 @@ title: polars col categories: | expression -version: 0.104.0 +version: 0.105.0 expression: | Creates a named column expression. usage: | @@ -33,15 +33,15 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Parameters - - `column name`: Name of column to be used. '*' can be used for all columns. + - `column name`: Name of column to be used. '*' can be used for all columns. Accepts regular expression input; regular expressions should start with ^ and end with $. - `...rest`: Additional columns to be used. Cannot be '*' ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ----- | ---------- | +| any | expression | ## Examples Creates a named column expression and converts it to a nu object @@ -87,3 +87,15 @@ Select multiple columns by types (cannot be used with asterisk wildcard) ╰───┴───┴───┴──────╯ ``` + +Select columns using a regular expression +```nu +> [[ham hamburger foo bar]; [1 11 2 a] [2 22 1 b]] | polars into-df | polars select (polars col '^ham.*$') | polars collect +╭───┬─────┬───────────╮ +│ # │ ham │ hamburger │ +├───┼─────┼───────────┤ +│ 0 │ 1 │ 11 │ +│ 1 │ 2 │ 22 │ +╰───┴─────┴───────────╯ + +``` diff --git a/commands/docs/polars_collect.md b/commands/docs/polars_collect.md index c45bfc4dec2..2a17605fbdd 100644 --- a/commands/docs/polars_collect.md +++ b/commands/docs/polars_collect.md @@ -2,7 +2,7 @@ title: polars collect categories: | lazyframe -version: 0.104.0 +version: 0.105.0 lazyframe: | Collect lazy dataframe into eager dataframe. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples drop duplicates diff --git a/commands/docs/polars_columns.md b/commands/docs/polars_columns.md index 828d743c02c..41714b0a024 100644 --- a/commands/docs/polars_columns.md +++ b/commands/docs/polars_columns.md @@ -2,7 +2,7 @@ title: polars columns categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Show dataframe columns. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | ------ | +| dataframe | any | ## Examples Dataframe columns diff --git a/commands/docs/polars_concat-str.md b/commands/docs/polars_concat-str.md index 0c2353e5129..c2a92253121 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.104.0 +version: 0.105.0 expression: | Creates a concat string expression. usage: | @@ -35,9 +35,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ----- | ---------- | +| any | expression | ## Examples Creates a concat string expression diff --git a/commands/docs/polars_concat.md b/commands/docs/polars_concat.md index 478a7f1aae9..bc3a730270e 100644 --- a/commands/docs/polars_concat.md +++ b/commands/docs/polars_concat.md @@ -2,7 +2,7 @@ title: polars concat categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Concatenate two or more dataframes. usage: | @@ -43,9 +43,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ----- | --------- | +| any | dataframe | ## Examples Concatenates two dataframes with the dataframe in the pipeline. diff --git a/commands/docs/polars_contains.md b/commands/docs/polars_contains.md index 09a14c47055..491d58df312 100644 --- a/commands/docs/polars_contains.md +++ b/commands/docs/polars_contains.md @@ -2,7 +2,7 @@ title: polars contains categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Checks if a pattern is contained in a string. usage: | @@ -34,9 +34,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Returns boolean indicating if pattern was found in a column diff --git a/commands/docs/polars_convert-time-zone.md b/commands/docs/polars_convert-time-zone.md index e17ba7a86f2..2fb44308e69 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.104.0 +version: 0.105.0 dataframe: | Convert datetime to target timezone. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Convert timezone for timezone-aware datetime @@ -44,12 +44,12 @@ Convert timezone for timezone-aware datetime > ["2025-04-10 09:30:00 -0400" "2025-04-10 10:30:00 -0400"] | polars into-df | polars as-datetime "%Y-%m-%d %H:%M:%S %z" | polars select (polars col datetime | polars convert-time-zone "Europe/Lisbon") -╭───┬─────────────╮ -│ # │ datetime │ -├───┼─────────────┤ -│ 0 │ 2 weeks ago │ -│ 1 │ 2 weeks ago │ -╰───┴─────────────╯ +╭───┬──────────────╮ +│ # │ datetime │ +├───┼──────────────┤ +│ 0 │ 2 months ago │ +│ 1 │ 2 months ago │ +╰───┴──────────────╯ ``` @@ -58,11 +58,11 @@ Timezone conversions for timezone-naive datetime will assume the original timezo > ["2025-04-10 09:30:00" "2025-04-10 10:30:00"] | polars into-df | polars as-datetime "%Y-%m-%d %H:%M:%S" --naive | polars select (polars col datetime | polars convert-time-zone "America/New_York") -╭───┬─────────────╮ -│ # │ datetime │ -├───┼─────────────┤ -│ 0 │ 2 weeks ago │ -│ 1 │ 2 weeks ago │ -╰───┴─────────────╯ +╭───┬──────────────╮ +│ # │ datetime │ +├───┼──────────────┤ +│ 0 │ 2 months ago │ +│ 1 │ 2 months ago │ +╰───┴──────────────╯ ``` diff --git a/commands/docs/polars_count-null.md b/commands/docs/polars_count-null.md index 0c4f50507c0..391574028cd 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.104.0 +version: 0.105.0 dataframe: | Counts null values. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Counts null values diff --git a/commands/docs/polars_count.md b/commands/docs/polars_count.md index efad4fb2163..a5103bf6b8d 100644 --- a/commands/docs/polars_count.md +++ b/commands/docs/polars_count.md @@ -2,7 +2,7 @@ title: polars count categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Returns the number of non-null values in the column. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Count the number of non-null values in a column diff --git a/commands/docs/polars_cumulative.md b/commands/docs/polars_cumulative.md index 6e262c12854..f5ba87c0121 100644 --- a/commands/docs/polars_cumulative.md +++ b/commands/docs/polars_cumulative.md @@ -2,7 +2,7 @@ title: polars cumulative categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Cumulative calculation for a column or series. usage: | @@ -38,9 +38,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Cumulative sum for a column diff --git a/commands/docs/polars_cut.md b/commands/docs/polars_cut.md index f2c6bde51e5..3959b7d66f2 100644 --- a/commands/docs/polars_cut.md +++ b/commands/docs/polars_cut.md @@ -2,7 +2,7 @@ title: polars cut categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Bin continuous values into discrete categories for a series. usage: | @@ -40,9 +40,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Divide the column into three categories. diff --git a/commands/docs/polars_datepart.md b/commands/docs/polars_datepart.md index 4ddd1270f99..f210f3915c4 100644 --- a/commands/docs/polars_datepart.md +++ b/commands/docs/polars_datepart.md @@ -2,7 +2,7 @@ title: polars datepart categories: | expression -version: 0.104.0 +version: 0.105.0 expression: | Creates an expression for capturing the specified datepart in a column. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Creates an expression to capture the year date part @@ -60,15 +60,28 @@ Creates an expression to capture multiple date parts (polars col datetime | polars datepart minute | polars as datetime_minute ), (polars col datetime | polars datepart second | polars as datetime_second ), (polars col datetime | polars datepart nanosecond | polars as datetime_ns ) ] -╭───┬─────────────┬───────────────┬────────────────┬──────────────┬───────────────┬─────────────────┬───────────┬─────╮ -│ # │ datetime │ datetime_year │ datetime_month │ datetime_day │ datetime_hour │ datetime_minute │ datetime_ │ dat │ -│ │ │ │ │ │ │ │ second │ eti │ -│ │ │ │ │ │ │ │ │ me_ │ -│ │ │ │ │ │ │ │ │ ns │ -├───┼─────────────┼───────────────┼────────────────┼──────────────┼───────────────┼─────────────────┼───────────┼─────┤ -│ 0 │ 3 years ago │ 2021 │ 12 │ 30 │ 1 │ 2 │ 3 │ 123 │ -│ │ │ │ │ │ │ │ │ 456 │ -│ │ │ │ │ │ │ │ │ 789 │ -╰───┴─────────────┴───────────────┴────────────────┴──────────────┴───────────────┴─────────────────┴───────────┴─────╯ +╭───┬─────────────┬───────────────┬────────────────┬──────────────┬───────────────┬─────────────────┬─────────────┬───╮ +│ # │ datetime │ datetime_year │ datetime_month │ datetime_day │ datetime_hour │ datetime_minute │ datetime_se │ d │ +│ │ │ │ │ │ │ │ cond │ a │ +│ │ │ │ │ │ │ │ │ t │ +│ │ │ │ │ │ │ │ │ e │ +│ │ │ │ │ │ │ │ │ t │ +│ │ │ │ │ │ │ │ │ i │ +│ │ │ │ │ │ │ │ │ m │ +│ │ │ │ │ │ │ │ │ e │ +│ │ │ │ │ │ │ │ │ _ │ +│ │ │ │ │ │ │ │ │ n │ +│ │ │ │ │ │ │ │ │ s │ +├───┼─────────────┼───────────────┼────────────────┼──────────────┼───────────────┼─────────────────┼─────────────┼───┤ +│ 0 │ 3 years ago │ 2021 │ 12 │ 30 │ 1 │ 2 │ 3 │ 1 │ +│ │ │ │ │ │ │ │ │ 2 │ +│ │ │ │ │ │ │ │ │ 3 │ +│ │ │ │ │ │ │ │ │ 4 │ +│ │ │ │ │ │ │ │ │ 5 │ +│ │ │ │ │ │ │ │ │ 6 │ +│ │ │ │ │ │ │ │ │ 7 │ +│ │ │ │ │ │ │ │ │ 8 │ +│ │ │ │ │ │ │ │ │ 9 │ +╰───┴─────────────┴───────────────┴────────────────┴──────────────┴───────────────┴─────────────────┴─────────────┴───╯ ``` diff --git a/commands/docs/polars_decimal.md b/commands/docs/polars_decimal.md index b6f18fc69d8..543e76320a2 100644 --- a/commands/docs/polars_decimal.md +++ b/commands/docs/polars_decimal.md @@ -2,7 +2,7 @@ title: polars decimal categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Converts a string column into a decimal column usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Modifies strings to decimal diff --git a/commands/docs/polars_drop-duplicates.md b/commands/docs/polars_drop-duplicates.md index 1e3e80a0c69..2ffcb97e87c 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.104.0 +version: 0.105.0 dataframe: | Drops duplicate values in dataframe. usage: | @@ -39,9 +39,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples drop duplicates diff --git a/commands/docs/polars_drop-nulls.md b/commands/docs/polars_drop-nulls.md index 5d262dc3e89..0b46e7e681d 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.104.0 +version: 0.105.0 dataframe: | Drops null values in dataframe. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples drop null values in dataframe diff --git a/commands/docs/polars_drop.md b/commands/docs/polars_drop.md index 3aa36583d61..5640c6e7a31 100644 --- a/commands/docs/polars_drop.md +++ b/commands/docs/polars_drop.md @@ -2,7 +2,7 @@ title: polars drop categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Creates a new dataframe by dropping the selected columns. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples drop column a diff --git a/commands/docs/polars_dummies.md b/commands/docs/polars_dummies.md index ee9a3522f5b..b4035b22c08 100644 --- a/commands/docs/polars_dummies.md +++ b/commands/docs/polars_dummies.md @@ -2,7 +2,7 @@ title: polars dummies categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Creates a new dataframe with dummy variables. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Create new dataframe with dummy variables from a dataframe diff --git a/commands/docs/polars_explode.md b/commands/docs/polars_explode.md index 2c10752d887..5a5625af5a3 100644 --- a/commands/docs/polars_explode.md +++ b/commands/docs/polars_explode.md @@ -2,7 +2,7 @@ title: polars explode categories: | lazyframe -version: 0.104.0 +version: 0.105.0 lazyframe: | Explodes a dataframe or creates a explode expression. usage: | @@ -34,9 +34,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Explode the specified dataframe diff --git a/commands/docs/polars_expr-not.md b/commands/docs/polars_expr-not.md index bd05d9450a6..7a04c1f8c4f 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.104.0 +version: 0.105.0 dataframe: | Creates a not expression. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Creates a not expression diff --git a/commands/docs/polars_fetch.md b/commands/docs/polars_fetch.md index 66636252b47..9e447d89e75 100644 --- a/commands/docs/polars_fetch.md +++ b/commands/docs/polars_fetch.md @@ -2,7 +2,7 @@ title: polars fetch categories: | lazyframe -version: 0.104.0 +version: 0.105.0 lazyframe: | Collects the lazyframe to the selected rows. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Fetch a rows from the dataframe diff --git a/commands/docs/polars_fill-nan.md b/commands/docs/polars_fill-nan.md index 64e00bd415e..f317e30ae60 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.104.0 +version: 0.105.0 lazyframe: | Replaces NaN values with the given expression. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Fills the NaN values with 0 diff --git a/commands/docs/polars_fill-null.md b/commands/docs/polars_fill-null.md index 81c9819297a..c56ea856acf 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.104.0 +version: 0.105.0 lazyframe: | Replaces NULL values with the given expression. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Fills the null values by 0 diff --git a/commands/docs/polars_filter-with.md b/commands/docs/polars_filter-with.md index 28b3b83a883..3a0a713e037 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.104.0 +version: 0.105.0 dataframe_or_lazyframe: | Filters dataframe using a mask or expression as reference. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Filter dataframe using a bool mask diff --git a/commands/docs/polars_filter.md b/commands/docs/polars_filter.md index 7e1e1c41e6c..4febb854d63 100644 --- a/commands/docs/polars_filter.md +++ b/commands/docs/polars_filter.md @@ -2,7 +2,7 @@ title: polars filter categories: | lazyframe -version: 0.104.0 +version: 0.105.0 lazyframe: | Filter dataframe based in expression. usage: | @@ -34,9 +34,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Filter dataframe using an expression @@ -54,11 +55,29 @@ Filter dataframe using an expression Filter dataframe for rows where dt is within the last 2 days of the maximum dt value ```nu > [[dt val]; [2025-04-01 1] [2025-04-02 2] [2025-04-03 3] [2025-04-04 4]] | polars into-df | polars filter ((polars col dt) > ((polars col dt | polars max | $in - 2day))) -╭───┬─────────────┬─────╮ -│ # │ dt │ val │ -├───┼─────────────┼─────┤ -│ 0 │ 3 weeks ago │ 3 │ -│ 1 │ 3 weeks ago │ 4 │ -╰───┴─────────────┴─────╯ +╭───┬──────────────┬─────╮ +│ # │ dt │ val │ +├───┼──────────────┼─────┤ +│ 0 │ 2 months ago │ 3 │ +│ 1 │ 2 months ago │ 4 │ +╰───┴──────────────┴─────╯ + +``` + +Filter a single column in a group-by context +```nu +> [[a b]; [foo 1] [foo 2] [foo 3] [bar 2] [bar 3] [bar 4]] | polars into-df + | polars group-by a --maintain-order + | polars agg { + lt: (polars col b | polars filter ((polars col b) < 2) | polars sum) + gte: (polars col b | polars filter ((polars col b) >= 3) | polars sum) + } + | polars collect +╭───┬─────┬────┬─────╮ +│ # │ a │ lt │ gte │ +├───┼─────┼────┼─────┤ +│ 0 │ foo │ 1 │ 3 │ +│ 1 │ bar │ 0 │ 7 │ +╰───┴─────┴────┴─────╯ ``` diff --git a/commands/docs/polars_first.md b/commands/docs/polars_first.md index 7d7cbcd380e..754f6606596 100644 --- a/commands/docs/polars_first.md +++ b/commands/docs/polars_first.md @@ -2,7 +2,7 @@ title: polars first categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Show only the first number of rows or create a first expression usage: | @@ -34,9 +34,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Return the first row of a dataframe @@ -67,3 +68,16 @@ Creates a first expression from a column > polars col a | polars first ``` + +Aggregate the first values in the group. +```nu +> [[a b c d]; [1 0.5 true Apple] [2 0.5 true Orange] [2 4 true Apple] [3 10 false Apple] [4 13 false Banana] [5 14 true Banana]] | polars into-df -s {a: u8, b: f32, c: bool, d: str} | polars group-by d | polars first | polars sort-by [a] | polars collect +╭───┬────────┬───┬───────┬───────╮ +│ # │ d │ a │ b │ c │ +├───┼────────┼───┼───────┼───────┤ +│ 0 │ Apple │ 1 │ 0.50 │ true │ +│ 1 │ Orange │ 2 │ 0.50 │ true │ +│ 2 │ Banana │ 4 │ 13.00 │ false │ +╰───┴────────┴───┴───────┴───────╯ + +``` diff --git a/commands/docs/polars_flatten.md b/commands/docs/polars_flatten.md index 7eeb4cd03e9..a86aaa42299 100644 --- a/commands/docs/polars_flatten.md +++ b/commands/docs/polars_flatten.md @@ -2,7 +2,7 @@ title: polars flatten categories: | lazyframe -version: 0.104.0 +version: 0.105.0 lazyframe: | An alias for polars explode. usage: | @@ -34,9 +34,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Flatten the specified dataframe diff --git a/commands/docs/polars_get-day.md b/commands/docs/polars_get-day.md index a9411a71851..fd17b4d55d6 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.104.0 +version: 0.105.0 dataframe: | Gets day from date. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Returns day from a date diff --git a/commands/docs/polars_get-hour.md b/commands/docs/polars_get-hour.md index 39d3dea1bdb..786c8f46ca6 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.104.0 +version: 0.105.0 dataframe: | Gets hour from datetime. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Returns hour from a date diff --git a/commands/docs/polars_get-minute.md b/commands/docs/polars_get-minute.md index cc66ded22b1..fc69daf0fec 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.104.0 +version: 0.105.0 dataframe: | Gets minute from date. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Returns minute from a date diff --git a/commands/docs/polars_get-month.md b/commands/docs/polars_get-month.md index ca0057b4544..31402971435 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.104.0 +version: 0.105.0 dataframe: | Gets month from date. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Returns month from a date diff --git a/commands/docs/polars_get-nanosecond.md b/commands/docs/polars_get-nanosecond.md index e3fdcdf1f7a..e7bdc315521 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.104.0 +version: 0.105.0 dataframe: | Gets nanosecond from date. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Returns nanosecond from a date diff --git a/commands/docs/polars_get-ordinal.md b/commands/docs/polars_get-ordinal.md index b059d9a5ab6..4e47e3feb05 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.104.0 +version: 0.105.0 dataframe: | Gets ordinal from date. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Returns ordinal from a date diff --git a/commands/docs/polars_get-second.md b/commands/docs/polars_get-second.md index 5f82ab39ff9..4570507c8c5 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.104.0 +version: 0.105.0 dataframe: | Gets second from date. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Returns second from a date diff --git a/commands/docs/polars_get-week.md b/commands/docs/polars_get-week.md index 3426aa9aa38..0698b3e4c3f 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.104.0 +version: 0.105.0 dataframe: | Gets week from date. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Returns week from a date diff --git a/commands/docs/polars_get-weekday.md b/commands/docs/polars_get-weekday.md index 25b9af51588..2d13f6f30cc 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.104.0 +version: 0.105.0 dataframe: | Gets weekday from date. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Returns weekday from a date diff --git a/commands/docs/polars_get-year.md b/commands/docs/polars_get-year.md index e4feec2b937..05186d00476 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.104.0 +version: 0.105.0 dataframe: | Gets year from date. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Returns year from a date diff --git a/commands/docs/polars_get.md b/commands/docs/polars_get.md index d3ea9c11d60..65b65411759 100644 --- a/commands/docs/polars_get.md +++ b/commands/docs/polars_get.md @@ -2,7 +2,7 @@ title: polars get categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Creates dataframe with the selected columns. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Returns the selected column diff --git a/commands/docs/polars_group-by.md b/commands/docs/polars_group-by.md index 552b3c0927b..d04657dcce0 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.104.0 +version: 0.105.0 lazyframe: | Creates a group-by object that can be used for other aggregations. usage: | @@ -27,6 +27,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ```> polars group-by {flags} ...rest``` +## Flags + + - `--maintain-order, -m`: Ensure that the order of the groups is consistent with the input data. This is slower than a default group by and cannot be run on the streaming engine. + ## Parameters - `...rest`: Expression(s) that define the lazy group-by @@ -34,9 +38,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Group by and perform an aggregation diff --git a/commands/docs/polars_horizontal.md b/commands/docs/polars_horizontal.md new file mode 100644 index 00000000000..0de32134f67 --- /dev/null +++ b/commands/docs/polars_horizontal.md @@ -0,0 +1,81 @@ +--- +title: polars horizontal +categories: | + expression +version: 0.105.0 +expression: | + Horizontal calculation across multiple columns. +usage: | + Horizontal calculation across multiple columns. +editLink: false +contributors: false +--- + + +# `polars horizontal` for [expression](/commands/categories/expression.md) + +
Horizontal calculation across multiple columns.
+ +::: warning This command requires a plugin +The `polars horizontal` command resides in the `polars` plugin. +To use this command, you must install and register `nu_plugin_polars`. +See the [Plugins](/book/plugins.html) chapter in the book for more information. +::: + + +## Signature + +```> polars horizontal {flags} (type) ...rest``` + +## Flags + + - `--nulls, -n`: If set, null value in the input will lead to null output + +## Parameters + + - `type`: horizontal operation. Values of all, any, min, max, sum, and mean are accepted. + - `...rest`: Expression(s) that define the lazy group-by + + +## Input/output types: + +| input | output | +| ----- | ---------- | +| any | expression | +## Examples + +Horizontal sum across two columns (ignore nulls by default) +```nu +> [[a b]; [1 2] [2 3] [3 4] [4 5] [5 null]] + | polars into-df + | polars select (polars horizontal sum a b) + | polars collect +╭───┬─────╮ +│ # │ sum │ +├───┼─────┤ +│ 0 │ 3 │ +│ 1 │ 5 │ +│ 2 │ 7 │ +│ 3 │ 9 │ +│ 4 │ 5 │ +╰───┴─────╯ + +``` + +Horizontal sum across two columns while accounting for nulls +```nu +> [[a b]; [1 2] [2 3] [3 4] [4 5] [5 null]] + | polars into-df + | polars select (polars horizontal sum a b --nulls) + | polars collect +╭───┬─────╮ +│ # │ sum │ +├───┼─────┤ +│ 0 │ 3 │ +│ 1 │ 5 │ +│ 2 │ 7 │ +│ 3 │ 9 │ +│ 4 │ │ +╰───┴─────╯ + +``` diff --git a/commands/docs/polars_implode.md b/commands/docs/polars_implode.md index 4270503ca70..a15cddd10da 100644 --- a/commands/docs/polars_implode.md +++ b/commands/docs/polars_implode.md @@ -2,7 +2,7 @@ title: polars implode categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Aggregates values into a list. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Create two lists for columns a and b with all the rows as values. diff --git a/commands/docs/polars_integer.md b/commands/docs/polars_integer.md index 02527ac618c..2132effe05f 100644 --- a/commands/docs/polars_integer.md +++ b/commands/docs/polars_integer.md @@ -2,7 +2,7 @@ title: polars integer categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Converts a string column into a integer column usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Modifies strings to integer diff --git a/commands/docs/polars_into-df.md b/commands/docs/polars_into-df.md index f973f655d3c..aa83ce87412 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.104.0 +version: 0.105.0 dataframe: | Converts a list, table or record into a dataframe. usage: | @@ -35,9 +35,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ----- | --------- | +| any | dataframe | ## Examples Takes a dictionary and creates a dataframe diff --git a/commands/docs/polars_into-dtype.md b/commands/docs/polars_into-dtype.md index 9c58b323a4b..0a350f9ebd1 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.104.0 +version: 0.105.0 dataframe: | Convert a string to a specific datatype. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ------ | ------ | -| string | any | +| input | output | +| ------ | -------- | +| string | datatype | ## Examples Convert a string to a specific datatype and back to a nu object diff --git a/commands/docs/polars_into-lazy.md b/commands/docs/polars_into-lazy.md index 8457dc70fd7..9a041ee1508 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.104.0 +version: 0.105.0 lazyframe: | Converts a dataframe into a lazy dataframe. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ----- | --------- | +| any | dataframe | ## Examples Takes a table and creates a lazyframe diff --git a/commands/docs/polars_into-nu.md b/commands/docs/polars_into-nu.md index 753cf19e69b..770eb678582 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.104.0 +version: 0.105.0 dataframe: | Converts a dataframe or an expression into nushell value for access and exploration. usage: | @@ -36,9 +36,12 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ------ | +| expression | any | +| dataframe | table | +| datatype | any | +| schema | any | ## Examples Shows head rows from dataframe diff --git a/commands/docs/polars_into-repr.md b/commands/docs/polars_into-repr.md index 411a10fabd2..af3dc2002a8 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.104.0 +version: 0.105.0 dataframe: | Display a dataframe in its repr format. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | string | +| input | output | +| --------- | ------ | +| dataframe | string | ## Examples Shows dataframe in repr format diff --git a/commands/docs/polars_into-schema.md b/commands/docs/polars_into-schema.md index 2b30b36e757..f31d5ee4cac 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.104.0 +version: 0.105.0 dataframe: | Convert a value to a polars schema object usage: | @@ -32,7 +32,7 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. | input | output | | ----- | ------ | -| any | any | +| any | schema | ## Examples Convert a record into a schema and back to a nu object diff --git a/commands/docs/polars_is-duplicated.md b/commands/docs/polars_is-duplicated.md index bf218457a3b..e7e00a797c0 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.104.0 +version: 0.105.0 dataframe: | Creates mask indicating duplicated values. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Create mask indicating duplicated values diff --git a/commands/docs/polars_is-in.md b/commands/docs/polars_is-in.md index e69fe49645c..4d4a655b1a4 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.104.0 +version: 0.105.0 expression: | Creates an is-in expression or checks to see if the elements are contained in the right series usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Creates a is-in expression @@ -52,21 +52,3 @@ Creates a is-in expression ╰───┴───────┴───┴───────╯ ``` - -Checks if elements from a series are contained in right series -```nu -> let other = ([1 3 6] | polars into-df); - [5 6 6 6 8 8 8] | polars into-df | polars is-in $other -╭───┬───────╮ -│ # │ is_in │ -├───┼───────┤ -│ 0 │ false │ -│ 1 │ true │ -│ 2 │ true │ -│ 3 │ true │ -│ 4 │ false │ -│ 5 │ false │ -│ 6 │ false │ -╰───┴───────╯ - -``` diff --git a/commands/docs/polars_is-not-null.md b/commands/docs/polars_is-not-null.md index 34c436213f4..f08cb37f000 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.104.0 +version: 0.105.0 dataframe: | Creates mask where value is not null. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Create mask where values are not null diff --git a/commands/docs/polars_is-null.md b/commands/docs/polars_is-null.md index 076836dea55..5dc9b02304d 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.104.0 +version: 0.105.0 dataframe: | Creates mask where value is null. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Create mask where values are null diff --git a/commands/docs/polars_is-unique.md b/commands/docs/polars_is-unique.md index 28dca3f6bf8..144b9689e23 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.104.0 +version: 0.105.0 dataframe: | Creates mask indicating unique values. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Create mask indicating unique values diff --git a/commands/docs/polars_join-where.md b/commands/docs/polars_join-where.md index 2c10e285570..1a67e94e31c 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.104.0 +version: 0.105.0 lazyframe: | Joins a lazy frame with other lazy frame based on conditions. usage: | @@ -35,9 +35,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Join two lazy dataframes with a condition diff --git a/commands/docs/polars_join.md b/commands/docs/polars_join.md index 2d771772371..8e1f0afb1f6 100644 --- a/commands/docs/polars_join.md +++ b/commands/docs/polars_join.md @@ -2,7 +2,7 @@ title: polars join categories: | lazyframe -version: 0.104.0 +version: 0.105.0 lazyframe: | Joins a lazy frame with other lazy frame. usage: | @@ -45,9 +45,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Join two lazy dataframes diff --git a/commands/docs/polars_last.md b/commands/docs/polars_last.md index 57397bec545..c6e474344cc 100644 --- a/commands/docs/polars_last.md +++ b/commands/docs/polars_last.md @@ -2,7 +2,7 @@ title: polars last categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Creates new dataframe with tail rows or creates a last expression. usage: | @@ -34,9 +34,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Create new dataframe with last rows diff --git a/commands/docs/polars_len.md b/commands/docs/polars_len.md index f6e18bbe8a3..3f3ccc52e8e 100644 --- a/commands/docs/polars_len.md +++ b/commands/docs/polars_len.md @@ -2,7 +2,7 @@ title: polars len categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Return the number of rows in the context. This is similar to COUNT(*) in SQL. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ----- | ---------- | +| any | expression | ## Examples Count the number of rows in the the dataframe. diff --git a/commands/docs/polars_list-contains.md b/commands/docs/polars_list-contains.md index dc288f90461..cadc83f5793 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.104.0 +version: 0.105.0 dataframe: | Checks if an element is contained in a list. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Returns boolean indicating if a literal element was found in a list column diff --git a/commands/docs/polars_lit.md b/commands/docs/polars_lit.md index aefeb7e169e..502cce11c13 100644 --- a/commands/docs/polars_lit.md +++ b/commands/docs/polars_lit.md @@ -2,7 +2,7 @@ title: polars lit categories: | expression -version: 0.104.0 +version: 0.105.0 expression: | Creates a literal expression. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ----- | ---------- | +| any | expression | ## Examples Created a literal expression and converts it to a nu object diff --git a/commands/docs/polars_lowercase.md b/commands/docs/polars_lowercase.md index 90f1a6f4cdc..f49da359a4e 100644 --- a/commands/docs/polars_lowercase.md +++ b/commands/docs/polars_lowercase.md @@ -2,7 +2,7 @@ title: polars lowercase categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Lowercase the strings in the column. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Modifies strings in a column to lowercase diff --git a/commands/docs/polars_math.md b/commands/docs/polars_math.md new file mode 100644 index 00000000000..9ee5b468a45 --- /dev/null +++ b/commands/docs/polars_math.md @@ -0,0 +1,111 @@ +--- +title: polars math +categories: | + dataframe +version: 0.105.0 +dataframe: | + Collection of math functions to be applied on one or more column expressions +usage: | + Collection of math functions to be applied on one or more column expressions +editLink: false +contributors: false +--- + + +# `polars math` for [dataframe](/commands/categories/dataframe.md) + +
Collection of math functions to be applied on one or more column expressions
+ +::: warning This command requires a plugin +The `polars math` command resides in the `polars` plugin. +To use this command, you must install and register `nu_plugin_polars`. +See the [Plugins](/book/plugins.html) chapter in the book for more information. +::: + + +## Signature + +```> polars math {flags} (type) ...rest``` + +## Parameters + + - `type`: Function name. See extra description for full list of accepted values + - `...rest`: Extra arguments required by some functions + + +## Input/output types: + +| input | output | +| ---------- | ---------- | +| expression | expression | +## Examples + +Apply function to column expression +```nu +> [[a]; [0] [-1] [2] [-3] [4]] + | polars into-df + | polars select [ + (polars col a | polars math abs | polars as a_abs) + (polars col a | polars math sign | polars as a_sign) + (polars col a | polars math exp | polars as a_exp)] + | polars collect +╭───┬───────┬────────┬───────╮ +│ # │ a_abs │ a_sign │ a_exp │ +├───┼───────┼────────┼───────┤ +│ 0 │ 0 │ 0 │ 1.00 │ +│ 1 │ 1 │ -1 │ 0.37 │ +│ 2 │ 2 │ 1 │ 7.39 │ +│ 3 │ 3 │ -1 │ 0.05 │ +│ 4 │ 4 │ 1 │ 54.60 │ +╰───┴───────┴────────┴───────╯ + +``` + +Specify arguments for select functions. See description for more information. +```nu +> [[a]; [0] [1] [2] [4] [8] [16]] + | polars into-df + | polars select [ + (polars col a | polars math log 2 | polars as a_base2)] + | polars collect +╭───┬─────────╮ +│ # │ a_base2 │ +├───┼─────────┤ +│ 0 │ -inf │ +│ 1 │ 0.00 │ +│ 2 │ 1.00 │ +│ 3 │ 2.00 │ +│ 4 │ 3.00 │ +│ 5 │ 4.00 │ +╰───┴─────────╯ + +``` + +Specify arguments for select functions. See description for more information. +```nu +> [[a b]; [0 0] [1 1] [2 2] [3 3] [4 4] [5 5]] + | polars into-df + | polars select [ + (polars col a | polars math dot (polars col b) | polars as ab)] + | polars collect +╭───┬───────╮ +│ # │ ab │ +├───┼───────┤ +│ 0 │ 55.00 │ +╰───┴───────╯ + +``` + +## Notes +This is an incomplete implementation of the available functions listed here: https://docs.pola.rs/api/python/stable/reference/expressions/computation.html. + + The following functions are currently available: + - abs + - cos + - dot + - exp + - log + - log1p + - sign + - sin + - sqrt diff --git a/commands/docs/polars_max.md b/commands/docs/polars_max.md index ee88dbe7811..d463474e410 100644 --- a/commands/docs/polars_max.md +++ b/commands/docs/polars_max.md @@ -2,7 +2,7 @@ title: polars max categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Creates a max expression or aggregates columns to their max value. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Max value from columns in a dataframe diff --git a/commands/docs/polars_mean.md b/commands/docs/polars_mean.md index 96dc1573b95..ffbe078f611 100644 --- a/commands/docs/polars_mean.md +++ b/commands/docs/polars_mean.md @@ -2,7 +2,7 @@ title: polars mean categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Creates a mean expression for an aggregation or aggregates columns to their mean value. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Mean value from columns in a dataframe diff --git a/commands/docs/polars_median.md b/commands/docs/polars_median.md index cf70e210aaf..f1b45dc5f9c 100644 --- a/commands/docs/polars_median.md +++ b/commands/docs/polars_median.md @@ -2,7 +2,7 @@ title: polars median categories: | lazyframe -version: 0.104.0 +version: 0.105.0 lazyframe: | Median value from columns in a dataframe or creates expression for an aggregation usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Median aggregation for a group-by diff --git a/commands/docs/polars_min.md b/commands/docs/polars_min.md index d4ae58b3e4d..ff6d1bf7363 100644 --- a/commands/docs/polars_min.md +++ b/commands/docs/polars_min.md @@ -2,7 +2,7 @@ title: polars min categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Creates a min expression or aggregates columns to their min value. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Min value from columns in a dataframe diff --git a/commands/docs/polars_n-unique.md b/commands/docs/polars_n-unique.md index 85544a8ef1b..3a60ae11346 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.104.0 +version: 0.105.0 dataframe: | Counts unique values. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Counts unique values diff --git a/commands/docs/polars_not.md b/commands/docs/polars_not.md index d6e3de8bfde..fca5e68c454 100644 --- a/commands/docs/polars_not.md +++ b/commands/docs/polars_not.md @@ -2,7 +2,7 @@ title: polars not categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Inverts boolean mask. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Inverts boolean mask diff --git a/commands/docs/polars_open.md b/commands/docs/polars_open.md index f8cf91a3d1c..715392b4a42 100644 --- a/commands/docs/polars_open.md +++ b/commands/docs/polars_open.md @@ -2,7 +2,7 @@ title: polars open categories: | dataframe -version: 0.104.0 +version: 0.105.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: | @@ -50,9 +50,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ----- | --------- | +| any | dataframe | ## Examples Takes a file name and creates a dataframe diff --git a/commands/docs/polars_otherwise.md b/commands/docs/polars_otherwise.md index 96cafbdc8cc..1605b399243 100644 --- a/commands/docs/polars_otherwise.md +++ b/commands/docs/polars_otherwise.md @@ -2,7 +2,7 @@ title: polars otherwise categories: | expression -version: 0.104.0 +version: 0.105.0 expression: | Completes a when expression. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ----- | ---------- | +| any | expression | ## Examples Create a when conditions diff --git a/commands/docs/polars_over.md b/commands/docs/polars_over.md index 3c548161b97..9b47af20bdc 100644 --- a/commands/docs/polars_over.md +++ b/commands/docs/polars_over.md @@ -2,7 +2,7 @@ title: polars over categories: | lazyframe -version: 0.104.0 +version: 0.105.0 lazyframe: | Compute expressions over a window group defined by partition expressions. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Compute expression over an aggregation window diff --git a/commands/docs/polars_pivot.md b/commands/docs/polars_pivot.md index 5802e9bacb1..043e8fbf7c2 100644 --- a/commands/docs/polars_pivot.md +++ b/commands/docs/polars_pivot.md @@ -2,7 +2,7 @@ title: polars pivot categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Pivot a DataFrame from long to wide format. usage: | @@ -40,20 +40,20 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Perform a pivot in order to show individuals test score by subject ```nu > [[name subject date test_1 test_2]; [Cady maths 2025-04-01 98 100] [Cady physics 2025-04-01 99 100] [Karen maths 2025-04-02 61 60] [Karen physics 2025-04-02 58 60]] | polars into-df | polars pivot --on [subject] --index [name date] --values [test_1] -╭───┬───────┬─────────────┬───────┬─────────╮ -│ # │ name │ date │ maths │ physics │ -├───┼───────┼─────────────┼───────┼─────────┤ -│ 0 │ Cady │ 4 weeks ago │ 98 │ 99 │ -│ 1 │ Karen │ 3 weeks ago │ 61 │ 58 │ -╰───┴───────┴─────────────┴───────┴─────────╯ +╭───┬───────┬──────────────┬───────┬─────────╮ +│ # │ name │ date │ maths │ physics │ +├───┼───────┼──────────────┼───────┼─────────┤ +│ 0 │ Cady │ 2 months ago │ 98 │ 99 │ +│ 1 │ Karen │ 2 months ago │ 61 │ 58 │ +╰───┴───────┴──────────────┴───────┴─────────╯ ``` diff --git a/commands/docs/polars_profile.md b/commands/docs/polars_profile.md index 41aeac5f0d2..3b7ceec6d15 100644 --- a/commands/docs/polars_profile.md +++ b/commands/docs/polars_profile.md @@ -2,7 +2,7 @@ title: polars profile categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Profile a lazy dataframe. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Profile a lazy dataframe diff --git a/commands/docs/polars_qcut.md b/commands/docs/polars_qcut.md index 1502ee925e2..bdc84eb7b6b 100644 --- a/commands/docs/polars_qcut.md +++ b/commands/docs/polars_qcut.md @@ -2,7 +2,7 @@ title: polars qcut categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Bin continuous values into discrete categories based on their quantiles for a series. usage: | @@ -41,9 +41,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Divide a column into three categories according to pre-defined quantile probabilities. diff --git a/commands/docs/polars_quantile.md b/commands/docs/polars_quantile.md index b0d3327d0d8..5030464ac25 100644 --- a/commands/docs/polars_quantile.md +++ b/commands/docs/polars_quantile.md @@ -2,7 +2,7 @@ title: polars quantile categories: | lazyframe -version: 0.104.0 +version: 0.105.0 lazyframe: | Aggregates the columns to the selected quantile. usage: | @@ -34,9 +34,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples quantile value from columns in a dataframe diff --git a/commands/docs/polars_query.md b/commands/docs/polars_query.md index be2c5ca3817..1652172e0df 100644 --- a/commands/docs/polars_query.md +++ b/commands/docs/polars_query.md @@ -2,7 +2,7 @@ title: polars query categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Query dataframe using SQL diff --git a/commands/docs/polars_rename.md b/commands/docs/polars_rename.md index 98e75dded9b..4238a55b107 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.104.0 +version: 0.105.0 dataframe_or_lazyframe: | Rename a dataframe column. usage: | @@ -35,9 +35,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Renames a series diff --git a/commands/docs/polars_replace-time-zone.md b/commands/docs/polars_replace-time-zone.md index 94a2dc31a5b..40e05bc91ad 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.104.0 +version: 0.105.0 dataframe: | Replace the timezone information in a datetime column. usage: | @@ -29,12 +29,12 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Flags - - `--ambiguous, -a {one_of(string, nothing)}`: Determine how to deal with ambiguous datetimes: + - `--ambiguous, -a {oneof}`: Determine how to deal with ambiguous datetimes: `raise` (default): raise error `earliest`: use the earliest datetime `latest`: use the latest datetime `null`: set to null - - `--nonexistent, -n {one_of(string, nothing)}`: Determine how to deal with non-existent datetimes: raise (default) or null. + - `--nonexistent, -n {oneof}`: Determine how to deal with non-existent datetimes: raise (default) or null. ## Parameters @@ -43,9 +43,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Apply timezone to a naive datetime @@ -71,10 +71,10 @@ Apply timezone with ambiguous datetime ╭───┬─────────────╮ │ # │ datetime │ ├───┼─────────────┤ -│ 0 │ in 6 months │ +│ 0 │ in 4 months │ │ 1 │ │ -│ 2 │ in 6 months │ -│ 3 │ in 6 months │ +│ 2 │ in 4 months │ +│ 3 │ in 4 months │ ╰───┴─────────────╯ ``` @@ -88,10 +88,10 @@ Apply timezone with nonexistent datetime ╭───┬──────────────╮ │ # │ datetime │ ├───┼──────────────┤ -│ 0 │ 2 months ago │ +│ 0 │ 3 months ago │ │ 1 │ │ -│ 2 │ 2 months ago │ -│ 3 │ 2 months ago │ +│ 2 │ 3 months ago │ +│ 3 │ 3 months ago │ ╰───┴──────────────╯ ``` diff --git a/commands/docs/polars_replace.md b/commands/docs/polars_replace.md index 0b115ac3e7c..1a60792486b 100644 --- a/commands/docs/polars_replace.md +++ b/commands/docs/polars_replace.md @@ -1,20 +1,20 @@ --- title: polars replace categories: | - dataframe -version: 0.104.0 -dataframe: | - Replace the leftmost (sub)string by a regex pattern. + expression +version: 0.105.0 +expression: | + Create an expression that replaces old values with new values usage: | - Replace the leftmost (sub)string by a regex pattern. + Create an expression that replaces old values with new values editLink: false contributors: false --- -# `polars replace` for [dataframe](/commands/categories/dataframe.md) +# `polars replace` for [expression](/commands/categories/expression.md) -
Replace the leftmost (sub)string by a regex pattern.
+
Create an expression that replaces old values with new values
::: warning This command requires a plugin The `polars replace` command resides in the `polars` plugin. @@ -25,42 +25,125 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Signature -```> polars replace {flags} ``` +```> polars replace {flags} (old) (new)``` ## Flags - - `--pattern, -p {string}`: Regex pattern to be matched - - `--replace, -r {string}`: replacing string + - `--strict, -s`: Require that all values must be replaced or throw an error (ignored if `old` or `new` are expressions). + - `--default, -d {any}`: Set values that were not replaced to this value. If no default is specified, (default), an error is raised if any values were not replaced. Accepts expression input. Non-expression inputs are parsed as literals. + - `--return-dtype, -t {string}`: Data type of the resulting expression. If set to `null` (default), the data type is determined automatically based on the other inputs. + +## Parameters + + - `old`: Values to be replaced + - `new`: Values to replace by ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples -Replaces string in column +Replace column with different values of same type +```nu +> [[a]; [1] [1] [2] [2]] + | polars into-df + | polars select (polars col a | polars replace [1 2] [10 20]) + | polars collect +╭───┬────╮ +│ # │ a │ +├───┼────┤ +│ 0 │ 10 │ +│ 1 │ 10 │ +│ 2 │ 20 │ +│ 3 │ 20 │ +╰───┴────╯ + +``` + +Replace column with different values of another type ```nu -> [[a]; [abc] [abcabc]] | polars into-df | polars select (polars col a | polars replace --pattern ab --replace AB) | polars collect -╭───┬────────╮ -│ # │ a │ -├───┼────────┤ -│ 0 │ ABc │ -│ 1 │ ABcabc │ -╰───┴────────╯ +> [[a]; [1] [1] [2] [2]] + | polars into-df + | polars select (polars col a | polars replace [1 2] [a b] --strict) + | polars collect +╭───┬───╮ +│ # │ a │ +├───┼───┤ +│ 0 │ a │ +│ 1 │ a │ +│ 2 │ b │ +│ 3 │ b │ +╰───┴───╯ ``` -Replaces string +Replace column with different values based on expressions (cannot be used with strict) ```nu -> [abc abc abc] | polars into-df | polars replace --pattern ab --replace AB +> [[a]; [1] [1] [2] [2]] + | polars into-df + | polars select (polars col a | polars replace [(polars col a | polars max)] [(polars col a | polars max | $in + 5)]) + | polars collect +╭───┬───╮ +│ # │ a │ +├───┼───┤ +│ 0 │ 1 │ +│ 1 │ 1 │ +│ 2 │ 7 │ +│ 3 │ 7 │ +╰───┴───╯ + +``` + +Replace column with different values based on expressions with default +```nu +> [[a]; [1] [1] [2] [3]] + | polars into-df + | polars select (polars col a | polars replace [1] [10] --default (polars col a | polars max | $in * 100) --strict) + | polars collect ╭───┬─────╮ -│ # │ 0 │ +│ # │ a │ ├───┼─────┤ -│ 0 │ ABc │ -│ 1 │ ABc │ -│ 2 │ ABc │ +│ 0 │ 10 │ +│ 1 │ 10 │ +│ 2 │ 300 │ +│ 3 │ 300 │ ╰───┴─────╯ ``` + +Replace column with different values based on expressions with default +```nu +> [[a]; [1] [1] [2] [3]] + | polars into-df + | polars select (polars col a | polars replace [1] [10] --default (polars col a | polars max | $in * 100) --strict --return-dtype str) + | polars collect +╭───┬─────╮ +│ # │ a │ +├───┼─────┤ +│ 0 │ 10 │ +│ 1 │ 10 │ +│ 2 │ 300 │ +│ 3 │ 300 │ +╰───┴─────╯ + +``` + +Replace column with different values using a record +```nu +> [[a]; [1] [1] [2] [2]] + | polars into-df + | polars select (polars col a | polars replace {1: a, 2: b} --strict --return-dtype str) + | polars collect +╭───┬───╮ +│ # │ a │ +├───┼───┤ +│ 0 │ a │ +│ 1 │ a │ +│ 2 │ b │ +│ 3 │ b │ +╰───┴───╯ + +``` diff --git a/commands/docs/polars_reverse.md b/commands/docs/polars_reverse.md index b1cf0484dce..6321672359d 100644 --- a/commands/docs/polars_reverse.md +++ b/commands/docs/polars_reverse.md @@ -2,7 +2,7 @@ title: polars reverse categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Reverses the LazyFrame usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Reverses the dataframe. diff --git a/commands/docs/polars_rolling.md b/commands/docs/polars_rolling.md index 596f529bca4..567fd7aa622 100644 --- a/commands/docs/polars_rolling.md +++ b/commands/docs/polars_rolling.md @@ -2,7 +2,7 @@ title: polars rolling categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Rolling calculation for a series. usage: | @@ -35,9 +35,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Rolling sum for a series diff --git a/commands/docs/polars_sample.md b/commands/docs/polars_sample.md index 6108a48e644..fbf25d954dc 100644 --- a/commands/docs/polars_sample.md +++ b/commands/docs/polars_sample.md @@ -2,7 +2,7 @@ title: polars sample categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Create sample dataframe. usage: | @@ -38,9 +38,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Sample rows from dataframe diff --git a/commands/docs/polars_save.md b/commands/docs/polars_save.md index 038959151bf..41d0dc48351 100644 --- a/commands/docs/polars_save.md +++ b/commands/docs/polars_save.md @@ -2,7 +2,7 @@ title: polars save categories: | lazyframe -version: 0.104.0 +version: 0.105.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 10b57bf93cb..68559f5251d 100644 --- a/commands/docs/polars_schema.md +++ b/commands/docs/polars_schema.md @@ -2,7 +2,7 @@ title: polars schema categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Show schema for a dataframe. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | record | +| input | output | +| --------- | ------ | +| dataframe | record | ## Examples Dataframe schema diff --git a/commands/docs/polars_select.md b/commands/docs/polars_select.md index 7300ad90d02..ab4dc11536c 100644 --- a/commands/docs/polars_select.md +++ b/commands/docs/polars_select.md @@ -2,7 +2,7 @@ title: polars select categories: | lazyframe -version: 0.104.0 +version: 0.105.0 lazyframe: | Selects columns from lazyframe. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Select a column from the dataframe diff --git a/commands/docs/polars_set-with-idx.md b/commands/docs/polars_set-with-idx.md index 2cd58cab216..bf52bb1f08a 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.104.0 +version: 0.105.0 dataframe: | Sets value in the given index. usage: | @@ -38,9 +38,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Set value in selected rows from series diff --git a/commands/docs/polars_set.md b/commands/docs/polars_set.md index 3873095e118..a5fd87f4be4 100644 --- a/commands/docs/polars_set.md +++ b/commands/docs/polars_set.md @@ -2,7 +2,7 @@ title: polars set categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Sets value where given mask is true. usage: | @@ -38,9 +38,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Shifts the values by a given period diff --git a/commands/docs/polars_shape.md b/commands/docs/polars_shape.md index 7cf68afef8d..9f3badfa437 100644 --- a/commands/docs/polars_shape.md +++ b/commands/docs/polars_shape.md @@ -2,7 +2,7 @@ title: polars shape categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Shows column and row size for a dataframe. usage: | @@ -30,9 +30,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Shows row and column shape diff --git a/commands/docs/polars_shift.md b/commands/docs/polars_shift.md index 2f6e384a91e..253ca7032af 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.104.0 +version: 0.105.0 dataframe_or_lazyframe: | Shifts the values by a given period. usage: | @@ -38,9 +38,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Shifts the values by a given period @@ -70,3 +71,21 @@ Shifts the values by a given period, fill absent values with 0 ╰───┴───╯ ``` + +Shift values of a column, fill absent values with 0 +```nu +> [[a]; [1] [2] [2] [3] [3]] + | polars into-lazy + | polars with-column {b: (polars col a | polars shift 2 --fill 0)} + | polars collect +╭───┬───┬───╮ +│ # │ a │ b │ +├───┼───┼───┤ +│ 0 │ 1 │ 0 │ +│ 1 │ 2 │ 0 │ +│ 2 │ 2 │ 1 │ +│ 3 │ 3 │ 2 │ +│ 4 │ 3 │ 2 │ +╰───┴───┴───╯ + +``` diff --git a/commands/docs/polars_slice.md b/commands/docs/polars_slice.md index 6d8354a85fc..6d3f00ec0b8 100644 --- a/commands/docs/polars_slice.md +++ b/commands/docs/polars_slice.md @@ -2,7 +2,7 @@ title: polars slice categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Creates new dataframe from a slice of rows. usage: | @@ -35,9 +35,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Create new dataframe from a slice of the rows diff --git a/commands/docs/polars_sort-by.md b/commands/docs/polars_sort-by.md index b3021a0db76..90644956592 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.104.0 +version: 0.105.0 lazyframe: | Sorts a lazy dataframe based on expression(s). usage: | @@ -40,9 +40,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Sort dataframe by one column diff --git a/commands/docs/polars_std.md b/commands/docs/polars_std.md index eb43951368b..5453dcab193 100644 --- a/commands/docs/polars_std.md +++ b/commands/docs/polars_std.md @@ -2,7 +2,7 @@ title: polars std categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Creates a std expression for an aggregation of std value from columns in a dataframe. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Std value from columns in a dataframe diff --git a/commands/docs/polars_store-get.md b/commands/docs/polars_store-get.md index 2b4ea4ca741..9088436b410 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.104.0 +version: 0.105.0 dataframe: | Gets a Dataframe or other object from the plugin cache. usage: | @@ -34,9 +34,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ----- | ---------- | +| any | dataframe | +| any | expression | ## Examples Get a stored object diff --git a/commands/docs/polars_store-ls.md b/commands/docs/polars_store-ls.md index 380d0ee4a56..7aa5b52b134 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.104.0 +version: 0.105.0 dataframe: | Lists stored polars objects. usage: | @@ -27,12 +27,6 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ```> polars store-ls {flags} ``` - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | ## Examples Creates a new dataframe and shows it in the dataframe list diff --git a/commands/docs/polars_store-rm.md b/commands/docs/polars_store-rm.md index 3646eab6a95..17182599b68 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.104.0 +version: 0.105.0 dataframe: | Removes a stored Dataframe or other object from the plugin cache. usage: | @@ -36,7 +36,7 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. | input | output | | ----- | ------------ | -| any | list\ | +| any | list<string> | ## Examples Removes a stored diff --git a/commands/docs/polars_str-join.md b/commands/docs/polars_str-join.md index 5182d028377..7055750103e 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.104.0 +version: 0.105.0 dataframe: | Concatenates strings within a column or dataframes usage: | @@ -39,9 +39,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Join strings in a column diff --git a/commands/docs/polars_str-lengths.md b/commands/docs/polars_str-lengths.md index 1688c9a3101..52bd855d4cd 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.104.0 +version: 0.105.0 dataframe: | Get lengths of all strings. usage: | @@ -34,9 +34,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Returns string lengths for a column diff --git a/commands/docs/polars_str-replace-all.md b/commands/docs/polars_str-replace-all.md new file mode 100644 index 00000000000..2fd7280f029 --- /dev/null +++ b/commands/docs/polars_str-replace-all.md @@ -0,0 +1,68 @@ +--- +title: polars str-replace-all +categories: | + dataframe +version: 0.105.0 +dataframe: | + Replace all (sub)strings by a regex pattern. +usage: | + Replace all (sub)strings by a regex pattern. +editLink: false +contributors: false +--- + + +# `polars str-replace-all` for [dataframe](/commands/categories/dataframe.md) + +
Replace all (sub)strings by a regex pattern.
+ +::: warning This command requires a plugin +The `polars str-replace-all` command resides in the `polars` plugin. +To use this command, you must install and register `nu_plugin_polars`. +See the [Plugins](/book/plugins.html) chapter in the book for more information. +::: + + +## Signature + +```> polars str-replace-all {flags} ``` + +## Flags + + - `--pattern, -p {string}`: Regex pattern to be matched + - `--replace, -r {string}`: replacing string + + +## Input/output types: + +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | +## Examples + +Replaces string in a column +```nu +> [[a]; [abac] [abac] [abac]] | polars into-df | polars select (polars col a | polars str-replace-all --pattern a --replace A) | polars collect +╭───┬──────╮ +│ # │ a │ +├───┼──────┤ +│ 0 │ AbAc │ +│ 1 │ AbAc │ +│ 2 │ AbAc │ +╰───┴──────╯ + +``` + +Replaces string +```nu +> [abac abac abac] | polars into-df | polars str-replace-all --pattern a --replace A +╭───┬──────╮ +│ # │ 0 │ +├───┼──────┤ +│ 0 │ AbAc │ +│ 1 │ AbAc │ +│ 2 │ AbAc │ +╰───┴──────╯ + +``` diff --git a/commands/docs/polars_str-replace.md b/commands/docs/polars_str-replace.md new file mode 100644 index 00000000000..80569890634 --- /dev/null +++ b/commands/docs/polars_str-replace.md @@ -0,0 +1,67 @@ +--- +title: polars str-replace +categories: | + dataframe +version: 0.105.0 +dataframe: | + Replace the leftmost (sub)string by a regex pattern. +usage: | + Replace the leftmost (sub)string by a regex pattern. +editLink: false +contributors: false +--- + + +# `polars str-replace` for [dataframe](/commands/categories/dataframe.md) + +
Replace the leftmost (sub)string by a regex pattern.
+ +::: warning This command requires a plugin +The `polars str-replace` command resides in the `polars` plugin. +To use this command, you must install and register `nu_plugin_polars`. +See the [Plugins](/book/plugins.html) chapter in the book for more information. +::: + + +## Signature + +```> polars str-replace {flags} ``` + +## Flags + + - `--pattern, -p {string}`: Regex pattern to be matched + - `--replace, -r {string}`: replacing string + + +## Input/output types: + +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | +## Examples + +Replaces string in column +```nu +> [[a]; [abc] [abcabc]] | polars into-df | polars select (polars col a | polars str-replace --pattern ab --replace AB) | polars collect +╭───┬────────╮ +│ # │ a │ +├───┼────────┤ +│ 0 │ ABc │ +│ 1 │ ABcabc │ +╰───┴────────╯ + +``` + +Replaces string +```nu +> [abc abc abc] | polars into-df | polars str-replace --pattern ab --replace AB +╭───┬─────╮ +│ # │ 0 │ +├───┼─────┤ +│ 0 │ ABc │ +│ 1 │ ABc │ +│ 2 │ ABc │ +╰───┴─────╯ + +``` diff --git a/commands/docs/polars_str-slice.md b/commands/docs/polars_str-slice.md index 6b4ef372a33..294cda03df2 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.104.0 +version: 0.105.0 dataframe: | Slices the string from the start position until the selected length. usage: | @@ -38,9 +38,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Creates slices from the strings in a specified column diff --git a/commands/docs/polars_str-split.md b/commands/docs/polars_str-split.md index 583019bc479..711c6ce4056 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.104.0 +version: 0.105.0 dataframe: | Split the string by a substring. The resulting dtype is list. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Split the string by comma, then create a new row for each string diff --git a/commands/docs/polars_str-strip-chars.md b/commands/docs/polars_str-strip-chars.md index b026d5885d9..2762a6f2118 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.104.0 +version: 0.105.0 dataframe: | Strips specified characters from strings in a column usage: | @@ -39,9 +39,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Strip characters from both ends of strings in a column diff --git a/commands/docs/polars_strftime.md b/commands/docs/polars_strftime.md index 27afc42dc37..1527e4127aa 100644 --- a/commands/docs/polars_strftime.md +++ b/commands/docs/polars_strftime.md @@ -2,7 +2,7 @@ title: polars strftime categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Formats date based on string rule. usage: | @@ -34,9 +34,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Formats date column as a string diff --git a/commands/docs/polars_struct-json-encode.md b/commands/docs/polars_struct-json-encode.md new file mode 100644 index 00000000000..5c7b4bc4e04 --- /dev/null +++ b/commands/docs/polars_struct-json-encode.md @@ -0,0 +1,52 @@ +--- +title: polars struct-json-encode +categories: | + dataframe +version: 0.105.0 +dataframe: | + Convert this struct to a string column with json values. +usage: | + Convert this struct to a string column with json values. +editLink: false +contributors: false +--- + + +# `polars struct-json-encode` for [dataframe](/commands/categories/dataframe.md) + +
Convert this struct to a string column with json values.
+ +::: warning This command requires a plugin +The `polars struct-json-encode` command resides in the `polars` plugin. +To use this command, you must install and register `nu_plugin_polars`. +See the [Plugins](/book/plugins.html) chapter in the book for more information. +::: + + +## Signature + +```> polars struct-json-encode {flags} ``` + + +## Input/output types: + +| input | output | +| ---------- | ---------- | +| expression | expression | +## Examples + +Encode a struct as JSON +```nu +> [[id person]; [1 {name: "Bob", age: 36}] [2 {name: "Betty", age: 63}]] + | polars into-df -s {id: i32, person: {name: str, age: u8}} + | polars select id (polars col person | polars struct-json-encode | polars as encoded) + | polars sort-by id + | polars collect +╭───┬────┬───────────────────────────╮ +│ # │ id │ encoded │ +├───┼────┼───────────────────────────┤ +│ 0 │ 1 │ {"name":"Bob","age":36} │ +│ 1 │ 2 │ {"name":"Betty","age":63} │ +╰───┴────┴───────────────────────────╯ + +``` diff --git a/commands/docs/polars_sum.md b/commands/docs/polars_sum.md index 090618c4b55..b32ead7174d 100644 --- a/commands/docs/polars_sum.md +++ b/commands/docs/polars_sum.md @@ -2,7 +2,7 @@ title: polars sum categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Creates a sum expression for an aggregation or aggregates columns to their sum value. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Sums all columns in a dataframe diff --git a/commands/docs/polars_summary.md b/commands/docs/polars_summary.md index f67329f8550..f171198fb75 100644 --- a/commands/docs/polars_summary.md +++ b/commands/docs/polars_summary.md @@ -2,7 +2,7 @@ title: polars summary categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples list dataframe descriptives diff --git a/commands/docs/polars_take.md b/commands/docs/polars_take.md index 2b3d74ea766..d12a2dd1c9e 100644 --- a/commands/docs/polars_take.md +++ b/commands/docs/polars_take.md @@ -2,7 +2,7 @@ title: polars take categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Creates new dataframe using the given indices. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Takes selected rows from dataframe diff --git a/commands/docs/polars_truncate.md b/commands/docs/polars_truncate.md index 3624776dd63..c2ce6d0bda6 100644 --- a/commands/docs/polars_truncate.md +++ b/commands/docs/polars_truncate.md @@ -2,7 +2,7 @@ title: polars truncate categories: | expression -version: 0.104.0 +version: 0.105.0 expression: | Divide the date/datetime range into buckets. usage: | @@ -34,9 +34,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | ## Examples Truncate a series of dates by period length @@ -45,10 +45,10 @@ Truncate a series of dates by period length ╭───┬──────────────┬──────────────╮ │ # │ datetime │ truncated │ ├───┼──────────────┼──────────────┤ -│ 0 │ 3 months ago │ 3 months ago │ -│ 1 │ 2 months ago │ 2 months ago │ -│ 2 │ a month ago │ a month ago │ -│ 3 │ in a week │ in 5 days │ +│ 0 │ 5 months ago │ 5 months ago │ +│ 1 │ 3 months ago │ 4 months ago │ +│ 2 │ 2 months ago │ 2 months ago │ +│ 3 │ a month ago │ a month ago │ ╰───┴──────────────┴──────────────╯ ``` diff --git a/commands/docs/polars_unique.md b/commands/docs/polars_unique.md index c37c05ee606..09eb1f7c88a 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.104.0 +version: 0.105.0 dataframe_or_lazyframe: | Returns unique values from a dataframe. usage: | @@ -36,9 +36,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Returns unique values from a series @@ -79,8 +80,32 @@ Returns unique values in a subset of lazyframe columns ``` -Creates a is unique expression from a column +Returns unique values in a subset of lazyframe columns ```nu -> col a | unique +> [[a]; [2] [1] [2]] + | polars into-lazy + | polars select (polars col a | polars unique) + | polars collect +╭───┬───╮ +│ # │ a │ +├───┼───┤ +│ 0 │ 1 │ +│ 1 │ 2 │ +╰───┴───╯ + +``` + +Returns unique values in a subset of lazyframe columns +```nu +> [[a]; [2] [1] [2]] + | polars into-lazy + | polars select (polars col a | polars unique --maintain-order) + | polars collect +╭───┬───╮ +│ # │ a │ +├───┼───┤ +│ 0 │ 2 │ +│ 1 │ 1 │ +╰───┴───╯ ``` diff --git a/commands/docs/polars_unnest.md b/commands/docs/polars_unnest.md index 671db453331..1a105befe76 100644 --- a/commands/docs/polars_unnest.md +++ b/commands/docs/polars_unnest.md @@ -2,7 +2,7 @@ title: polars unnest categories: | dataframe -version: 0.104.0 +version: 0.105.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: | @@ -31,12 +31,6 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. - `...rest`: columns to unnest - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | ## Examples Unnest a dataframe diff --git a/commands/docs/polars_unpivot.md b/commands/docs/polars_unpivot.md index c481b2099a7..ad6bb52fb97 100644 --- a/commands/docs/polars_unpivot.md +++ b/commands/docs/polars_unpivot.md @@ -2,7 +2,7 @@ title: polars unpivot categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Unpivot a DataFrame from wide to long format. usage: | @@ -37,9 +37,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples unpivot on an eager dataframe diff --git a/commands/docs/polars_uppercase.md b/commands/docs/polars_uppercase.md index 4524c428937..2285c3dcd5f 100644 --- a/commands/docs/polars_uppercase.md +++ b/commands/docs/polars_uppercase.md @@ -2,7 +2,7 @@ title: polars uppercase categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Uppercase the strings in the column. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| dataframe | dataframe | +| expression | expression | ## Examples Modifies strings in a column to uppercase diff --git a/commands/docs/polars_value-counts.md b/commands/docs/polars_value-counts.md index a0e7c775ea1..b9b2d7f0134 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.104.0 +version: 0.105.0 dataframe: | Returns a dataframe with the counts for unique values in series. usage: | @@ -37,9 +37,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Calculates value counts diff --git a/commands/docs/polars_var.md b/commands/docs/polars_var.md index 7c6fe6c91ad..c2f2d1bde87 100644 --- a/commands/docs/polars_var.md +++ b/commands/docs/polars_var.md @@ -2,7 +2,7 @@ title: polars var categories: | dataframe -version: 0.104.0 +version: 0.105.0 dataframe: | Create a var expression for an aggregation. usage: | @@ -30,9 +30,10 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| ---------- | ---------- | +| expression | expression | +| dataframe | dataframe | ## Examples Var value from columns in a dataframe or aggregates columns to their var value diff --git a/commands/docs/polars_when.md b/commands/docs/polars_when.md index 46e295744c7..c799fce4f2a 100644 --- a/commands/docs/polars_when.md +++ b/commands/docs/polars_when.md @@ -2,7 +2,7 @@ title: polars when categories: | expression -version: 0.104.0 +version: 0.105.0 expression: | Creates and modifies a when expression. usage: | @@ -35,10 +35,11 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ------- | ------ | -| any | any | -| nothing | any | +| input | output | +| ---------- | ---------- | +| nothing | expression | +| expression | expression | +| any | expression | ## Examples Create a when conditions diff --git a/commands/docs/polars_with-column.md b/commands/docs/polars_with-column.md index 5f4043c7ee6..47dba0b5437 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.104.0 +version: 0.105.0 dataframe_or_lazyframe: | Adds a series to the dataframe. usage: | @@ -38,9 +38,9 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Input/output types: -| input | output | -| ----- | ------ | -| any | any | +| input | output | +| --------- | --------- | +| dataframe | dataframe | ## Examples Adds a series to the dataframe @@ -75,7 +75,7 @@ Adds a series to the dataframe ``` -Add series to the dataframe using a record +Add series to a lazyframe using a record ```nu > [[a b]; [1 2] [3 4]] | polars into-lazy @@ -92,3 +92,21 @@ Add series to the dataframe using a record ╰───┴───┴───┴───┴───╯ ``` + +Add series to a dataframe using a record +```nu +> [[a b]; [1 2] [3 4]] + | polars into-df + | polars with-column { + c: ((polars col a) * 2) + d: ((polars col a) * 3) + } + | polars collect +╭───┬───┬───┬───┬───╮ +│ # │ a │ b │ c │ d │ +├───┼───┼───┼───┼───┤ +│ 0 │ 1 │ 2 │ 2 │ 3 │ +│ 1 │ 3 │ 4 │ 6 │ 9 │ +╰───┴───┴───┴───┴───╯ + +``` diff --git a/commands/docs/port.md b/commands/docs/port.md index f78509713b6..71031d4f93b 100644 --- a/commands/docs/port.md +++ b/commands/docs/port.md @@ -2,7 +2,7 @@ title: port categories: | network -version: 0.104.0 +version: 0.105.0 network: | Get a free port from system. usage: | diff --git a/commands/docs/prepend.md b/commands/docs/prepend.md index 9266447ad53..dc7815a4a5a 100644 --- a/commands/docs/prepend.md +++ b/commands/docs/prepend.md @@ -2,7 +2,7 @@ title: prepend categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Prepend any number of rows to a table. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | ----- | --------- | -| any | list\ | +| any | list<any> | ## Examples prepend a list to an item diff --git a/commands/docs/print.md b/commands/docs/print.md index b0ac32fb92d..dfe6d09c383 100644 --- a/commands/docs/print.md +++ b/commands/docs/print.md @@ -2,7 +2,7 @@ title: print categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Print the given values to stdout. usage: | @@ -35,8 +35,8 @@ contributors: false | input | output | | ------- | ------- | -| any | nothing | | nothing | nothing | +| any | nothing | ## Examples Print 'hello world' diff --git a/commands/docs/ps.md b/commands/docs/ps.md index 7f1173ecc44..9cedda467c8 100644 --- a/commands/docs/ps.md +++ b/commands/docs/ps.md @@ -2,7 +2,7 @@ title: ps categories: | system -version: 0.104.0 +version: 0.105.0 system: | View information about system processes. usage: | diff --git a/commands/docs/pwd.md b/commands/docs/pwd.md index 60632c5687a..e4a2ba17dae 100644 --- a/commands/docs/pwd.md +++ b/commands/docs/pwd.md @@ -2,7 +2,7 @@ title: pwd categories: | default -version: 0.104.0 +version: 0.105.0 default: | Return the current working directory usage: | @@ -23,10 +23,3 @@ contributors: false ## Flags - `--physical, -P`: Resolve symbolic links - - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | \ No newline at end of file diff --git a/commands/docs/query.md b/commands/docs/query.md index 04c90a44866..33c23f17343 100644 --- a/commands/docs/query.md +++ b/commands/docs/query.md @@ -2,7 +2,7 @@ title: query categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Show all the query commands usage: | @@ -28,12 +28,6 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ```> query {flags} ``` -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | - ## Subcommands: | name | description | type | diff --git a/commands/docs/query_db.md b/commands/docs/query_db.md index c8f600d2ad5..d35206ad2a1 100644 --- a/commands/docs/query_db.md +++ b/commands/docs/query_db.md @@ -2,7 +2,7 @@ title: query db categories: | database -version: 0.104.0 +version: 0.105.0 database: | Query a database using SQL. usage: | diff --git a/commands/docs/query_json.md b/commands/docs/query_json.md index 9ad365434af..9bc43c6a134 100644 --- a/commands/docs/query_json.md +++ b/commands/docs/query_json.md @@ -2,7 +2,7 @@ title: query json categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | execute json query on json file (open --raw | query json 'query string') usage: | @@ -31,12 +31,6 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. - `query`: json query - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | ## Examples Get a list of children from a json object diff --git a/commands/docs/query_web.md b/commands/docs/query_web.md index 64883be44b4..20a8c37ad09 100644 --- a/commands/docs/query_web.md +++ b/commands/docs/query_web.md @@ -2,7 +2,7 @@ title: query web categories: | network -version: 0.104.0 +version: 0.105.0 network: | execute selector query on html/web usage: | @@ -35,12 +35,6 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. - `--as-table, -t {list}`: find table based on column header list - `--inspect, -i`: run in inspect mode to provide more information for determining column headers - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | ## Examples Retrieve all `
` elements from phoronix.com website diff --git a/commands/docs/query_webpage-info.md b/commands/docs/query_webpage-info.md index 399301a0d72..22b07ebd9ff 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.104.0 +version: 0.105.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 a9301572c00..cd5f734bfd1 100644 --- a/commands/docs/query_xml.md +++ b/commands/docs/query_xml.md @@ -2,7 +2,7 @@ title: query xml categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | execute xpath query on xml usage: | @@ -30,10 +30,3 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. ## Parameters - `query`: xpath query - - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | \ No newline at end of file diff --git a/commands/docs/random.md b/commands/docs/random.md index 408cb153912..6bee636effc 100644 --- a/commands/docs/random.md +++ b/commands/docs/random.md @@ -2,7 +2,7 @@ title: random categories: | random -version: 0.104.0 +version: 0.105.0 random: | Generate a random value. usage: | diff --git a/commands/docs/random_binary.md b/commands/docs/random_binary.md index e70c47d02b5..51416c47f7f 100644 --- a/commands/docs/random_binary.md +++ b/commands/docs/random_binary.md @@ -2,7 +2,7 @@ title: random binary categories: | random -version: 0.104.0 +version: 0.105.0 random: | Generate random bytes. usage: | diff --git a/commands/docs/random_bool.md b/commands/docs/random_bool.md index 3037a31e8e1..527ff58338b 100644 --- a/commands/docs/random_bool.md +++ b/commands/docs/random_bool.md @@ -2,7 +2,7 @@ title: random bool categories: | random -version: 0.104.0 +version: 0.105.0 random: | Generate a random boolean value. usage: | diff --git a/commands/docs/random_chars.md b/commands/docs/random_chars.md index 2d9d53c890a..cc88e4685a6 100644 --- a/commands/docs/random_chars.md +++ b/commands/docs/random_chars.md @@ -2,7 +2,7 @@ title: random chars categories: | random -version: 0.104.0 +version: 0.105.0 random: | Generate random chars uniformly distributed over ASCII letters and numbers: a-z, A-Z and 0-9. usage: | @@ -22,7 +22,7 @@ contributors: false ## Flags - - `--length, -l {one_of(int, filesize)}`: Number of chars (default 25) + - `--length, -l {oneof}`: Number of chars (default 25) ## Input/output types: diff --git a/commands/docs/random_dice.md b/commands/docs/random_dice.md index eed05e7c4ea..ab965b43819 100644 --- a/commands/docs/random_dice.md +++ b/commands/docs/random_dice.md @@ -2,7 +2,7 @@ title: random dice categories: | random -version: 0.104.0 +version: 0.105.0 random: | Generate a random dice roll. usage: | @@ -30,7 +30,7 @@ contributors: false | input | output | | ------- | --------- | -| nothing | list\ | +| nothing | list<int> | ## Examples Roll 1 dice with 6 sides each diff --git a/commands/docs/random_float.md b/commands/docs/random_float.md index 65b6e44ff8d..287cfec2cff 100644 --- a/commands/docs/random_float.md +++ b/commands/docs/random_float.md @@ -2,7 +2,7 @@ title: random float categories: | random -version: 0.104.0 +version: 0.105.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 4d3e288c4d7..83ea93415cb 100644 --- a/commands/docs/random_int.md +++ b/commands/docs/random_int.md @@ -2,7 +2,7 @@ title: random int categories: | random -version: 0.104.0 +version: 0.105.0 random: | Generate a random integer [min..max]. usage: | diff --git a/commands/docs/random_uuid.md b/commands/docs/random_uuid.md index fbddaaae916..63bd05e7207 100644 --- a/commands/docs/random_uuid.md +++ b/commands/docs/random_uuid.md @@ -2,7 +2,7 @@ title: random uuid categories: | random -version: 0.104.0 +version: 0.105.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 5ed52d9891a..13faa204140 100644 --- a/commands/docs/reduce.md +++ b/commands/docs/reduce.md @@ -2,7 +2,7 @@ title: reduce categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Aggregate a list (starting from the left) to a single value using an accumulator closure. usage: | @@ -33,9 +33,9 @@ contributors: false | input | output | | --------- | ------ | -| list\ | any | -| range | any | +| list<any> | any | | table | any | +| range | any | ## Examples Sum values of a list (same as 'math sum') diff --git a/commands/docs/reject.md b/commands/docs/reject.md index 39c8e42c294..84bc199ef3d 100644 --- a/commands/docs/reject.md +++ b/commands/docs/reject.md @@ -2,7 +2,7 @@ title: reject categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Remove the given columns or rows from the table. Opposite of `select`. usage: | @@ -33,9 +33,9 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | | record | record | | table | table | +| list<any> | list<any> | ## Examples Reject a column in the `ls` table diff --git a/commands/docs/rename.md b/commands/docs/rename.md index 2fe2be18873..5db60099579 100644 --- a/commands/docs/rename.md +++ b/commands/docs/rename.md @@ -2,7 +2,7 @@ title: rename categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Creates a new table with columns renamed. usage: | diff --git a/commands/docs/return.md b/commands/docs/return.md index 053f8465bf2..ec85afb6e45 100644 --- a/commands/docs/return.md +++ b/commands/docs/return.md @@ -2,7 +2,7 @@ title: return categories: | core -version: 0.104.0 +version: 0.105.0 core: | Return early from a custom command. usage: | diff --git a/commands/docs/reverse.md b/commands/docs/reverse.md index 729231a4508..6d4ada9683b 100644 --- a/commands/docs/reverse.md +++ b/commands/docs/reverse.md @@ -2,7 +2,7 @@ title: reverse categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Reverses the input list or table. usage: | @@ -25,7 +25,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | ## Examples Reverse a list diff --git a/commands/docs/rm.md b/commands/docs/rm.md index cb2ea88427c..42553734106 100644 --- a/commands/docs/rm.md +++ b/commands/docs/rm.md @@ -2,7 +2,7 @@ title: rm categories: | filesystem -version: 0.104.0 +version: 0.105.0 filesystem: | Remove files and directories. usage: | diff --git a/commands/docs/roll.md b/commands/docs/roll.md index eeffa39a01b..d17a3e8d473 100644 --- a/commands/docs/roll.md +++ b/commands/docs/roll.md @@ -2,7 +2,7 @@ title: roll categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Rolling commands for tables. usage: | diff --git a/commands/docs/roll_down.md b/commands/docs/roll_down.md index 105a783dd07..2f63adfe52e 100644 --- a/commands/docs/roll_down.md +++ b/commands/docs/roll_down.md @@ -2,7 +2,7 @@ title: roll down categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Roll table rows down. usage: | diff --git a/commands/docs/roll_left.md b/commands/docs/roll_left.md index d8f82023c49..222bdffb262 100644 --- a/commands/docs/roll_left.md +++ b/commands/docs/roll_left.md @@ -2,7 +2,7 @@ title: roll left categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Roll record or table columns left. usage: | diff --git a/commands/docs/roll_right.md b/commands/docs/roll_right.md index 4786fb33168..480d6839aab 100644 --- a/commands/docs/roll_right.md +++ b/commands/docs/roll_right.md @@ -2,7 +2,7 @@ title: roll right categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Roll table columns right. usage: | diff --git a/commands/docs/roll_up.md b/commands/docs/roll_up.md index c24958bd12c..a7d02c6d834 100644 --- a/commands/docs/roll_up.md +++ b/commands/docs/roll_up.md @@ -2,7 +2,7 @@ title: roll up categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Roll table rows up. usage: | diff --git a/commands/docs/rotate.md b/commands/docs/rotate.md index 661cfc00018..125a4291cfe 100644 --- a/commands/docs/rotate.md +++ b/commands/docs/rotate.md @@ -2,7 +2,7 @@ title: rotate categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Rotates a table or record clockwise (default) or counter-clockwise (use --ccw flag). usage: | @@ -33,10 +33,10 @@ contributors: false | input | output | | --------- | ------ | -| list\ | table | | record | table | -| string | table | | table | table | +| list<any> | table | +| string | table | ## Examples Rotate a record clockwise, producing a table (like `transpose` but with column order reversed) diff --git a/commands/docs/run-external.md b/commands/docs/run-external.md index 93c7e7307d1..de27e4daadd 100644 --- a/commands/docs/run-external.md +++ b/commands/docs/run-external.md @@ -2,7 +2,7 @@ title: run-external categories: | system -version: 0.104.0 +version: 0.105.0 system: | Runs external command. usage: | diff --git a/commands/docs/save.md b/commands/docs/save.md index 3d85c448130..c50d6fb52dc 100644 --- a/commands/docs/save.md +++ b/commands/docs/save.md @@ -2,7 +2,7 @@ title: save categories: | filesystem -version: 0.104.0 +version: 0.105.0 filesystem: | Save a file. usage: | @@ -69,3 +69,14 @@ Save a running program's stderr to separate file > do -i {} | save foo.txt --stderr bar.txt ``` + +Show the extensions for which the `save` command will automatically serialize +```nu +> scope commands + | where name starts-with "to " + | insert extension { get name | str replace -r "^to " "" | $"*.($in)" } + | select extension name + | rename extension command + + +``` diff --git a/commands/docs/schema.md b/commands/docs/schema.md index 764fdb55bd9..eff87d6e044 100644 --- a/commands/docs/schema.md +++ b/commands/docs/schema.md @@ -2,7 +2,7 @@ title: schema categories: | database -version: 0.104.0 +version: 0.105.0 database: | Show the schema of a SQLite database. usage: | diff --git a/commands/docs/scope.md b/commands/docs/scope.md index ca032b005c0..a9749051599 100644 --- a/commands/docs/scope.md +++ b/commands/docs/scope.md @@ -2,7 +2,7 @@ title: scope categories: | core -version: 0.104.0 +version: 0.105.0 core: | Commands for getting info about what is in scope. usage: | diff --git a/commands/docs/scope_aliases.md b/commands/docs/scope_aliases.md index 8480d7fc687..0cc847f1760 100644 --- a/commands/docs/scope_aliases.md +++ b/commands/docs/scope_aliases.md @@ -2,7 +2,7 @@ title: scope aliases categories: | core -version: 0.104.0 +version: 0.105.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 40243027a91..4f65da606f0 100644 --- a/commands/docs/scope_commands.md +++ b/commands/docs/scope_commands.md @@ -2,7 +2,7 @@ title: scope commands categories: | core -version: 0.104.0 +version: 0.105.0 core: | Output info on the commands in the current scope. usage: | @@ -25,7 +25,7 @@ contributors: false | input | output | | ------- | --------- | -| nothing | list\ | +| nothing | list<any> | ## Examples Show the commands in the current scope diff --git a/commands/docs/scope_engine-stats.md b/commands/docs/scope_engine-stats.md index 5e065eb21f8..d3a5a8657c5 100644 --- a/commands/docs/scope_engine-stats.md +++ b/commands/docs/scope_engine-stats.md @@ -2,7 +2,7 @@ title: scope engine-stats categories: | core -version: 0.104.0 +version: 0.105.0 core: | Output stats on the engine in the current state. usage: | diff --git a/commands/docs/scope_externs.md b/commands/docs/scope_externs.md index ea7d290dece..81d6166d598 100644 --- a/commands/docs/scope_externs.md +++ b/commands/docs/scope_externs.md @@ -2,7 +2,7 @@ title: scope externs categories: | core -version: 0.104.0 +version: 0.105.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 5c6a5ba60da..1c6db0754b1 100644 --- a/commands/docs/scope_modules.md +++ b/commands/docs/scope_modules.md @@ -2,7 +2,7 @@ title: scope modules categories: | core -version: 0.104.0 +version: 0.105.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 fc28cd06c6d..12d45b9acd8 100644 --- a/commands/docs/scope_variables.md +++ b/commands/docs/scope_variables.md @@ -2,7 +2,7 @@ title: scope variables categories: | core -version: 0.104.0 +version: 0.105.0 core: | Output info on the variables in the current scope. usage: | diff --git a/commands/docs/select.md b/commands/docs/select.md index edc3f8599cb..73e70d3049b 100644 --- a/commands/docs/select.md +++ b/commands/docs/select.md @@ -2,7 +2,7 @@ title: select categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Select only these columns or rows from the input. Opposite of `reject`. usage: | @@ -33,9 +33,9 @@ contributors: false | input | output | | --------- | ------ | -| list\ | any | | record | record | | table | table | +| list<any> | any | ## Examples Select a column in a table diff --git a/commands/docs/seq.md b/commands/docs/seq.md index f022aef6cc3..8508c4c6a97 100644 --- a/commands/docs/seq.md +++ b/commands/docs/seq.md @@ -2,7 +2,7 @@ title: seq categories: | generators -version: 0.104.0 +version: 0.105.0 generators: | Output sequences of numbers. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | ------- | ------------ | -| nothing | list\ | +| nothing | list<number> | ## Examples sequence 1 to 10 diff --git a/commands/docs/seq_char.md b/commands/docs/seq_char.md index 78dab89f741..add7912368c 100644 --- a/commands/docs/seq_char.md +++ b/commands/docs/seq_char.md @@ -2,7 +2,7 @@ title: seq char categories: | generators -version: 0.104.0 +version: 0.105.0 generators: | Print a sequence of ASCII characters. usage: | @@ -30,7 +30,7 @@ contributors: false | input | output | | ------- | ------------ | -| nothing | list\ | +| nothing | list<string> | ## Examples sequence a to e diff --git a/commands/docs/seq_date.md b/commands/docs/seq_date.md index 062c29dfd36..124a4e70640 100644 --- a/commands/docs/seq_date.md +++ b/commands/docs/seq_date.md @@ -2,7 +2,7 @@ title: seq date categories: | generators -version: 0.104.0 +version: 0.105.0 generators: | Print sequences of dates. usage: | @@ -26,7 +26,7 @@ contributors: false - `--input-format, -i {string}`: give argument dates in this format (defaults to %Y-%m-%d) - `--begin-date, -b {string}`: beginning date range - `--end-date, -e {string}`: ending date - - `--increment, -n {one_of(duration, int)}`: increment dates by this duration (defaults to days if integer) + - `--increment, -n {oneof}`: increment dates by this duration (defaults to days if integer) - `--days, -d {int}`: number of days to print (ignored if periods is used) - `--periods, -p {int}`: number of periods to print - `--reverse, -r`: print dates in reverse @@ -36,7 +36,7 @@ contributors: false | input | output | | ------- | ------------ | -| nothing | list\ | +| nothing | list<string> | ## Examples Return a list of the next 10 days in the YYYY-MM-DD format diff --git a/commands/docs/shuffle.md b/commands/docs/shuffle.md index f961d8048ca..ed064af8fd4 100644 --- a/commands/docs/shuffle.md +++ b/commands/docs/shuffle.md @@ -2,7 +2,7 @@ title: shuffle categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Shuffle rows randomly. usage: | @@ -25,7 +25,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | ## Examples Shuffle rows randomly (execute it several times and see the difference) diff --git a/commands/docs/skip.md b/commands/docs/skip.md index 988709e16c3..7072dd52655 100644 --- a/commands/docs/skip.md +++ b/commands/docs/skip.md @@ -2,7 +2,7 @@ title: skip categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Skip the first several rows of the input. Counterpart of `drop`. Opposite of `first`. usage: | @@ -29,9 +29,9 @@ contributors: false | input | output | | --------- | --------- | -| binary | binary | -| list\ | list\ | | table | table | +| binary | binary | +| list<any> | list<any> | ## Examples Skip the first value of a list diff --git a/commands/docs/skip_until.md b/commands/docs/skip_until.md index ab9fd1fe17d..1d05190d2bf 100644 --- a/commands/docs/skip_until.md +++ b/commands/docs/skip_until.md @@ -2,7 +2,7 @@ title: skip until categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Skip elements of the input until a predicate is true. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | | table | table | +| list<any> | list<any> | ## Examples Skip until the element is positive diff --git a/commands/docs/skip_while.md b/commands/docs/skip_while.md index 6699b484972..5af6361298d 100644 --- a/commands/docs/skip_while.md +++ b/commands/docs/skip_while.md @@ -2,7 +2,7 @@ title: skip while categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Skip elements of the input while a predicate is true. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | | table | table | +| list<any> | list<any> | ## Examples Skip while the element is negative diff --git a/commands/docs/sleep.md b/commands/docs/sleep.md index e6e03a0b8e1..bcfedafde03 100644 --- a/commands/docs/sleep.md +++ b/commands/docs/sleep.md @@ -2,7 +2,7 @@ title: sleep categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Delay for a specified amount of time. usage: | diff --git a/commands/docs/slice.md b/commands/docs/slice.md index 8c4e9e1087b..87e26bde10d 100644 --- a/commands/docs/slice.md +++ b/commands/docs/slice.md @@ -2,7 +2,7 @@ title: slice categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Return only the selected rows. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | ## Examples Get the last 2 items diff --git a/commands/docs/sort-by.md b/commands/docs/sort-by.md index 62c3cd7e332..12c7d1a7c37 100644 --- a/commands/docs/sort-by.md +++ b/commands/docs/sort-by.md @@ -2,7 +2,7 @@ title: sort-by categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Sort by the given cell path or closure. usage: | @@ -36,7 +36,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | | record | table | | table | table | ## Examples diff --git a/commands/docs/sort.md b/commands/docs/sort.md index 2860c966820..c7a2dc0389a 100644 --- a/commands/docs/sort.md +++ b/commands/docs/sort.md @@ -2,7 +2,7 @@ title: sort categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Sort in increasing order. usage: | @@ -32,7 +32,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | | record | record | ## Examples diff --git a/commands/docs/source-env.md b/commands/docs/source-env.md index ca642d5cbb8..ad14d500aa3 100644 --- a/commands/docs/source-env.md +++ b/commands/docs/source-env.md @@ -2,7 +2,7 @@ title: source-env categories: | core -version: 0.104.0 +version: 0.105.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 37ddd224b53..106622a0e4c 100644 --- a/commands/docs/source.md +++ b/commands/docs/source.md @@ -2,7 +2,7 @@ title: source categories: | core -version: 0.104.0 +version: 0.105.0 core: | Runs a script file in the current context. usage: | diff --git a/commands/docs/split.md b/commands/docs/split.md index 322e1bd7def..00da6284af5 100644 --- a/commands/docs/split.md +++ b/commands/docs/split.md @@ -2,7 +2,7 @@ title: split categories: | strings -version: 0.104.0 +version: 0.105.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 d2125aca87b..bfe84548bcb 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.104.0 +version: 0.105.0 conversions: | Split a cell-path into its components. usage: | @@ -23,34 +23,35 @@ contributors: false ## Input/output types: -| input | output | -| --------- | --------- | -| cell-path | list\ | +| input | output | +| --------- | ----------------------------------------------------------- | +| cell-path | list<any> | +| cell-path | list<record<value: any, optional: bool, insensitive: bool>> | ## Examples Split a cell-path into its components ```nu > $.5?.c | split cell-path -╭───┬───────┬──────────╮ -│ # │ value │ optional │ -├───┼───────┼──────────┤ -│ 0 │ 5 │ true │ -│ 1 │ c │ false │ -╰───┴───────┴──────────╯ +╭───┬───────┬──────────┬─────────────╮ +│ # │ value │ optional │ insensitive │ +├───┼───────┼──────────┼─────────────┤ +│ 0 │ 5 │ true │ false │ +│ 1 │ c │ false │ false │ +╰───┴───────┴──────────┴─────────────╯ ``` Split a complex cell-path ```nu -> $.a.b?.1."2"."c.d" | split cell-path -╭───┬───────┬──────────╮ -│ # │ value │ optional │ -├───┼───────┼──────────┤ -│ 0 │ a │ false │ -│ 1 │ b │ true │ -│ 2 │ 1 │ false │ -│ 3 │ 2 │ false │ -│ 4 │ c.d │ false │ -╰───┴───────┴──────────╯ +> $.a!.b?.1."2"."c.d" | split cell-path +╭───┬───────┬──────────┬─────────────╮ +│ # │ value │ optional │ insensitive │ +├───┼───────┼──────────┼─────────────┤ +│ 0 │ a │ false │ true │ +│ 1 │ b │ true │ false │ +│ 2 │ 1 │ false │ false │ +│ 3 │ 2 │ false │ false │ +│ 4 │ c.d │ false │ false │ +╰───┴───────┴──────────┴─────────────╯ ``` diff --git a/commands/docs/split_chars.md b/commands/docs/split_chars.md index 8d1f23c4808..a26fbb10fbc 100644 --- a/commands/docs/split_chars.md +++ b/commands/docs/split_chars.md @@ -2,7 +2,7 @@ title: split chars categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Split a string into a list of characters. usage: | @@ -30,8 +30,8 @@ contributors: false | input | output | | ------------ | ------------------ | -| list\ | list\\> | -| string | list\ | +| string | list<string> | +| list<string> | list<list<string>> | ## Examples Split the string into a list of characters diff --git a/commands/docs/split_column.md b/commands/docs/split_column.md index 8444e850f80..4c93c73aced 100644 --- a/commands/docs/split_column.md +++ b/commands/docs/split_column.md @@ -2,7 +2,7 @@ title: split column categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Split a string into multiple columns using a separator. usage: | @@ -36,8 +36,8 @@ contributors: false | input | output | | ------------ | ------ | -| list\ | table | | string | table | +| list<string> | table | ## Examples Split a string into columns by the specified separator diff --git a/commands/docs/split_list.md b/commands/docs/split_list.md index 400647ed7d0..0448cf33f76 100644 --- a/commands/docs/split_list.md +++ b/commands/docs/split_list.md @@ -2,7 +2,7 @@ title: split list categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Split a list into multiple lists using a separator. usage: | @@ -34,7 +34,7 @@ contributors: false | input | output | | --------- | --------------- | -| list\ | list\\> | +| list<any> | list<list<any>> | ## Examples Split a list of chars into two lists diff --git a/commands/docs/split_row.md b/commands/docs/split_row.md index 158cfed4f04..d95b055da82 100644 --- a/commands/docs/split_row.md +++ b/commands/docs/split_row.md @@ -2,7 +2,7 @@ title: split row categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Split a string into multiple rows using a separator. usage: | @@ -34,8 +34,8 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| string | list\ | +| string | list<string> | +| list<string> | list<string> | ## Examples Split a string into rows of char diff --git a/commands/docs/split_words.md b/commands/docs/split_words.md index 6b31fa6caa9..ef2d3b9f950 100644 --- a/commands/docs/split_words.md +++ b/commands/docs/split_words.md @@ -2,7 +2,7 @@ title: split words categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Split a string's words into separate rows. usage: | @@ -31,8 +31,8 @@ contributors: false | input | output | | ------------ | ------------------ | -| list\ | list\\> | -| string | list\ | +| string | list<string> | +| list<string> | list<list<string>> | ## Examples Split the string's words into separate rows diff --git a/commands/docs/start.md b/commands/docs/start.md index af59d7be3ca..fec8367937e 100644 --- a/commands/docs/start.md +++ b/commands/docs/start.md @@ -2,7 +2,7 @@ title: start categories: | filesystem -version: 0.104.0 +version: 0.105.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 a311786b8f3..421a44b41b8 100644 --- a/commands/docs/stor.md +++ b/commands/docs/stor.md @@ -2,7 +2,7 @@ title: stor categories: | database -version: 0.104.0 +version: 0.105.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 3a01eba75b0..a93cb8d1290 100644 --- a/commands/docs/stor_create.md +++ b/commands/docs/stor_create.md @@ -2,7 +2,7 @@ title: stor create categories: | database -version: 0.104.0 +version: 0.105.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 ff76a59f20c..c56419950b1 100644 --- a/commands/docs/stor_delete.md +++ b/commands/docs/stor_delete.md @@ -2,7 +2,7 @@ title: stor delete categories: | database -version: 0.104.0 +version: 0.105.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 45061da0ac3..0ebf7e3b1da 100644 --- a/commands/docs/stor_export.md +++ b/commands/docs/stor_export.md @@ -2,7 +2,7 @@ title: stor export categories: | database -version: 0.104.0 +version: 0.105.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 aab5f2f3baa..7c577d84ef1 100644 --- a/commands/docs/stor_import.md +++ b/commands/docs/stor_import.md @@ -2,7 +2,7 @@ title: stor import categories: | database -version: 0.104.0 +version: 0.105.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 6444e199046..d475ff027b0 100644 --- a/commands/docs/stor_insert.md +++ b/commands/docs/stor_insert.md @@ -2,7 +2,7 @@ title: stor insert categories: | database -version: 0.104.0 +version: 0.105.0 database: | Insert information into a specified table in the in-memory sqlite database. usage: | @@ -30,10 +30,10 @@ contributors: false | input | output | | ------- | ------ | -| any | table | | nothing | table | | record | table | | table | table | +| any | table | ## Examples Insert data in the in-memory sqlite database using a data-record of column-name and column-value pairs diff --git a/commands/docs/stor_open.md b/commands/docs/stor_open.md index d5ac4cbed0f..9620cacf690 100644 --- a/commands/docs/stor_open.md +++ b/commands/docs/stor_open.md @@ -2,7 +2,7 @@ title: stor open categories: | database -version: 0.104.0 +version: 0.105.0 database: | Opens the in-memory sqlite database. usage: | @@ -23,9 +23,9 @@ contributors: false ## Input/output types: -| input | output | -| ------- | ------ | -| nothing | any | +| input | output | +| ------- | ---------------- | +| nothing | sqlite-in-memory | ## Examples Open the in-memory sqlite database diff --git a/commands/docs/stor_reset.md b/commands/docs/stor_reset.md index be741988c42..7c2225857dd 100644 --- a/commands/docs/stor_reset.md +++ b/commands/docs/stor_reset.md @@ -2,7 +2,7 @@ title: stor reset categories: | database -version: 0.104.0 +version: 0.105.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 5493f880c81..58dec7db88e 100644 --- a/commands/docs/stor_update.md +++ b/commands/docs/stor_update.md @@ -2,7 +2,7 @@ title: stor update categories: | database -version: 0.104.0 +version: 0.105.0 database: | Update information in a specified table in the in-memory sqlite database. usage: | @@ -31,9 +31,9 @@ contributors: false | input | output | | ------- | ------ | -| any | table | | nothing | table | | record | table | +| any | table | ## Examples Update the in-memory sqlite database diff --git a/commands/docs/str.md b/commands/docs/str.md index 515bcd10cdb..9970458a973 100644 --- a/commands/docs/str.md +++ b/commands/docs/str.md @@ -2,7 +2,7 @@ title: str categories: | strings -version: 0.104.0 +version: 0.105.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 73a73f07193..3041382d18c 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.104.0 +version: 0.105.0 strings: | Convert a string to camelCase. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples convert a string to camelCase diff --git a/commands/docs/str_capitalize.md b/commands/docs/str_capitalize.md index 293da29bad1..0cfa43baf31 100644 --- a/commands/docs/str_capitalize.md +++ b/commands/docs/str_capitalize.md @@ -2,7 +2,7 @@ title: str capitalize categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Capitalize first letter of text. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples Capitalize contents diff --git a/commands/docs/str_contains.md b/commands/docs/str_contains.md index 73c4bdf9763..51cf381889f 100644 --- a/commands/docs/str_contains.md +++ b/commands/docs/str_contains.md @@ -2,7 +2,7 @@ title: str contains categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Checks if string input contains a substring. usage: | @@ -34,10 +34,10 @@ contributors: false | input | output | | ------------ | ---------- | -| list\ | list\ | -| record | record | | string | bool | | table | table | +| record | record | +| list<string> | list<bool> | ## Examples Check if input contains string diff --git a/commands/docs/str_distance.md b/commands/docs/str_distance.md index 495f9c7e891..095c0b247dd 100644 --- a/commands/docs/str_distance.md +++ b/commands/docs/str_distance.md @@ -2,7 +2,7 @@ title: str distance categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Compare two strings and return the edit distance/Levenshtein distance. usage: | @@ -30,9 +30,9 @@ contributors: false | input | output | | ------ | ------ | -| record | record | | string | int | | table | table | +| record | record | ## Examples get the edit distance between two strings diff --git a/commands/docs/str_downcase.md b/commands/docs/str_downcase.md index a427984fb56..6ed08e93147 100644 --- a/commands/docs/str_downcase.md +++ b/commands/docs/str_downcase.md @@ -2,7 +2,7 @@ title: str downcase categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Make text lowercase. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples Downcase contents diff --git a/commands/docs/str_ends-with.md b/commands/docs/str_ends-with.md index cd2a98a7b02..27fe052cd3a 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.104.0 +version: 0.105.0 strings: | Check if an input ends with a string. usage: | @@ -34,10 +34,10 @@ contributors: false | input | output | | ------------ | ---------- | -| list\ | list\ | -| record | record | | string | bool | +| list<string> | list<bool> | | table | table | +| record | record | ## Examples Checks if string ends with '.rb' diff --git a/commands/docs/str_expand.md b/commands/docs/str_expand.md index b6562329950..fe69c94163f 100644 --- a/commands/docs/str_expand.md +++ b/commands/docs/str_expand.md @@ -2,7 +2,7 @@ title: str expand categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Generates all possible combinations defined in brace expansion syntax. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | ------------ | ------------------ | -| list\ | list\\> | -| string | list\ | +| string | list<string> | +| list<string> | list<list<string>> | ## Examples Define a range inside braces to produce a list of string. diff --git a/commands/docs/str_index-of.md b/commands/docs/str_index-of.md index abbe8881e9e..1fcc9aeae26 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.104.0 +version: 0.105.0 strings: | Returns start index of first occurrence of string in input, or -1 if no match. usage: | @@ -37,10 +37,10 @@ contributors: false | input | output | | ------------ | --------- | -| list\ | list\ | -| record | record | | string | int | +| list<string> | list<int> | | table | table | +| record | record | ## Examples Returns index of string in input diff --git a/commands/docs/str_join.md b/commands/docs/str_join.md index af1b77a7a9e..8f869f9bcce 100644 --- a/commands/docs/str_join.md +++ b/commands/docs/str_join.md @@ -2,7 +2,7 @@ title: str join categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Concatenate multiple strings into a single string, with an optional separator between each. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | --------- | ------ | -| list\ | string | +| list<any> | string | | string | string | ## Examples diff --git a/commands/docs/str_kebab-case.md b/commands/docs/str_kebab-case.md index 3a8efed7a31..900eb2e8424 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.104.0 +version: 0.105.0 strings: | Convert a string to kebab-case. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | | table | table | +| record | record | +| list<string> | list<string> | ## Examples convert a string to kebab-case diff --git a/commands/docs/str_length.md b/commands/docs/str_length.md index eadb1695b2d..41f32595dfd 100644 --- a/commands/docs/str_length.md +++ b/commands/docs/str_length.md @@ -2,7 +2,7 @@ title: str length categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Output the length of any strings in the pipeline. usage: | @@ -34,10 +34,10 @@ contributors: false | input | output | | ------------ | --------- | -| list\ | list\ | -| record | record | | string | int | +| list<string> | list<int> | | table | table | +| record | record | ## Examples Return the lengths of a string diff --git a/commands/docs/str_pascal-case.md b/commands/docs/str_pascal-case.md index c4b42870d3b..9425621353d 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.104.0 +version: 0.105.0 strings: | Convert a string to PascalCase. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | | table | table | +| record | record | +| list<string> | list<string> | ## Examples convert a string to PascalCase diff --git a/commands/docs/str_replace.md b/commands/docs/str_replace.md index b0bac680716..b891b02d1a7 100644 --- a/commands/docs/str_replace.md +++ b/commands/docs/str_replace.md @@ -2,7 +2,7 @@ title: str replace categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Find and replace text. usage: | @@ -38,10 +38,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | | table | table | +| record | record | +| list<string> | list<string> | ## Examples Find and replace the first occurrence of a substring diff --git a/commands/docs/str_reverse.md b/commands/docs/str_reverse.md index 63f25342c19..fc19eba0578 100644 --- a/commands/docs/str_reverse.md +++ b/commands/docs/str_reverse.md @@ -2,7 +2,7 @@ title: str reverse categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Reverse every string in the pipeline. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples Reverse a single string diff --git a/commands/docs/str_screaming-snake-case.md b/commands/docs/str_screaming-snake-case.md index 79b4ef4ccdc..0729ecb0ba4 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.104.0 +version: 0.105.0 strings: | Convert a string to SCREAMING_SNAKE_CASE. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples convert a string to SCREAMING_SNAKE_CASE diff --git a/commands/docs/str_snake-case.md b/commands/docs/str_snake-case.md index 41ff9924cb0..b9a02e90475 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.104.0 +version: 0.105.0 strings: | Convert a string to snake_case. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples convert a string to snake_case diff --git a/commands/docs/str_starts-with.md b/commands/docs/str_starts-with.md index bcc9df97457..7c8bf135289 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.104.0 +version: 0.105.0 strings: | Check if an input starts with a string. usage: | @@ -34,10 +34,10 @@ contributors: false | input | output | | ------------ | ---------- | -| list\ | list\ | -| record | record | | string | bool | +| list<string> | list<bool> | | table | table | +| record | record | ## Examples Checks if input string starts with 'my' diff --git a/commands/docs/str_stats.md b/commands/docs/str_stats.md index dedfb1c6a77..bd78485a772 100644 --- a/commands/docs/str_stats.md +++ b/commands/docs/str_stats.md @@ -2,7 +2,7 @@ title: str stats categories: | strings -version: 0.104.0 +version: 0.105.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 2f60b40ac8a..a12a52af6c6 100644 --- a/commands/docs/str_substring.md +++ b/commands/docs/str_substring.md @@ -2,7 +2,7 @@ title: str substring categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Get part of a string. Note that the first character of a string is index 0. usage: | @@ -35,10 +35,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples Get a substring "nushell" from the text "good nushell" using a range diff --git a/commands/docs/str_title-case.md b/commands/docs/str_title-case.md index 45965a4e7a4..b8dc60419cd 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.104.0 +version: 0.105.0 strings: | Convert a string to Title Case. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples convert a string to Title Case diff --git a/commands/docs/str_trim.md b/commands/docs/str_trim.md index 00b38219945..286635171ba 100644 --- a/commands/docs/str_trim.md +++ b/commands/docs/str_trim.md @@ -2,7 +2,7 @@ title: str trim categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Trim whitespace or specific character. usage: | @@ -35,10 +35,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples Trim whitespace diff --git a/commands/docs/str_upcase.md b/commands/docs/str_upcase.md index c356b369e2c..b2116ef0cb3 100644 --- a/commands/docs/str_upcase.md +++ b/commands/docs/str_upcase.md @@ -2,7 +2,7 @@ title: str upcase categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Make text uppercase. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples Upcase contents diff --git a/commands/docs/sys.md b/commands/docs/sys.md index 5481a47a889..4e497d7cc55 100644 --- a/commands/docs/sys.md +++ b/commands/docs/sys.md @@ -2,7 +2,7 @@ title: sys categories: | system -version: 0.104.0 +version: 0.105.0 system: | View information about the system. usage: | diff --git a/commands/docs/sys_cpu.md b/commands/docs/sys_cpu.md index 5bacae27fbf..853575e4ed3 100644 --- a/commands/docs/sys_cpu.md +++ b/commands/docs/sys_cpu.md @@ -2,7 +2,7 @@ title: sys cpu categories: | system -version: 0.104.0 +version: 0.105.0 system: | View information about the system CPUs. usage: | diff --git a/commands/docs/sys_disks.md b/commands/docs/sys_disks.md index f0f0988a0f7..6fdbde8bec4 100644 --- a/commands/docs/sys_disks.md +++ b/commands/docs/sys_disks.md @@ -2,7 +2,7 @@ title: sys disks categories: | system -version: 0.104.0 +version: 0.105.0 system: | View information about the system disks. usage: | diff --git a/commands/docs/sys_host.md b/commands/docs/sys_host.md index 447a8fa7ab2..6464ca40f77 100644 --- a/commands/docs/sys_host.md +++ b/commands/docs/sys_host.md @@ -2,7 +2,7 @@ title: sys host categories: | system -version: 0.104.0 +version: 0.105.0 system: | View information about the system host. usage: | diff --git a/commands/docs/sys_mem.md b/commands/docs/sys_mem.md index d2525bd61d6..4692b15aa35 100644 --- a/commands/docs/sys_mem.md +++ b/commands/docs/sys_mem.md @@ -2,7 +2,7 @@ title: sys mem categories: | system -version: 0.104.0 +version: 0.105.0 system: | View information about the system memory. usage: | diff --git a/commands/docs/sys_net.md b/commands/docs/sys_net.md index 5274d6721ae..ba76c1b3fee 100644 --- a/commands/docs/sys_net.md +++ b/commands/docs/sys_net.md @@ -2,7 +2,7 @@ title: sys net categories: | system -version: 0.104.0 +version: 0.105.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 66454029cb5..f5a6e08c0e3 100644 --- a/commands/docs/sys_temp.md +++ b/commands/docs/sys_temp.md @@ -2,7 +2,7 @@ title: sys temp categories: | system -version: 0.104.0 +version: 0.105.0 system: | View the temperatures of system components. usage: | diff --git a/commands/docs/sys_users.md b/commands/docs/sys_users.md index 6b9c1909573..d8979716fd6 100644 --- a/commands/docs/sys_users.md +++ b/commands/docs/sys_users.md @@ -2,7 +2,7 @@ title: sys users categories: | system -version: 0.104.0 +version: 0.105.0 system: | View information about the users on the system. usage: | diff --git a/commands/docs/table.md b/commands/docs/table.md index 7e3f955b1b4..fd8eaece34e 100644 --- a/commands/docs/table.md +++ b/commands/docs/table.md @@ -2,7 +2,7 @@ title: table categories: | viewers -version: 0.104.0 +version: 0.105.0 viewers: | Render the table. usage: | @@ -62,7 +62,7 @@ Render data in table view Render data in table view (expanded) ```nu -> [[a b]; [1 2] [2 [4 4]]] | table --expand +> [[a b]; [1 2] [3 [4 4]]] | table --expand ╭───┬───┬───────────╮ │ # │ a │ b │ ├───┼───┼───────────┤ @@ -77,7 +77,7 @@ Render data in table view (expanded) Render data in table view (collapsed) ```nu -> [[a b]; [1 2] [2 [4 4]]] | table --collapse +> [[a b]; [1 2] [3 [4 4]]] | table --collapse ╭───┬───┬───────────╮ │ # │ a │ b │ ├───┼───┼───────────┤ @@ -92,25 +92,25 @@ Render data in table view (collapsed) Change the table theme to the specified theme for a single run ```nu -> [[a b]; [1 2] [2 [4 4]]] | table --theme basic +> [[a b]; [1 2] [3 [4 4]]] | table --theme basic ``` Force showing of the #/index column for a single run ```nu -> [[a b]; [1 2] [2 [4 4]]] | table -i true +> [[a b]; [1 2] [3 [4 4]]] | table -i true ``` Set the starting number of the #/index column to 100 for a single run ```nu -> [[a b]; [1 2] [2 [4 4]]] | table -i 100 +> [[a b]; [1 2] [3 [4 4]]] | table -i 100 ``` Force hiding of the #/index column for a single run ```nu -> [[a b]; [1 2] [2 [4 4]]] | table -i false +> [[a b]; [1 2] [3 [4 4]]] | table -i false ``` diff --git a/commands/docs/take.md b/commands/docs/take.md index 311984e217c..8fd28ea8cce 100644 --- a/commands/docs/take.md +++ b/commands/docs/take.md @@ -2,7 +2,7 @@ title: take categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Take only the first n elements of a list, or the first n bytes of a binary value. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | --------- | ------------ | -| binary | binary | -| list\ | list\ | -| range | list\ | | table | table | +| list<any> | list<any> | +| binary | binary | +| range | list<number> | ## Examples Return the first item of a list/table diff --git a/commands/docs/take_until.md b/commands/docs/take_until.md index b0342f65cf0..2a3e860da6d 100644 --- a/commands/docs/take_until.md +++ b/commands/docs/take_until.md @@ -2,7 +2,7 @@ title: take until categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Take elements of the input until a predicate is true. usage: | @@ -29,7 +29,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | ## Examples Take until the element is positive diff --git a/commands/docs/take_while.md b/commands/docs/take_while.md index ad32d9b1098..36014f621d1 100644 --- a/commands/docs/take_while.md +++ b/commands/docs/take_while.md @@ -2,7 +2,7 @@ title: take while categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Take elements of the input while a predicate is true. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | | table | table | +| list<any> | list<any> | ## Examples Take while the element is negative diff --git a/commands/docs/tee.md b/commands/docs/tee.md index ff1212582c2..1247c269150 100644 --- a/commands/docs/tee.md +++ b/commands/docs/tee.md @@ -2,7 +2,7 @@ title: tee categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Copy a stream to another command in parallel. usage: | diff --git a/commands/docs/term.md b/commands/docs/term.md index b814941e10d..5f45e97e68c 100644 --- a/commands/docs/term.md +++ b/commands/docs/term.md @@ -2,7 +2,7 @@ title: term categories: | platform -version: 0.104.0 +version: 0.105.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 2cb4120bd86..3f400672bb0 100644 --- a/commands/docs/term_query.md +++ b/commands/docs/term_query.md @@ -2,7 +2,7 @@ title: term query categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Query the terminal for information. usage: | @@ -22,8 +22,8 @@ contributors: false ## Flags - - `--prefix, -p {one_of(binary, string)}`: Prefix sequence for the expected reply. - - `--terminator, -t {one_of(binary, string)}`: Terminator sequence for the expected reply. + - `--prefix, -p {oneof}`: Prefix sequence for the expected reply. + - `--terminator, -t {oneof}`: Terminator sequence for the expected reply. - `--keep, -k`: Include prefix and terminator in the output. ## Parameters diff --git a/commands/docs/term_size.md b/commands/docs/term_size.md index f7c0e76bcee..63e0caf89fe 100644 --- a/commands/docs/term_size.md +++ b/commands/docs/term_size.md @@ -2,7 +2,7 @@ title: term size categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Returns a record containing the number of columns (width) and rows (height) of the terminal. usage: | @@ -25,7 +25,7 @@ contributors: false | input | output | | ------- | ------------------------------- | -| nothing | record\ | +| nothing | record<columns: int, rows: int> | ## Examples Return the columns (width) and rows (height) of the terminal diff --git a/commands/docs/timeit.md b/commands/docs/timeit.md index cf668a5d726..acf3357cfad 100644 --- a/commands/docs/timeit.md +++ b/commands/docs/timeit.md @@ -2,7 +2,7 @@ title: timeit categories: | debug -version: 0.104.0 +version: 0.105.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 d932363d8c1..c29c36ec989 100644 --- a/commands/docs/to.md +++ b/commands/docs/to.md @@ -2,7 +2,7 @@ title: to categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Translate structured data to a format. usage: | diff --git a/commands/docs/to_csv.md b/commands/docs/to_csv.md index f7e189f2549..3bea598dac0 100644 --- a/commands/docs/to_csv.md +++ b/commands/docs/to_csv.md @@ -2,7 +2,7 @@ title: to csv categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert table into .csv text . usage: | diff --git a/commands/docs/to_html.md b/commands/docs/to_html.md index c4b25b77917..7fee18d0c87 100644 --- a/commands/docs/to_html.md +++ b/commands/docs/to_html.md @@ -2,7 +2,7 @@ title: to html categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert table into simple HTML. usage: | @@ -26,7 +26,7 @@ contributors: false - `--no-color, -n`: remove all ansi colors in output - `--dark, -d`: indicate your background color is a darker color - `--partial, -p`: only output the html for the content itself - - `--theme, -t {string}`: the name of the theme to use (github, blulocolight, ...) + - `--theme, -t {string}`: the name of the theme to use (github, blulocolight, ...); case-insensitive - `--list, -l`: produce a color table of all available themes @@ -34,8 +34,8 @@ contributors: false | input | output | | ------- | ------ | -| any | string | | nothing | any | +| any | string | ## Examples Outputs an HTML string representing the contents of this table diff --git a/commands/docs/to_json.md b/commands/docs/to_json.md index 268432e9aa6..22daa27c71c 100644 --- a/commands/docs/to_json.md +++ b/commands/docs/to_json.md @@ -2,7 +2,7 @@ title: to json categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Converts table data into JSON text. usage: | diff --git a/commands/docs/to_md.md b/commands/docs/to_md.md index 408b8fb0511..1adcee1a2cb 100644 --- a/commands/docs/to_md.md +++ b/commands/docs/to_md.md @@ -2,7 +2,7 @@ title: to md categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert table into simple Markdown. usage: | @@ -24,6 +24,7 @@ contributors: false - `--pretty, -p`: Formats the Markdown table to vertically align items - `--per-element, -e`: treat each row as markdown syntax element + - `--center, -c {list}`: Formats the Markdown table to center given columns ## Input/output types: @@ -77,3 +78,12 @@ Separate list into markdown tables |-| |5| ``` + +Center a column of a markdown table +```nu +> [ {foo: 1, bar: 2} {foo: 3, bar: 4}] | to md --pretty --center [bar] +| foo | bar | +| --- |:---:| +| 1 | 2 | +| 3 | 4 | +``` diff --git a/commands/docs/to_msgpack.md b/commands/docs/to_msgpack.md index e78eb00a5bd..b871075eff9 100644 --- a/commands/docs/to_msgpack.md +++ b/commands/docs/to_msgpack.md @@ -2,7 +2,7 @@ title: to msgpack categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert Nu values into MessagePack. usage: | diff --git a/commands/docs/to_msgpackz.md b/commands/docs/to_msgpackz.md index 64763e861b4..3f4fd7eafbb 100644 --- a/commands/docs/to_msgpackz.md +++ b/commands/docs/to_msgpackz.md @@ -2,7 +2,7 @@ title: to msgpackz categories: | formats -version: 0.104.0 +version: 0.105.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 ce725f2c9fa..3d48faab066 100644 --- a/commands/docs/to_nuon.md +++ b/commands/docs/to_nuon.md @@ -2,7 +2,7 @@ title: to nuon categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Converts table data into Nuon (Nushell Object Notation) text. usage: | @@ -22,7 +22,7 @@ contributors: false ## Flags - - `--raw, -r`: remove all of the whitespace (default behaviour and overwrites -i and -t) + - `--raw, -r`: remove all of the whitespace (overwrites -i and -t) - `--indent, -i {number}`: specify indentation width - `--tabs, -t {number}`: specify indentation tab quantity - `--serialize, -s`: serialize nushell types that cannot be deserialized @@ -54,7 +54,7 @@ Outputs a NUON array of ints, with pretty indentation Overwrite any set option with --raw ```nu > [1 2 3] | to nuon --indent 2 --raw -[1, 2, 3] +[1,2,3] ``` A more complex record with multiple data types @@ -72,3 +72,9 @@ A more complex record with multiple data types ] } ``` + +A more complex record with --raw +```nu +> {date: 2000-01-01, data: [1 [2 3] 4.56]} | to nuon --raw +{date:2000-01-01T00:00:00+00:00,data:[1,[2,3],4.56]} +``` diff --git a/commands/docs/to_plist.md b/commands/docs/to_plist.md index 8d1b56cfa9c..6343030169f 100644 --- a/commands/docs/to_plist.md +++ b/commands/docs/to_plist.md @@ -2,7 +2,7 @@ title: to plist categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert Nu values into plist usage: | @@ -31,12 +31,6 @@ See the [Plugins](/book/plugins.html) chapter in the book for more information. - `--binary, -b`: Output plist in binary format - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | ## Examples Convert a table into a plist file diff --git a/commands/docs/to_text.md b/commands/docs/to_text.md index 4b14912f478..4f88ec7274b 100644 --- a/commands/docs/to_text.md +++ b/commands/docs/to_text.md @@ -2,7 +2,7 @@ title: to text categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Converts data into simple text. usage: | diff --git a/commands/docs/to_toml.md b/commands/docs/to_toml.md index 3b1bcf6fca3..c62dacedc03 100644 --- a/commands/docs/to_toml.md +++ b/commands/docs/to_toml.md @@ -2,7 +2,7 @@ title: to toml categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert record into .toml text. usage: | diff --git a/commands/docs/to_tsv.md b/commands/docs/to_tsv.md index f3db825a871..83424fd0d12 100644 --- a/commands/docs/to_tsv.md +++ b/commands/docs/to_tsv.md @@ -2,7 +2,7 @@ title: to tsv categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert table into .tsv text. usage: | diff --git a/commands/docs/to_xml.md b/commands/docs/to_xml.md index 262bc7b982d..564c33c042a 100644 --- a/commands/docs/to_xml.md +++ b/commands/docs/to_xml.md @@ -2,7 +2,7 @@ title: to xml categories: | formats -version: 0.104.0 +version: 0.105.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 f69975d73c1..c0cf202bc78 100644 --- a/commands/docs/to_yaml.md +++ b/commands/docs/to_yaml.md @@ -2,7 +2,7 @@ title: to yaml categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert table into .yaml/.yml text. usage: | diff --git a/commands/docs/to_yml.md b/commands/docs/to_yml.md index 1447b886c27..3278366b033 100644 --- a/commands/docs/to_yml.md +++ b/commands/docs/to_yml.md @@ -2,7 +2,7 @@ title: to yml categories: | formats -version: 0.104.0 +version: 0.105.0 formats: | Convert table into .yaml/.yml text. usage: | diff --git a/commands/docs/touch.md b/commands/docs/touch.md index 2de1ffb5ffe..dd7afdab06f 100644 --- a/commands/docs/touch.md +++ b/commands/docs/touch.md @@ -2,7 +2,7 @@ title: touch categories: | filesystem -version: 0.104.0 +version: 0.105.0 filesystem: | Creates one or more files. usage: | diff --git a/commands/docs/transpose.md b/commands/docs/transpose.md index 2afe4c664c7..3b4c8c5cf6d 100644 --- a/commands/docs/transpose.md +++ b/commands/docs/transpose.md @@ -2,7 +2,7 @@ title: transpose categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Transposes the table contents so rows become columns and columns become rows. usage: | @@ -37,8 +37,8 @@ contributors: false | input | output | | ------ | ------ | -| record | table | | table | any | +| record | table | ## Examples Transposes the table contents with default column names diff --git a/commands/docs/try.md b/commands/docs/try.md index fca9529fb6f..c9b3d18ba11 100644 --- a/commands/docs/try.md +++ b/commands/docs/try.md @@ -2,7 +2,7 @@ title: try categories: | core -version: 0.104.0 +version: 0.105.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 0b6f7628bc9..e720e89737d 100644 --- a/commands/docs/tutor.md +++ b/commands/docs/tutor.md @@ -2,7 +2,7 @@ title: tutor categories: | misc -version: 0.104.0 +version: 0.105.0 misc: | Run the tutorial. To begin, run: tutor. usage: | diff --git a/commands/docs/ulimit.md b/commands/docs/ulimit.md index b62525cbe4b..bff63448ab4 100644 --- a/commands/docs/ulimit.md +++ b/commands/docs/ulimit.md @@ -2,7 +2,7 @@ title: ulimit categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Set or get resource usage limits. usage: | diff --git a/commands/docs/uname.md b/commands/docs/uname.md index cb4940c750a..d9369c36522 100644 --- a/commands/docs/uname.md +++ b/commands/docs/uname.md @@ -2,7 +2,7 @@ title: uname categories: | system -version: 0.104.0 +version: 0.105.0 system: | Print certain system information using uutils/coreutils uname. usage: | diff --git a/commands/docs/uniq-by.md b/commands/docs/uniq-by.md index d776c44eec6..c41677b7b21 100644 --- a/commands/docs/uniq-by.md +++ b/commands/docs/uniq-by.md @@ -2,7 +2,7 @@ title: uniq-by categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Return the distinct values in the input by the given column(s). usage: | @@ -36,8 +36,8 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | | table | table | +| list<any> | list<any> | ## Examples Get rows from table filtered by column uniqueness diff --git a/commands/docs/uniq.md b/commands/docs/uniq.md index 2dcb6133f6e..200e292e03f 100644 --- a/commands/docs/uniq.md +++ b/commands/docs/uniq.md @@ -2,7 +2,7 @@ title: uniq categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Return the distinct values in the input. usage: | @@ -32,7 +32,7 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | +| list<any> | list<any> | ## Examples Return the distinct values of a list/table (remove duplicates so that each value occurs once only) diff --git a/commands/docs/update.md b/commands/docs/update.md index ad4b0d30c9b..f3270e11ced 100644 --- a/commands/docs/update.md +++ b/commands/docs/update.md @@ -2,7 +2,7 @@ title: update categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Update an existing column to have a new value. usage: | @@ -30,9 +30,9 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | | record | record | | table | table | +| list<any> | list<any> | ## Examples Update a column value diff --git a/commands/docs/update_cells.md b/commands/docs/update_cells.md index 1b625a33160..7ac333b327c 100644 --- a/commands/docs/update_cells.md +++ b/commands/docs/update_cells.md @@ -2,7 +2,7 @@ title: update cells categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Update the table cells. usage: | diff --git a/commands/docs/upsert.md b/commands/docs/upsert.md index 1b53c4f27c1..b7969a31939 100644 --- a/commands/docs/upsert.md +++ b/commands/docs/upsert.md @@ -2,7 +2,7 @@ title: upsert categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Update an existing column to have a new value, or insert a new column. usage: | @@ -30,9 +30,9 @@ contributors: false | input | output | | --------- | --------- | -| list\ | list\ | | record | record | | table | table | +| list<any> | list<any> | ## Examples Update a record's value diff --git a/commands/docs/url.md b/commands/docs/url.md index dce2cc8a08b..a8d74e1cfd9 100644 --- a/commands/docs/url.md +++ b/commands/docs/url.md @@ -2,7 +2,7 @@ title: url categories: | network -version: 0.104.0 +version: 0.105.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 d4d14b5eb4f..1051b767651 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.104.0 +version: 0.105.0 network: | Converts record or table into query string applying percent-encoding. usage: | @@ -26,7 +26,7 @@ contributors: false | input | output | | --------------------------- | ------ | | record | string | -| table\ | string | +| table<key: any, value: any> | string | ## Examples Outputs a query string representing the contents of this record diff --git a/commands/docs/url_decode.md b/commands/docs/url_decode.md index 3275b39ff46..e9e56c43233 100644 --- a/commands/docs/url_decode.md +++ b/commands/docs/url_decode.md @@ -2,7 +2,7 @@ title: url decode categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Converts a percent-encoded web safe string to a string. usage: | @@ -29,10 +29,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples Decode a url with escape characters diff --git a/commands/docs/url_encode.md b/commands/docs/url_encode.md index 56c0932ffae..f31ca014f36 100644 --- a/commands/docs/url_encode.md +++ b/commands/docs/url_encode.md @@ -2,7 +2,7 @@ title: url encode categories: | strings -version: 0.104.0 +version: 0.105.0 strings: | Converts a string to a percent encoded web safe string. usage: | @@ -33,10 +33,10 @@ contributors: false | input | output | | ------------ | ------------ | -| list\ | list\ | -| record | record | | string | string | +| list<string> | list<string> | | table | table | +| record | record | ## Examples Encode a url with escape characters diff --git a/commands/docs/url_join.md b/commands/docs/url_join.md index a1d196a3bfb..a1aec2b9cba 100644 --- a/commands/docs/url_join.md +++ b/commands/docs/url_join.md @@ -2,7 +2,7 @@ title: url join categories: | network -version: 0.104.0 +version: 0.105.0 network: | Converts a record to url. usage: | diff --git a/commands/docs/url_parse.md b/commands/docs/url_parse.md index ef727a1947e..3bacf6fea7b 100644 --- a/commands/docs/url_parse.md +++ b/commands/docs/url_parse.md @@ -2,7 +2,7 @@ title: url parse categories: | network -version: 0.104.0 +version: 0.105.0 network: | Parses a url. usage: | @@ -29,9 +29,9 @@ contributors: false | input | output | | ------ | ------ | -| record | record | | string | record | | table | table | +| record | record | ## Examples Parses a url diff --git a/commands/docs/url_split-query.md b/commands/docs/url_split-query.md index 22acd219b77..c0d9a481820 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.104.0 +version: 0.105.0 network: | Converts query string into table applying percent-decoding. usage: | @@ -25,7 +25,7 @@ contributors: false | input | output | | ------ | --------------------------------- | -| string | table\ | +| string | table<key: string, value: string> | ## Examples Outputs a table representing the contents of this query string diff --git a/commands/docs/use.md b/commands/docs/use.md index 86f937e215c..8978f4c58b8 100644 --- a/commands/docs/use.md +++ b/commands/docs/use.md @@ -2,7 +2,7 @@ title: use categories: | core -version: 0.104.0 +version: 0.105.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 ec767967265..8bd826f24bd 100644 --- a/commands/docs/values.md +++ b/commands/docs/values.md @@ -2,7 +2,7 @@ title: values categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Given a record or table, produce a list of its columns' values. usage: | @@ -25,8 +25,8 @@ contributors: false | input | output | | ------ | --------- | -| record | list\ | -| table | list\ | +| record | list<any> | +| table | list<any> | ## Examples Get the values from the record (produce a list) diff --git a/commands/docs/version.md b/commands/docs/version.md index 4c9db257fd8..cf89bee1039 100644 --- a/commands/docs/version.md +++ b/commands/docs/version.md @@ -2,7 +2,7 @@ title: version categories: | core -version: 0.104.0 +version: 0.105.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 27696f065d5..adc336cf22b 100644 --- a/commands/docs/version_check.md +++ b/commands/docs/version_check.md @@ -2,7 +2,7 @@ title: version check categories: | platform -version: 0.104.0 +version: 0.105.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 38e1005bada..062d6a875f7 100644 --- a/commands/docs/view.md +++ b/commands/docs/view.md @@ -2,7 +2,7 @@ title: view categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | Various commands for viewing debug information. usage: | diff --git a/commands/docs/view_blocks.md b/commands/docs/view_blocks.md index a9e1fbe751e..7d8ffc09d21 100644 --- a/commands/docs/view_blocks.md +++ b/commands/docs/view_blocks.md @@ -2,7 +2,7 @@ title: view blocks categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | View the blocks registered in nushell's EngineState memory. usage: | @@ -25,7 +25,7 @@ contributors: false | input | output | | ------- | ----------------------------------------------------------- | -| nothing | table\ | +| nothing | table<block_id: int, content: string, start: int, end: int> | ## Examples View the blocks registered in Nushell's EngineState memory diff --git a/commands/docs/view_files.md b/commands/docs/view_files.md index ea675fd8d28..ec83d54bcf8 100644 --- a/commands/docs/view_files.md +++ b/commands/docs/view_files.md @@ -2,7 +2,7 @@ title: view files categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | View the files registered in nushell's EngineState memory. usage: | @@ -25,7 +25,7 @@ contributors: false | input | output | | ------- | -------------------------------------------------------- | -| nothing | table\ | +| nothing | table<filename: string, start: int, end: int, size: int> | ## Examples View the files registered in Nushell's EngineState memory diff --git a/commands/docs/view_ir.md b/commands/docs/view_ir.md index 12006ba9c0d..cd442d2c3fe 100644 --- a/commands/docs/view_ir.md +++ b/commands/docs/view_ir.md @@ -2,7 +2,7 @@ title: view ir categories: | debug -version: 0.104.0 +version: 0.105.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 50df74fc675..45b20c67665 100644 --- a/commands/docs/view_source.md +++ b/commands/docs/view_source.md @@ -2,7 +2,7 @@ title: view source categories: | debug -version: 0.104.0 +version: 0.105.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 96855efad5a..2bb507ae6ab 100644 --- a/commands/docs/view_span.md +++ b/commands/docs/view_span.md @@ -2,7 +2,7 @@ title: view span categories: | debug -version: 0.104.0 +version: 0.105.0 debug: | View the contents of a span. usage: | diff --git a/commands/docs/watch.md b/commands/docs/watch.md index 1f8164af20c..b90ea608f4f 100644 --- a/commands/docs/watch.md +++ b/commands/docs/watch.md @@ -2,7 +2,7 @@ title: watch categories: | filesystem -version: 0.104.0 +version: 0.105.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 64ac4254529..11697b9e55f 100644 --- a/commands/docs/where.md +++ b/commands/docs/where.md @@ -2,11 +2,11 @@ title: where categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | - Filter values based on a row condition. + Filter values of an input list based on a condition. usage: | - Filter values based on a row condition. + Filter values of an input list based on a condition. editLink: false contributors: false --- @@ -14,24 +14,24 @@ contributors: false # `where` for [filters](/commands/categories/filters.md) -
Filter values based on a row condition.
+
Filter values of an input list based on a condition.
## Signature -```> where {flags} (row_condition)``` +```> where {flags} (condition)``` ## Parameters - - `row_condition`: Filter condition. + - `condition`: Filter row condition or closure. ## Input/output types: | input | output | | --------- | --------- | -| list\ | list\ | -| range | any | +| list<any> | list<any> | | table | table | +| range | any | ## Examples Filter rows of a table according to a condition @@ -45,12 +45,9 @@ Filter rows of a table according to a condition ``` -Filter items of a list according to a condition +List only the files in the current directory ```nu -> [1 2] | where {|x| $x > 1} -╭───┬───╮ -│ 0 │ 2 │ -╰───┴───╯ +> ls | where type == file ``` @@ -60,12 +57,6 @@ List all files in the current directory with sizes greater than 2kb ``` -List only the files in the current directory -```nu -> ls | where type == file - -``` - List all files with names that contain "Car" ```nu > ls | where name =~ "Car" @@ -78,25 +69,76 @@ List all files that were modified in the last two weeks ``` +Filter items of a list with a row condition +```nu +> [1 2 3 4 5] | where $it > 2 +╭───┬───╮ +│ 0 │ 3 │ +│ 1 │ 4 │ +│ 2 │ 5 │ +╰───┴───╯ + +``` + +Filter items of a list with a closure +```nu +> [1 2 3 4 5] | where {|x| $x > 2 } +╭───┬───╮ +│ 0 │ 3 │ +│ 1 │ 4 │ +│ 2 │ 5 │ +╰───┴───╯ + +``` + Find files whose filenames don't begin with the correct sequential number ```nu -> ls | where type == file | sort-by name --natural | enumerate | where {|e| $e.item.name !~ $'^($e.index + 1)' } | each {|| get item } +> ls | where type == file | sort-by name --natural | enumerate | where {|e| $e.item.name !~ $'^($e.index + 1)' } | get item ``` -Find case-insensitively files called "readme", without an explicit closure +Find case-insensitively files called "readme", with a subexpression inside the row condition ```nu > ls | where ($it.name | str downcase) =~ readme ``` -same as above but with regex only +Find case-insensitively files called "readme", with regex only ```nu > ls | where name =~ '(?i)readme' ``` +Filter rows of a table according to a stored condition +```nu +> let cond = {|x| $x.a > 1}; [{a: 1} {a: 2}] | where $cond +╭───┬───╮ +│ # │ a │ +├───┼───┤ +│ 0 │ 2 │ +╰───┴───╯ + +``` + +List all numbers above 3, using an existing closure condition +```nu +> let a = {$in > 3}; [1, 2, 5, 6] | where $a +╭───┬───╮ +│ 0 │ 5 │ +│ 1 │ 6 │ +╰───┴───╯ + +``` + ## Notes -This command works similar to 'filter' but allows extra shorthands for working with -tables, known as "row conditions". On the other hand, reading the condition from a variable is -not supported. \ No newline at end of file +A condition is evaluated for each element of the input, and only elements which meet the condition are included in the output. + +A condition can be either a "row condition" or a closure. A row condition is a special short-hand syntax to makes accessing fields easier. +Each element of the input can be accessed through the `$it` variable. + +On the left hand side of a row condition, any field name is automatically expanded to use `$it`. +For example, `where type == dir` is equivalent to `where $it.type == dir`. This expansion does not happen when passing a subexpression or closure to `where`. + +When using a closure, the element is passed as an argument and as pipeline input (`$in`) to the closure. Unlike row conditions, the `$it` variable isn't available inside closures. + +Row conditions cannot be stored in a variable. To pass a condition with a variable, use a closure instead. \ No newline at end of file diff --git a/commands/docs/which.md b/commands/docs/which.md index 34dd6bd1275..eb6ba800569 100644 --- a/commands/docs/which.md +++ b/commands/docs/which.md @@ -2,7 +2,7 @@ title: which categories: | system -version: 0.104.0 +version: 0.105.0 system: | Finds a program file, alias or custom command. usage: | @@ -18,7 +18,7 @@ contributors: false ## Signature -```> which {flags} (application) ...rest``` +```> which {flags} ...rest``` ## Flags @@ -26,8 +26,7 @@ contributors: false ## Parameters - - `application`: Application. - - `...rest`: Additional applications. + - `...rest`: Application(s). ## Input/output types: diff --git a/commands/docs/while.md b/commands/docs/while.md index 5b0eec73436..3a01004e62e 100644 --- a/commands/docs/while.md +++ b/commands/docs/while.md @@ -2,7 +2,7 @@ title: while categories: | core -version: 0.104.0 +version: 0.105.0 core: | Conditionally run a block in a loop. usage: | diff --git a/commands/docs/whoami.md b/commands/docs/whoami.md index a7a83bd600b..dafb590e083 100644 --- a/commands/docs/whoami.md +++ b/commands/docs/whoami.md @@ -2,7 +2,7 @@ title: whoami categories: | platform -version: 0.104.0 +version: 0.105.0 platform: | Get the current username using uutils/coreutils whoami. usage: | diff --git a/commands/docs/window.md b/commands/docs/window.md index 6cf6c8de5ce..091ad56c98e 100644 --- a/commands/docs/window.md +++ b/commands/docs/window.md @@ -2,7 +2,7 @@ title: window categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Creates a sliding window of `window_size` that slide by n rows/elements across input. usage: | @@ -34,7 +34,7 @@ contributors: false | input | output | | --------- | --------------- | -| list\ | list\\> | +| list<any> | list<list<any>> | ## Examples A sliding window of two elements diff --git a/commands/docs/with-env.md b/commands/docs/with-env.md index 470f5d9ff0f..54d023b064a 100644 --- a/commands/docs/with-env.md +++ b/commands/docs/with-env.md @@ -2,7 +2,7 @@ title: with-env categories: | env -version: 0.104.0 +version: 0.105.0 env: | Runs a block with an environment variable set. usage: | diff --git a/commands/docs/wrap.md b/commands/docs/wrap.md index 91a87f89c9f..b40ca54650d 100644 --- a/commands/docs/wrap.md +++ b/commands/docs/wrap.md @@ -2,7 +2,7 @@ title: wrap categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Wrap the value into a column. usage: | @@ -29,9 +29,9 @@ contributors: false | input | output | | --------- | ------ | -| any | record | -| list\ | table | +| list<any> | table | | range | table | +| any | record | ## Examples Wrap a list into a table with a given column name diff --git a/commands/docs/zip.md b/commands/docs/zip.md index b5bd0b0fd29..5753ca2ef61 100644 --- a/commands/docs/zip.md +++ b/commands/docs/zip.md @@ -2,7 +2,7 @@ title: zip categories: | filters -version: 0.104.0 +version: 0.105.0 filters: | Combine a stream with the input. usage: | @@ -29,8 +29,8 @@ contributors: false | input | output | | --------- | --------------- | -| list\ | list\\> | -| range | list\\> | +| list<any> | list<list<any>> | +| range | list<list<any>> | ## Examples Zip two lists From 2c3a08871744cf18c3425e2aaaa6b501bfd8edbf Mon Sep 17 00:00:00 2001 From: hustcer Date: Tue, 10 Jun 2025 23:14:34 +0800 Subject: [PATCH 2/2] Remove doc of deprecated command --- commands/docs/polars_replace-all.md | 67 ----------------------------- commands/docs/registry_query.md | 2 +- 2 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 commands/docs/polars_replace-all.md diff --git a/commands/docs/polars_replace-all.md b/commands/docs/polars_replace-all.md deleted file mode 100644 index 346120b22a3..00000000000 --- a/commands/docs/polars_replace-all.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: polars replace-all -categories: | - dataframe -version: 0.104.0 -dataframe: | - Replace all (sub)strings by a regex pattern. -usage: | - Replace all (sub)strings by a regex pattern. -editLink: false -contributors: false ---- - - -# `polars replace-all` for [dataframe](/commands/categories/dataframe.md) - -
Replace all (sub)strings by a regex pattern.
- -::: warning This command requires a plugin -The `polars replace-all` command resides in the `polars` plugin. -To use this command, you must install and register `nu_plugin_polars`. -See the [Plugins](/book/plugins.html) chapter in the book for more information. -::: - - -## Signature - -```> polars replace-all {flags} ``` - -## Flags - - - `--pattern, -p {string}`: Regex pattern to be matched - - `--replace, -r {string}`: replacing string - - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | -## Examples - -Replaces string in a column -```nu -> [[a]; [abac] [abac] [abac]] | polars into-df | polars select (polars col a | polars replace-all --pattern a --replace A) | polars collect -╭───┬──────╮ -│ # │ a │ -├───┼──────┤ -│ 0 │ AbAc │ -│ 1 │ AbAc │ -│ 2 │ AbAc │ -╰───┴──────╯ - -``` - -Replaces string -```nu -> [abac abac abac] | polars into-df | polars replace-all --pattern a --replace A -╭───┬──────╮ -│ # │ 0 │ -├───┼──────┤ -│ 0 │ AbAc │ -│ 1 │ AbAc │ -│ 2 │ AbAc │ -╰───┴──────╯ - -``` diff --git a/commands/docs/registry_query.md b/commands/docs/registry_query.md index f1d8155c352..148f505e59f 100644 --- a/commands/docs/registry_query.md +++ b/commands/docs/registry_query.md @@ -2,7 +2,7 @@ title: registry query categories: | system -version: 0.104.0 +version: 0.105.0 system: | Query the Windows registry. usage: |