fabricius package#

Subpackages#

Submodules#

fabricius.const module#

fabricius.const.Data#

Represent the data passed to a generator/file, under a form of dictionary.

alias of Dict[str, Any]

fabricius.const.FILE_STATE#

Define the state of a file.

The file’s state can be one of:

  • pending

  • persisted

  • deleted

alias of Literal[‘pending’, ‘persisted’, ‘deleted’]

fabricius.const.PathStrOrPath#

Represent a path as a str or a pathlib.Path object. Typically what’s used to treat path in Fabricius.

alias of Union[str, PathLike[str], Path]

fabricius.utils module#

Utilities shipped with Fabricius.

fabricius.utils.camel_case(text: str) str#

Return the text formatted in camel case

Parameters:

text (str) – The text you want to format.

Returns:

The formatted text.

Return type:

str

Example

>>> my_text = "Some text"
>>> camel_case(my_text)
'someText'
fabricius.utils.snake_case(text: str) str#

Return the text formatted in snake case

Parameters:

text (str) – The text you want to format.

Returns:

The formatted text.

Return type:

str

Example

>>> my_text = "Some text"
>>> snake_case(my_text)
'some_text'
fabricius.utils.dash_case(text: str) str#

Return the text formatted in dash case

Parameters:

text (str) – The text you want to format.

Returns:

The formatted text.

Return type:

str

Example

>>> my_text = "Some text"
>>> dash_case(my_text)
'some-text'
fabricius.utils.pascal_case(text: str) str#

Return the text formatted in pascal case

Parameters:

text (str) – The text you want to format.

Returns:

The formatted text.

Return type:

str

Example

>>> my_text = "Some text"
>>> pascal_case(my_text)
'SomeText'
fabricius.utils.capital_case(text: str) str#

Return the text formatted in capital case

Parameters:

text (str) – The text you want to format.

Returns:

The formatted text.

Return type:

str

Example

>>> my_text = "Some text"
>>> capital_case(my_text)
'Some Text'
fabricius.utils.sentence_case(text: str) str#

Return the text formatted in sentence case

Parameters:

text (str) – The text you want to format.

Returns:

The formatted text.

Return type:

str

Example

>>> my_text = "Some text"
>>> sentence_case(my_text)
'Some text'

Module contents#