You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/benefits.md
+10-9
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,14 @@
1
1
# Benefits of Python Fire
2
2
3
-
## Python Fire is a simple way to create a CLI in Python. <aname="simple-cli"></a>
3
+
<aname="simple-cli"></a>
4
+
## Create CLIs in Python
4
5
5
6
It's dead simple. Simply write the functionality you want exposed at the command
6
7
line as a function / module / class, and then call Fire. With this addition of a
7
8
single-line call to Fire, your CLI is ready to go.
8
9
9
-
10
-
## Python Fire is a helpful tool for developing and debugging Python code. <aname="debugging"></a>
10
+
<aname="debugging"></a>
11
+
## Develop and debug Python code
11
12
12
13
When you're writing a Python library, you probably want to try it out as you go.
13
14
You could write a main method to check the functionality you're interested in,
@@ -23,8 +24,8 @@ a main method. And if you use the `--interactive` flag to enter an IPython REPL
23
24
then you don't need to load the imports or create your variables; they'll
24
25
already be ready for use as soon as you start the REPL.
25
26
26
-
27
-
## Python Fire helps with exploring existing code or turning other people's code into a CLI. <aname="exploring"></a>
27
+
<aname="exploring"></a>
28
+
## Explore existing code; turn other people's code into a CLI
28
29
29
30
You can take an existing module, maybe even one that you don't have access to
30
31
the source code for, and call `Fire` on it. This lets you easily see what
@@ -40,8 +41,8 @@ The auto-generated help strings that Fire provides when you run a Fire CLI
40
41
allow you to see all the functionality these modules provide in a concise
41
42
manner.
42
43
43
-
44
-
## Python Fire makes transitioning between Bash and Python easier. <aname="bash"></a>
44
+
<aname="bash"></a>
45
+
## Transition between Bash and Python
45
46
46
47
Using Fire lets you call Python directly from Bash. So you can mix your Python
47
48
functions with the unix tools you know and love, like `grep`, `xargs`, `wc`,
@@ -51,8 +52,8 @@ Additionally since writing CLIs in Python requires only a single call to Fire,
51
52
it is now easy to write even one-off scripts that would previously have been in
52
53
Bash, in Python.
53
54
54
-
55
-
## 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. <aname="repl"></a>
55
+
<aname="repl"></a>
56
+
## Explore code in a Python REPL
56
57
57
58
When you use the `--interactive` flag to enter an IPython REPL, it starts with
58
59
variables and modules already defined for you. You don't need to waste time
0 commit comments