tellapart / commandr Goto Github PK
View Code? Open in Web Editor NEWTool that creates command line interfaces for functions automatically.
License: Apache License 2.0
Tool that creates command line interfaces for functions automatically.
License: Apache License 2.0
This is a feature request folks, for the very nice commander!
It would be great to have option names like 'test_option' parsed as '--test-option' instead of '--test_option'. The reason is, perhaps, that there's a long tradition of options being parsed that way.
Since you may want to keep backwards compatibility, perhaps accepting both would be great and maybe display the built-in command help with the more common hyphen symbol instead of the underscore.
That is:
@command('run')
def run(test_option = 'foo'):
pass
Would accept both --test-option and --test_option but the built-in help for the command would display --test-option.
Thanks!
currently, marking a parameter as list requires adding a default list value for it - but this is problematic when the function is also used from regular code (the list may change over time).
additionally, sometimes it's desirable to set a type for a parameter, but keep it mandatory
having something like:
@command('function_name', types={'p1':list})
def function_name(p1,p2):
pass
can solve this
With a signature like:
fn(a, n=100)
then:
python script.py fn a --n 100
properly converts n
to an int. However, when called like:
python script.py fn a 100
leaves the n argument as a string
I'm getting the following error when I try to use commandr:
ImportError: No module named functools_util
It would appear that functools_util.py isn't being packaged with the module. As a test, I simply pasted it into my site-packages/commandr directory and the error goes away.
I'm a bit of a python newb, but I assume that commandr/functools_util.py
needs to be added to commandr/MANIFEST
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.