swift-sh VS pyxargs

Compare swift-sh vs pyxargs and see what are their differences.

swift-sh

Easily script with third-party Swift dependencies. (by mxcl)

pyxargs

Command line Python scripting with an xargs-like interface and AWK-like capabilities for data processing and task automation (by elesiuta)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
swift-sh pyxargs
4 4
1,772 4
- -
2.9 8.6
2 months ago about 1 month ago
Swift Python
The Unlicense GNU General Public License v3.0 only
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

swift-sh

Posts with mentions or reviews of swift-sh. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-08-13.
  • Ask HN: Share a shell script you like
    17 projects | news.ycombinator.com | 13 Aug 2023
  • Using Swift for Scripting
    1 project | news.ycombinator.com | 5 Jan 2023
    Yes, swift CLI will compile and run your swift file.

    But many people also want to use libraries. For Python, they use the system libraries or work within an environment with installed libraries (i.e., the library-install process happens at environment-configuration time).

    In Swift, the easiest way to consume libraries is using packages, but that requires a Package.swift declaring the project scope for the script file (which must comply with top-level and main-entrypoint code requirements).

    The easiest way to do that when scripting is a swift tool that manages the process of gathering your library dependencies, auto-generating a project, building the tool, and caching it all so there's no overhead the next time.

    The best available tool now is https://github.com/mxcl/swift-sh. It reads dependency information off import comments.

    It can also generate the project for you, if/when you want to build in XCode (e.g., move into a more complex application, perhaps requiring sandbox declarations).

    Working scripts are not always updated, so any script-build tool has to maintain backwards compatibility, but the swift package manager has changed a lot in recent versions. swift-sh seems to err on the side of backwards compatibility, and does not support e.g., the most recent dependency versioning styles.

    Swift-forum discussions about better support for scripting haven't resulted in any official tooling.

  • On Env Shebangs
    3 projects | news.ycombinator.com | 15 Apr 2022
  • Did anyone tried to run swift on raspberry pi before? I managed to install swift on my raspberry pi and print hello wold. Butbwhen i tried to do the same after 10 seconds it didnt work. Any idea why it didn’t print? DispatchQueue.main.asyncAfter(deadline: .now() + 10) { print(“Hello world”) }
    1 project | /r/swift | 31 Dec 2021
    Note that this has nothing to do with the Raspberry Pi. You'll have the same issue running on the command-line. If you wish to test your programs on your computer where you have more tools and horse-power, I find swift-sh gives a good command-line experience and is a great alternative to Playgrounds especially for small tests.

pyxargs

Posts with mentions or reviews of pyxargs. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-09-23.
  • Modern Linux Tools vs. Unix Classics: Which Would I Choose?
    5 projects | news.ycombinator.com | 23 Sep 2023
    > I too can never remember jq syntax when I need to. I usually just end up writing a Python script

    Same here! That's why for small things I made pyxargs [1] to use python in the shell. In another thread I also just learned of pyp [2] which I haven't tried yet but looks like it'd be even better for this use case.

    [1] https://github.com/elesiuta/pyxargs

    [2] https://github.com/hauntsaninja/pyp

  • Alternative Shells
    2 projects | news.ycombinator.com | 23 Aug 2023
    I personally use fish, but mostly for the out of the box auto completions and highlighting, I don't use it for actual scripting, nor have it set as the login shell due to the 2nd reason you mentioned.

    I mostly use python as well, and for some short commands I made pyxargs [1] which lets you run python code on stdin, or a walk of your current directory.

    [1] https://github.com/elesiuta/pyxargs

  • Ask HN: Share a shell script you like
    17 projects | news.ycombinator.com | 13 Aug 2023
    pyxargs --py "print('{}') if os.path.ismount('{}') else ''" | pyxargs fusermount -u {}

    My primary use case was using this with ffmpeg due to the encoding problem with xargs [2].

    It can also run commands in parallel using a terminal multiplexer so outputs don't get mixed up or if they require user input.

    [1] https://github.com/elesiuta/pyxargs

  • Show HN: Clamshell- an experimental Python based shell
    5 projects | news.ycombinator.com | 28 Jan 2023

What are some alternatives?

When comparing swift-sh and pyxargs you can also consider the following projects:

resholve - a shell resolver? :) (find and resolve shell script dependencies)

fuz - Fuzzy search text / notes in the terminal, for any collection of text files

stderred - stderr in red

spellbook - 🪄 Shell and Powershell scripts registry

dotfiles

pyp - Easily run Python at the shell! Magical, but never mysterious.

Alamofire - Elegant HTTP Networking in Swift

gron - Make JSON greppable!

SwiftBar - Powerful macOS menu bar customization tool

bf.jq - Brainfuck interpreter written in jq -- This is the proof that jq is turing-complete!