google / google/python-fire

Ability use args, kwargs with delimiter

Open
#216 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
28.2k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Fire now try to parse flat args and kwargs, but often this not convenient
Example:

```
import fire

def test(*args, **kwargs):
print(kwargs)
print(args)

fire.Fire(test)

```

`python main.py arg1 arg2 --kwarg1 1 --kwarg2 2`

`
{'kwarg1': 1, 'kwarg2': 2}
('arg1', 'arg2')
`

In some cases will be much more simple have opportunity to set *args **kwargs like this :
`
python main.py --args arg1 --args arg2 --kwargs kwarg1=1 --kwargs kwarg2=2
`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.