Table of Contents generated with DocToc
gitlike-commands
Background
gitlike-commands is a python module for easily creating git-style subcommand handling.
Refactored out of thelogrus so you don't have to import any modules that aren't part of the Python standard library.
Usage
subcommand_driver automatically figures out what name the script was called as, then looks for subcommands and runs them if found, passing in any command line options.
So if you have a foo script in your $PATH as shown below
#!/usr/bin/env python3
from gitlike_commands import subcommand_driver
if __name__ == '__main__':
subcommand_driver()
Running foo bar baz will look for a foo-bar-baz script, and if present in your $PATH, run it. If there is no foo-bar-baz, it will look for foo-bar, and if it finds that, run foo-bar baz.
You can add a gitlike driver as a scripts entry in your pyproject.toml. With a
PEP 621 layout (uv, hatch, pdm, and other standards-based tools):
[project.scripts]
gitalike-demo = "gitlike_commands:subcommand_driver"
Or, if your project still uses poetry:
[tool.poetry.scripts]
gitalike-demo = "gitlike_commands:subcommand_driver"
The subcommand inherits the driver's stdin, stdout, and stderr, so piped input (echo data | foo bar), interactive prompts, and output all pass through to the subcommand unchanged.
The subcommands can be written in any language, the only requirements are that they are marked executable and follow the foo-something naming convention.
Metadata
Release files for gitlike-commands 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gitlike_commands-0.4.0.tar.gz | 49.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gitlike_commands-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.4 kB
Release files / gitlike_commands-0.4.0.tar.gz
| Download URL | gitlike_commands-0.4.0.tar.gz |
|---|---|
| Size | 49.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dc8783856984b4102247ab4fbba7ca06dc78507baafacb3c28ee6569d2353324
|
|
BLAKE2b-256 checksum How to use checksums |
d11b5ff133aa2f5c1867f179976952adffe693c0f574f162f45b5787969150bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / gitlike_commands-0.4.0-py3-none-any.whl
| Download URL | gitlike_commands-0.4.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25911b0c881d6b01e4ee536f74423a5eb02788fa38280432373932cb62bd9d79
|
|
BLAKE2b-256 checksum How to use checksums |
85feb96a748b490f33f983351dff17f9621c9e96364f3e07e8691958dea2a174
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for gitlike-commands 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.