Nu map from imperative languages

The idea behind this table is to help you understand how Nu built-ins and plugins relate to imperative languages. We've tried to produce a map of programming-relevant Nu commands and what their equivalents are in other languages. Contributions are welcome.

Note: this table assumes Nu 0.94 or later.

NushellPythonKotlin (Java)C++Rust
appendlist.append, set.addaddpush_back, emplace_backpush, push_back
math avgstatistics.mean
math, Math OperatorsMath operatorsMath operatorsMath operatorsMath operators
countlensize, lengthlengthlen
cpshutil.copyfs::copy
datedatetime.date.todayjava.time.LocalDate.now
droplist[:-3]
du, ls --dushutil.disk_usage
each
for
forforforfor
exitexit()System.exit, kotlin.system.exitProcessexitexit
http geturllib.request.urlopen
firstlist[:x]List[0], peekvector[0], topVec[0]
formatformatformatformatformat!
fromcsv, json, sqlite3
getdict[\"key\"]Map[\"key\"]map[\"key\"]HashMap["key"], get, entry
group-byitertools.groupbygroupBygroup_by
headerskeys
helphelp()
insertdict[\"key\"] = valmap.insert({ 20, 130 })map.insert(\"key\", val)
is-emptyis None, is []isEmptyemptyis_empty
takelist[:x]&Vec[..x]
take untilitertools.takewhile
take whileitertools.takewhile
killos.kill
lastlist[-x:]&Vec[Vec.len()-1]
linessplit, splitlinessplitviews::splitsplit, split_whitespace, rsplit, lines
lsos.listdirfs::read_dir
matchmatchwhenmatch
mergedict.appendmap.extend
mkdiros.mkdirfs::create_dir
mvshutil.movefs::rename
getlist[x]List[x]vector[x]Vec[x]
openopen
transposezip(\*matrix)
http posturllib.request.urlopen
prependdeque.appendleft
printprintprintlnprintfprintln!
psos.listdir('/proc')
pwdos.getcwdenv::current_dir
range typerange.., until, downTo, stepiota..
reducefunctools.reducereducereducefold, rfold, scan
rejectdel
renamedict[\"key2\"] = dict.pop(\"key\")map.insert(\"key2\", map.remove(\"key\").unwrap())
reversereversed, list.reversereverse, reversed, asReversedreverserev
rmos.remove
saveio.TextIOWrapper.write
select{k:dict[k] for k in keys}
shufflerandom.shuffle
str stats
str length
length
lenlen
skiplist[x:]&Vec[x..], skip
skip untilitertools.dropwhile
skip whileitertools.dropwhileskip_while
sort-bysorted, list.sortsortedBy, sortedWith, Arrays.sort, Collections.sortsortsort
split rowstr.split{,lines}, re.splitsplitviews::splitsplit
strstr functionsString functionsString functions&str, String functions
str joinstr.joinjoinToStringjoin
str trimstrip, rstrip, lstriptrim, trimStart, trimEndRegextrim, trim*{start,end}, strip*{suffix,prefix}
math sumsumsumreducesum
toimport csv, json, sqlite3
touchopen(path, 'a').close()
uniqsetSetsetHashSet
upsertdict[\"key\"] = val
versionsys.version, sys.version_info
with-env
$env.FOO = "bar"
os.environ
wherefilterfilterfilterfilter
whichshutil.which
wrap{ "key" : val }
Contributors: Aaron Christiansen, CKingX, Dan Davison, Darren Schroeder, Filip Andersson, Heidar-An, Hristo Filaretov, Ian Manske, Ibraheem Ahmed, JT, Jonathan Turner, Justin Ma, Leon, NotTheDr01ds, Stefan Holderbach, Zhora Trush, casually-blue