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.43 or later.

NushellPythonKotlin (Java)C++Rust
appendlist.append, set.addaddpush_back, emplace_backpush, push_back
math avgstatistics.mean
calc, = mathmath operatorsmath operatorsmath operatorsmath operators
countlensize, lengthlengthlen
cpshutil.copyfs::copy
datedatetime.date.todayjava.time.LocalDate.now
droplist[:-3]
dushutil.disk_usage
eachforforforfor
exitexitSystem.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
rangerange.., 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
sizelenlen
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}
sumsumsumreducesum
syssys
toimport csv, json, sqlite3
touchopen(path, 'a').close()
uniqsetSetsetHashSet
upsertdict["key"] = val
versionsys.version, sys.version_info
with-envos.environ
wherefilterfilterfilterfilter
whichshutil.which
wrap{ "key" : val }
Contributors: Aaron Christiansen, CKingX, Dan Davison, Darren Schroeder, Filip Andersson, Heidar-An, Hristo Filaretov, Ibraheem Ahmed, JT, Jonathan Turner, Justin Ma, Leon, Stefan Holderbach, Zhora Trush, casually-blue