magodo.tags module

Utilities related to tags (i.e. projects, epics, contexts, or metatags).

is_any_prefix_tag(word)[source]

Returns True if word is either an epic, context, or project tag.

Parameters

word (str) –

Return type

bool

is_any_tag(word)[source]

Returns True if word is a project, context, or metadata.

Parameters

word (str) –

Return type

bool

is_context_tag(word)[source]

Returns True if word is a context tag.

Parameters

word (str) –

Return type

bool

is_epic_tag(word)[source]

Returns True if word is an epic tag.

Parameters

word (str) –

Return type

bool

is_metadata_tag(word)[source]

Predicate that tells us if word is a metadata tag or not.

Examples

>>> is_metadata_tag("key:value")
True
>>> is_metadata_tag("key::value")
False
>>> is_metadata_tag("'key:value'")
False
>>> is_metadata_tag("key234me:value")
True
>>> is_metadata_tag("key_23_for_me:value")
True
>>> is_metadata_tag("key-23-for-me:value")
True
Parameters

word (str) –

Return type

bool

is_prefix_tag(ch, word)[source]

Predicate that tells us if a word is prefixed by ch.

Pre-Conditions:
  • ch is only a single character.

Parameters
  • ch (str) –

  • word (str) –

Return type

bool

is_project_tag(word)[source]

Returns True if word is a project tag.

Parameters

word (str) –

Return type

bool