Swift’s tooling for non-app work still has some way to go. I attempted to write a script for analysing API data, but ended up fighting swift-sh, Marathon, Xcode’s integration of those, and cryptic compiler errors. Switched to Jupyter and it was fine. Might try again in 2020.