AI answers are often unbelievably good, and I believe also for this topic: ChatGPT - Julia Dict Comparisons
21. A particularly important Python → Julia mapping
I’m not new to Julia actually, I just though there should be a list of recommend packages coming from e.g. Python, and I recommend using OrderedCollections, Revise as a starting point, the latter just during development.
Python’s standard library is incredibly broad, you can e.g. send email with the standard library. Consider using PythonCall to get access to all of it, to use it as such as a “tool”. I’m most interested in A. more core capability/data structures, and to some degree about B. tools people know of in e.g. Python, and want a similar native Julia package for. Feel free to list a minimal list of packages for A (and/or B), even for C. for (web) frameworks for Julia parity. For those who know, or for new users who do not know the mapping, so we can help. The manual has a section for difference with many languages vs. Python, C++ etc. It and the help might need amending:
help?> Dict
..
Dict{K,V}() constructs a hash table with keys of type K and values of type V. Keys are compared with isequal and hashed with hash.
The example is only implicit about unordered, so I suggest changing to:
Dict{K,V}() constructs a (unordered) hash table with keys of type K and values of type V. Consider `using OrderedCollections` for access to `OrderedDict`. Keys are compared with isequal and hashed with hash.
To partially answer my own question, there is e.g. SMTPClient.jl to send email, no need for PythonCall.jl there (for basic capability, i.e. the actual sending). You can use all of Python’s current email capability, including email to construct the email, before sending; note smtpd was removed in Python 3.12, with aiosmtpd a substitute, and my answer doesn’t cover it or such servers.
I’ll just post this too even though AI generated (at least good for discussion if anything wrong there):
1. The genuinely important Python stdlib gaps
I’d put these near the top.
Python Julia stdlib/Base My assessment heapqDataStructures.HeapMissing from stdlib, but trivial package substitute collections.dequeDataStructures.DequeSame collections.defaultdictget!/ custom typesDataStructures.DefaultDict[Here AI was wrong: “No exact equivalent”]collections.CounterStatsBase.countmapetc.Package enum@enumJulia actually has it dataclassesstructs Julia doesn’t need the mechanism functoolsdoblocks, closures, higher-order functionsMostly unnecessary itertoolsBase.Iterators Julia is arguably better here operatoroperators/functions directly Mostly unnecessary weakrefWeakRefJulia has it copycopy,deepcopyyes pickleSerializationyes, though not equivalent in purpose/portability jsonJSONpackagenot stdlib reRegexyes argparseArgTools.jl / packages not a real equivalent subprocessCmd,run, pipelinesyes pathlibBase.Filesystemyes, although less elegant tempfilemktemp,mktempdiryes shutilfilesystem functions mostly yes loggingLoggingyes warningsLogging/ warnings machinerynot quite equivalent tracebackstacktrace machinery yes inspectreflection Julia has a different, often more powerful model astMeta, JuliaSyntaxyes, but fundamentally different discode_*,@code_*yes, arguably much richer threadingBase.Threadsyes multiprocessingdistributed processes yes asyncioTasks/Channelsyes, but different model socketBase.Socketsyes sslMbedTLS[or rather OpenSSL.jl?]stdlib package http.client/urllibDownloadsyes ??? real gap smtplib[SMTPClient.jl] real-ish gap imaplib??? gap ftplib??? gap zipfileTaretc.ZIP is surprisingly awkward gzipCodecZlib.jl package bz2CodecBzip2.jl package lzmaCodecXz.jl package sqlite3SQLite.jl package dbm[ SQLite.jl]gap configparser[avoid .ini files, rather use TOML or PythonCall.jl] gap tomllibTOML yes csvCSV.jl package xmlXML packages package html.parserGumbo etc. package zipapp[AppBundler.jl or JuliaC.jl] gap venvPkg environments Julia arguably better venv+pipPkgmajor Julia advantage
zipapp is a rather unusual “library”/concept, and not a substitute to simply call it with PythonCall.jl, I replaced its ??? (and edited more such) with plausible alternatives. dbm is likely a real gap, but who cares… I put in indirect substitute…