Python actually has support for this with `pip-run`. There's a PR to get similar behaviour into `pipx`, which is effectively the `npx` of Python world. I think the single-script-with-dependencies workflow has been somewhat ignored until now; it would be nice to see that become easier.