[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2180":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":32,"discoverSource":33},2180,"python-fire","google\u002Fpython-fire","google","Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.","",null,"Python",28203,1483,358,131,0,2,9,23,7,80.31,"Other",false,"master",true,[27,28],"cli","python","2026-06-12 04:00:13","# Python Fire [![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Ffire.svg?style=plastic)](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fpython-fire)\n\n_Python Fire is a library for automatically generating command line interfaces\n(CLIs) from absolutely any Python object._\n\n-   Python Fire is a simple way to create a CLI in Python.\n    [[1]](docs\u002Fbenefits.md#simple-cli)\n-   Python Fire is a helpful tool for developing and debugging Python code.\n    [[2]](docs\u002Fbenefits.md#debugging)\n-   Python Fire helps with exploring existing code or turning other people's\n    code into a CLI. [[3]](docs\u002Fbenefits.md#exploring)\n-   Python Fire makes transitioning between Bash and Python easier.\n    [[4]](docs\u002Fbenefits.md#bash)\n-   Python Fire makes using a Python REPL easier by setting up the REPL with the\n    modules and variables you'll need already imported and created.\n    [[5]](docs\u002Fbenefits.md#repl)\n\n## Installation\n\nTo install Python Fire with pip, run: `pip install fire`\n\nTo install Python Fire with conda, run: `conda install fire -c conda-forge`\n\nTo install Python Fire from source, first clone the repository and then run:\n`python setup.py install`\n\n## Basic Usage\n\nYou can call `Fire` on any Python object:\u003Cbr>\nfunctions, classes, modules, objects, dictionaries, lists, tuples, etc.\nThey all work!\n\nHere's an example of calling Fire on a function.\n\n```python\nimport fire\n\ndef hello(name=\"World\"):\n  return \"Hello %s!\" % name\n\nif __name__ == '__main__':\n  fire.Fire(hello)\n```\n\nThen, from the command line, you can run:\n\n```bash\npython hello.py  # Hello World!\npython hello.py --name=David  # Hello David!\npython hello.py --help  # Shows usage information.\n```\n\nHere's an example of calling Fire on a class.\n\n```python\nimport fire\n\nclass Calculator(object):\n  \"\"\"A simple calculator class.\"\"\"\n\n  def double(self, number):\n    return 2 * number\n\nif __name__ == '__main__':\n  fire.Fire(Calculator)\n```\n\nThen, from the command line, you can run:\n\n```bash\npython calculator.py double 10  # 20\npython calculator.py double --number=15  # 30\n```\n\nTo learn how Fire behaves on functions, objects, dicts, lists, etc, and to learn\nabout Fire's other features, see the [Using a Fire CLI page](docs\u002Fusing-cli.md).\n\nFor additional examples, see [The Python Fire Guide](docs\u002Fguide.md).\n\n## Why is it called Fire?\n\nWhen you call `Fire`, it fires off (executes) your command.\n\n## Where can I learn more?\n\nPlease see [The Python Fire Guide](docs\u002Fguide.md).\n\n## Reference\n\n| Setup   | Command             | Notes\n| :------ | :------------------ | :---------\n| install | `pip install fire`  |\n\n| Creating a CLI | Command                | Notes\n| :--------------| :--------------------- | :---------\n| import         | `import fire`          |\n| Call           | `fire.Fire()`          | Turns the current module into a Fire CLI.\n| Call           | `fire.Fire(component)` | Turns `component` into a Fire CLI.\n\n| Using a CLI                                     | Command                                 | Notes\n| :---------------------------------------------- | :-------------------------------------- | :----\n| [Help](docs\u002Fusing-cli.md#help-flag)             | `command --help` or `command -- --help` |\n| [REPL](docs\u002Fusing-cli.md#interactive-flag)      | `command -- --interactive`              | Enters interactive mode.\n| [Separator](docs\u002Fusing-cli.md#separator-flag)   | `command -- --separator=X`              | Sets the separator to `X`. The default separator is `-`.\n| [Completion](docs\u002Fusing-cli.md#completion-flag) | `command -- --completion [shell]`       | Generates a completion script for the CLI.\n| [Trace](docs\u002Fusing-cli.md#trace-flag)           | `command -- --trace`                    | Gets a Fire trace for the command.\n| [Verbose](docs\u002Fusing-cli.md#verbose-flag)       | `command -- --verbose`                  |\n\n_Note that these flags are separated from the Fire command by an isolated `--`._\n\n## License\n\nLicensed under the\n[Apache 2.0](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fpython-fire\u002Fblob\u002Fmaster\u002FLICENSE) License.\n\n## Disclaimer\n\nThis is not an official Google product.\n","Python Fire 是一个用于自动生成命令行接口（CLI）的库，能够从任何 Python 对象创建 CLI。其核心功能包括自动为函数、类、模块等生成 CLI 接口，简化了 CLI 的开发过程，并且有助于代码调试和探索。技术特点上，Python Fire 支持多种类型的 Python 对象作为入口点，提供灵活的参数解析能力，并且可以轻松地将现有的 Python 代码转换为 CLI 工具。适用于需要快速构建 CLI 应用程序的场景，如脚本工具开发、API 测试、以及希望在 Bash 和 Python 之间平滑过渡的开发者。","2026-06-11 02:48:38","top_language"]