fire

Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.

https://github.com/google/python-fire

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

cli python

Keywords from Contributors

distributed tensors alignment flexible deep-neural-networks jax closember autograd autopep8 interactive
Last synced: 6 months ago · JSON representation

Repository

Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.

Basic Info
  • Host: GitHub
  • Owner: google
  • License: other
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 6.02 MB
Statistics
  • Stars: 27,861
  • Watchers: 365
  • Forks: 1,452
  • Open Issues: 152
  • Releases: 11
Topics
cli python
Created almost 9 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing License

README.md

Python Fire PyPI

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

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

All Time
  • Total Commits: 355
  • Total Committers: 68
  • Avg Commits per committer: 5.221
  • Development Distribution Score (DDS): 0.425
Past Year
  • Commits: 49
  • Committers: 4
  • Avg Commits per committer: 12.25
  • Development Distribution Score (DDS): 0.469
Top Committers
Name Email 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...

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
enhancement (15) bug (10) help wanted (7) question (5) documentation (1)
Pull Request Labels
dependabot (56) cla: yes (14) cla: no (5) bug (1) enhancement (1) documentation (1)

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.

  • Versions: 13
  • Dependent Packages: 761
  • Dependent Repositories: 8,567
  • Downloads: 11,661,349 Last month
  • Docker Downloads: 45,104,340
Rankings
Dependent packages count: 0.0%
Stargazers count: 0.1%
Dependent repos count: 0.1%
Downloads: 0.1%
Average: 0.3%
Docker downloads count: 0.5%
Forks count: 1.1%
Maintainers (1)
Last synced: 6 months ago
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.

  • Versions: 7
  • Dependent Packages: 27
  • Dependent Repositories: 46
Rankings
Stargazers count: 1.4%
Dependent packages count: 2.5%
Average: 3.3%
Forks count: 4.0%
Dependent repos count: 5.3%
Last synced: 6 months ago
proxy.golang.org: github.com/google/python-fire
  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Stargazers count: 0.1%
Forks count: 0.7%
Average: 3.5%
Dependent repos count: 4.8%
Dependent packages count: 8.4%
Last synced: 6 months ago
alpine-edge: py3-fire-pyc

Precompiled Python bytecode for py3-fire

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 0.5%
Forks count: 1.1%
Average: 3.7%
Dependent packages count: 13.3%
Maintainers (1)
Last synced: 6 months ago
alpine-edge: py3-fire

A library for automatically generating command line interfaces

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 0.7%
Forks count: 1.3%
Average: 4.0%
Dependent packages count: 13.9%
Maintainers (1)
Last synced: 6 months ago
spack.io: py-fire

Python Fire is a library for automatically generating command line interfaces (CLIs) with a single line of code.

  • Versions: 4
  • Dependent Packages: 5
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 0.3%
Forks count: 2.3%
Average: 4.2%
Dependent packages count: 14.2%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.21: py3-fire

A library for automatically generating command line interfaces

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.22: py3-fire

A library for automatically generating command line interfaces

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.20: py3-fire

A library for automatically generating command line interfaces

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.19: py3-fire

A library for automatically generating command line interfaces

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/build.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/scripts/requirements.txt pypi
  • 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
requirements.txt pypi
setup.py pypi