fire
Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 68 committers (1.5%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.6%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.
Basic Info
Statistics
- Stars: 27,861
- Watchers: 365
- Forks: 1,452
- Open Issues: 152
- Releases: 11
Topics
Metadata Files
README.md
Python Fire 
Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.
- Python Fire is a simple way to create a CLI in Python. [1]
- Python Fire is a helpful tool for developing and debugging Python code. [2]
- Python Fire helps with exploring existing code or turning other people's code into a CLI. [3]
- Python Fire makes transitioning between Bash and Python easier. [4]
- Python Fire makes using a Python REPL easier by setting up the REPL with the modules and variables you'll need already imported and created. [5]
Installation
To install Python Fire with pip, run: pip install fire
To install Python Fire with conda, run: conda install fire -c conda-forge
To install Python Fire from source, first clone the repository and then run:
python setup.py install
Basic Usage
You can call Fire on any Python object:
functions, classes, modules, objects, dictionaries, lists, tuples, etc.
They all work!
Here's an example of calling Fire on a function.
```python import fire
def hello(name="World"): return "Hello %s!" % name
if name == 'main': fire.Fire(hello) ```
Then, from the command line, you can run:
bash
python hello.py # Hello World!
python hello.py --name=David # Hello David!
python hello.py --help # Shows usage information.
Here's an example of calling Fire on a class.
```python import fire
class Calculator(object): """A simple calculator class."""
def double(self, number): return 2 * number
if name == 'main': fire.Fire(Calculator) ```
Then, from the command line, you can run:
bash
python calculator.py double 10 # 20
python calculator.py double --number=15 # 30
To learn how Fire behaves on functions, objects, dicts, lists, etc, and to learn about Fire's other features, see the Using a Fire CLI page.
For additional examples, see The Python Fire Guide.
Why is it called Fire?
When you call Fire, it fires off (executes) your command.
Where can I learn more?
Please see The Python Fire Guide.
Reference
| Setup | Command | Notes
| :------ | :------------------ | :---------
| install | pip install fire |
| Creating a CLI | Command | Notes
| :--------------| :--------------------- | :---------
| import | import fire |
| Call | fire.Fire() | Turns the current module into a Fire CLI.
| Call | fire.Fire(component) | Turns component into a Fire CLI.
| Using a CLI | Command | Notes
| :---------------------------------------------- | :-------------------------------------- | :----
| Help | command --help or command -- --help |
| REPL | command -- --interactive | Enters interactive mode.
| Separator | command -- --separator=X | Sets the separator to X. The default separator is -.
| Completion | command -- --completion [shell] | Generates a completion script for the CLI.
| Trace | command -- --trace | Gets a Fire trace for the command.
| Verbose | command -- --verbose |
Note that these flags are separated from the Fire command by an isolated --.
License
Licensed under the Apache 2.0 License.
Disclaimer
This is not an official Google product.
Owner
- Name: Google
- Login: google
- Kind: organization
- Email: opensource@google.com
- Location: United States of America
- Website: https://opensource.google/
- Twitter: GoogleOSS
- Repositories: 2,773
- Profile: https://github.com/google
Google ❤️ Open Source
GitHub Events
Total
- Issues event: 18
- Watch event: 1,002
- Delete event: 26
- Member event: 3
- Issue comment event: 82
- Push event: 47
- Pull request review event: 13
- Pull request event: 73
- Fork event: 41
- Create event: 37
Last Year
- Issues event: 18
- Watch event: 1,002
- Delete event: 26
- Member event: 3
- Issue comment event: 82
- Push event: 47
- Pull request review event: 13
- Pull request event: 73
- Fork event: 41
- Create event: 37
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| David Bieber | d****r@g****m | 204 |
| dependabot[bot] | 4****] | 29 |
| Joe Chen | z****n@g****m | 28 |
| Jacob Austin | j****n@g****m | 6 |
| Jirka Borovec | 6****a | 6 |
| Saurabh Patel | s****0@g****m | 4 |
| Jeff Tratner | j****r@g****m | 4 |
| Rebecca Chen | r****n@g****m | 3 |
| MichaelCG8 | 4****8 | 3 |
| Wei-Chung Liao | w****o@g****m | 2 |
| Vincent Barbaresi | v****i@g****m | 2 |
| Neal McBurnett | n****l@m****g | 2 |
| Mehmood Deshmukh | m****d@g****m | 2 |
| Martin Gruber | m****1@w****e | 2 |
| Jared Trog | j****g@g****m | 2 |
| Jared Garst | j****t | 2 |
| Hugo van Kemenade | h****k | 2 |
| cclauss | c****s@b****h | 2 |
| Evan Juarez | e****v@g****m | 1 |
| Daniel Zheng | d****6@g****m | 1 |
| Daiki Katsuragawa | 5****a | 1 |
| Conor Sheehan | c****v@g****m | 1 |
| Christopher J. Wright | c****h@g****m | 1 |
| Bruno P. Kinoshita | k****w | 1 |
| Bradley D'Amato | 5****o | 1 |
| Bea Steers | b****s@g****m | 1 |
| Andrew Au | c****g@g****m | 1 |
| Amy Lei | 4****i | 1 |
| Alex Shadley | s****x@g****m | 1 |
| Ajo John | a****5@g****m | 1 |
| and 38 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 118
- Total pull requests: 210
- Average time to close issues: 5 months
- Average time to close pull requests: 5 months
- Total issue authors: 106
- Total pull request authors: 53
- Average comments per issue: 3.37
- Average comments per pull request: 1.96
- Merged pull requests: 100
- Bot issues: 0
- Bot pull requests: 94
Past Year
- Issues: 15
- Pull requests: 87
- Average time to close issues: 3 months
- Average time to close pull requests: 28 days
- Issue authors: 15
- Pull request authors: 6
- Average comments per issue: 0.87
- Average comments per pull request: 0.86
- Merged pull requests: 44
- Bot issues: 0
- Bot pull requests: 51
Top Authors
Issue Authors
- dbieber (6)
- xiaoxstz (2)
- WilmarE (2)
- Borda (2)
- impredicative (2)
- link89 (2)
- dvzrv (2)
- MirchellNeal (2)
- arita37 (2)
- ophir-oneview (1)
- ntjess (1)
- anemele (1)
- dependabot[bot] (1)
- ophiry (1)
- astrojuanlu (1)
Pull Request Authors
- dependabot[bot] (117)
- dbieber (52)
- Borda (15)
- Rohan-Salwan (2)
- tschm (2)
- bonfy (2)
- wchliao (2)
- BasedDepartment1 (2)
- cocolato (2)
- ivanmilevtues (2)
- sp1thas (2)
- Verlusti (2)
- wdhongtw (2)
- ESPR3SS0 (2)
- igeni (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 10
-
Total downloads:
- pypi 11,661,349 last-month
- Total docker downloads: 45,104,340
-
Total dependent packages: 793
(may contain duplicates) -
Total dependent repositories: 8,614
(may contain duplicates) - Total versions: 47
- Total maintainers: 3
pypi.org: fire
A library for automatically generating command line interfaces.
- Homepage: https://github.com/google/python-fire
- Documentation: https://fire.readthedocs.io/
- License: Apache-2.0
-
Latest release: 0.7.1
published 6 months ago
Rankings
Maintainers (1)
conda-forge.org: fire
Python Fire is a simple way to create a CLI in Python. Python Fire is a helpful tool for developing and debugging Python code. Python Fire helps with exploring existing code or turning other people's code into a CLI. Python Fire makes transitioning between Bash and Python easier. Python Fire makes using a Python REPL easier by setting up the REPL with the modules and variables you'll need already imported and created.
- Homepage: https://github.com/google/python-fire
- License: Apache-2.0
-
Latest release: 0.4.0
published about 5 years ago
Rankings
proxy.golang.org: github.com/google/python-fire
- Documentation: https://pkg.go.dev/github.com/google/python-fire#section-documentation
- License: other
-
Latest release: v0.7.1
published 6 months ago
Rankings
alpine-edge: py3-fire-pyc
Precompiled Python bytecode for py3-fire
- Homepage: https://github.com/google/python-fire
- License: Apache-2.0
-
Latest release: 0.7.1-r0
published 6 months ago
Rankings
Maintainers (1)
alpine-edge: py3-fire
A library for automatically generating command line interfaces
- Homepage: https://github.com/google/python-fire
- License: Apache-2.0
-
Latest release: 0.7.1-r0
published 6 months ago
Rankings
Maintainers (1)
spack.io: py-fire
Python Fire is a library for automatically generating command line interfaces (CLIs) with a single line of code.
- Homepage: https://github.com/google/python-fire
- License: []
-
Latest release: 0.4.0
published almost 4 years ago
Rankings
Maintainers (1)
alpine-v3.21: py3-fire
A library for automatically generating command line interfaces
- Homepage: https://github.com/google/python-fire
- License: Apache-2.0
-
Latest release: 0.6.0-r0
published almost 2 years ago
Rankings
Maintainers (1)
alpine-v3.22: py3-fire
A library for automatically generating command line interfaces
- Homepage: https://github.com/google/python-fire
- License: Apache-2.0
-
Latest release: 0.6.0-r0
published almost 2 years ago
Rankings
Maintainers (1)
alpine-v3.20: py3-fire
A library for automatically generating command line interfaces
- Homepage: https://github.com/google/python-fire
- License: Apache-2.0
-
Latest release: 0.6.0-r0
published almost 2 years ago
Rankings
Maintainers (1)
alpine-v3.19: py3-fire
A library for automatically generating command line interfaces
- Homepage: https://github.com/google/python-fire
- License: Apache-2.0
-
Latest release: 0.5.0-r0
published over 2 years ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/setup-python v4 composite
- hypothesis <6.62.0
- mock <5.0.0
- pip <23.0
- pylint <2.15.10
- pytest <=7.2.1
- pytest-pylint <=1.1.2
- pytest-runner <6.0.0
- python-Levenshtein <0.20.9
- setuptools <65.7.0
- termcolor <2.2.0