jamesob / clii Goto Github PK
View Code? Open in Web Editor NEWPython 3.7+ function annotations -> CLI
License: MIT License
Python 3.7+ function annotations -> CLI
License: MIT License
I find my most common use case (previously with click) was to add cli options to a single-command script. Is it possible to make clii run a default command (or the only existing command)? That way you don't have to type "python main.py main --args" to run your main function.
I really like how small and simple this lib is, thanks for making it!
I've been playing with it for a little bit and I noticed that when I define an integer argument with a default of 1
or 0
, it gets turned into a boolean flag.
I tracked it down to the check:
if self.type == bool or self.default in [True, False]:
Apparently 1 in [True, False]
is True....
Title says all, really!
I've had the same brush with argparse and subparser spaghetti. I'd love to be able to consider this for a future project.
Using poetry to create a fresh virtualenv and installing clii, I am unable to import it. pip even lists it as installed.
$ mkdir test
$ cd test
$ poetry init
...
$ poetry add clii
$ poetry shell
$ pip list
Package Version
---------- -------
clii 0.2.2
pip 19.2.3
setuptools 41.2.0
$ python
>>> import clii
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'clii'
This works fine with 0.2.1
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.