🔖 Tags¶
You can define custom groupings of pipes with tags. Consider the example below:
Although both pipes have different connectors and metrics, they share the tag baz
, so they can be selected together with --tags baz
.
Selecting Pipes with Tags¶
The --tags
syntax is simple yet powerful:
- Spaces are joined by
OR
. - Commas are joined by
AND
. - Underscores negate tags, overriding
OR
andAND
.
You can read groups of tag pairs with commas. For example, the following will select pipes tagged as both red
and cat
or as blue
and dog
:
1 |
|
Prefixing any tag with an underscore will negate it from the entire selection. The following selects all pipes tagged as pet
except those tagged as bird
:
1 |
|
Examining Tags¶
Like show pipes
, the action show tags
accepts the standard filter flags (-c
, -m
, -l
, -t
) and displays pipes grouped together by common tags (with repeats as necessary).
Use positional arguments (instead of --tags
) to limit the output of show tags
to specific tags.
In the above example, we have four pipes:
- Greenville weather (
gvl
) - Clemson weather (
clemson
) - Atlanta weather (
atl
) - Athens colors (
athens
)
Three tags are shared amongst these pipes:
ga
(Georgia)sc
(South Carolina)production
From the screenshot, we can quickly tell that:
atl
andathens
are tagged withga
.clemson
andgvl
are tagged withsc
.atl
,clemson
, andgvl
are tagged asproduction
.
Even though we only specified the tags sc
and ga
, the mutual tag production
was included in the output. This can be omitted by specifying the tags as positional arguments:
1 |
|
Writing Tags¶
The quickest way to write tags is with the tag pipes
action:
1 |
|
Note that new tags must be specified as positional arguments ― the flag --tags
is used for filtering.
Removing Tags¶
You may also remove tags with the action tag pipes
by prefixing tags with an underscore. In this example, we are removing the tag production
from all pipes currently tagged as production
.
1 |
|
Tags in Python¶
You can define tags in the Pipe constructor:
1 2 3 4 5 6 |
|
Tags Live in Parameters¶
To edit your tags interactively, just define a list under the tags
key with edit pipes
:
1 |
|
1 2 3 4 5 6 |
|
Finally, you can also add tags to an existing pipe by setting .tags
:
1 2 3 4 |
|