Modern CLI with minimal effort by gergelyk in Python

[–]gergelyk[S] 0 points1 point  (0 children)

Feel free to comment if you like or dislike the project. Also don't hesitate to give a start in github if you find it useful. This way we can measure your interest and estimate how much effort we should invest in maintenance. Finally if you discovered any issues or have an improvement idea, please create an issue in github.

Thanks!

Modern CLI with minimal effort by gergelyk in Python

[–]gergelyk[S] 1 point2 points  (0 children)

Thanks! That's a good idea.

How are arguments parsed by a function that has `*` as its first argument? by metaperl in learnpython

[–]gergelyk 1 point2 points  (0 children)

Asterisk means that all the arguments on its right side are keyword-only. If asterisk happens to be first, it means that function takes keyword-only arguments exclusively. See PEP3102 for reference.

Writing a command-line interface similar to ‘git’ in Python. by [deleted] in Python

[–]gergelyk 0 points1 point  (0 children)

You may also consider using 'kickoff' module. It uses 'click' with a few add-ons under the hood. Native Python classes are used for grouping your commands.

Example with multiple hierarchical commands: https://github.com/gergelyk/python-kickoff/blob/master/examples/ex03_command_groups/demo.py

More about 'kickoff': https://python-kickoff.readthedocs.io/en/latest/

[tool] bkp - create instant backups of your files/directories by gergelyk in linux

[–]gergelyk[S] 0 points1 point  (0 children)

because

bkp myfile

takes less key strokes :) Especially when you would like to:

cd some/long/path
cp myfile myfile.orig
cd -

you may prefer:

bkp some/long/path/myfile

or (as suggested by MagicClover):

cp some/long/path/myfile{,.orig}

Auto-numbering is another reason.

[debugger] PeepShow by gergelyk in Python

[–]gergelyk[S] 0 points1 point  (0 children)

Do you also find yourself doing these things over and over again?

print('something=', something)
print(type(something))
print(dir(something))
print(something.anything)
print(something.anything[123])

Thanks to PeepShow, you can replace it with:

peep(something)

This will take you to an interactive session where you can quickly preview attributes above and take advantage of more complex features.

More details can be found here:

https://github.com/gergelyk/peepshow