Getting Started
Minimal Survival Command
% pip install fired-up
An example
With Fired Up
it is possible to run a command like this:
% python examples/hello.py generate a_reversed_list 1,a,2,b then dump as_json
[
"b",
2,
"a",
1
]
The code to achieve this would be something like this:
import json
from fired_up import FiredUp, Group
class Generator(Group):
def a_reversed_list(self, lst):
return list(reversed(lst))
class Dumper(Group):
def as_json(self):
return json.dumps(self.paste(), indent=2)
FiredUp(generate=Generator, dump=Dumper)
Fired Up
provides the following support for creating a even “nicer” natural-ish command language:
a
Group
base class allows for simply creating a functional class, that has access to aclipboard
using thecopy
andpaste
methods. You will hardly ever require thecopy
method, since the returned values of your methods are automaticallycopy
’d onto the default clipboard.a
FiredUp
top-level class to bring together theGroups
and fire them upa
then
method onGroups
allows to exit the currentGroup
scope and return to the top-levelFiredUp
class to access a differentGroup