API Reference

Main Module

Main module.

Copyright

2018-present Reece Dunham.

License

MIT, see LICENSE for more details.

area4.area4info()

Get some info about the package.

Returns

Package info.

Return type

str

area4.divider(number)

Get the divider you requested.

Parameters

number (int) – The divider number (can’t be 0).

Returns

The requested divider.

Return type

str

Raises

ValueError – If you request an invalid divider.

Example

area4.divider(3) will return ‘…………’

area4.make_div(unit, length=24, start='', end='', literal_unit=False)

Generate a custom divider.

Parameters
  • unit (str) – A repeating unit.

  • length (Optional[int]) – The maximum length (won’t be exceeded) (default: 24).

  • start (Optional[str]) – Starting string.

  • end (Optional[str]) – Ending string.

  • literal_unit (Optional[bool]) – If True, it will not try to break unit down into smaller repeating subunits. Defaults to False.

Returns

A new, custom divider.

Return type

str

Example

custom_div = make_div(unit='=-', length=40, start='<', end='=>')

Note

The generated string will be terminated at the specified length regardless of if all the input strings have been fully replicated. A unit > 1 length may not be able to be replicated to extend to the full length. In this situation, the string will be shorter than the specified length. Example: unit of 10 characters and a specified length of 25 will contain 2 units for a total length of 20 characters.

area4.splitter(div, *args)

Split text with dividers easily.

Returns

The newly made value.

Return type

str

Parameters

div (str) – The divider.

Utilities

Utilities module.

Copyright

2018-present Reece Dunham.

License

MIT, see LICENSE for more details.

area4.util.get_divider_character(divider_id)

Get the character the divider is made of.

Parameters

divider_id (int) – The divider’s number.

Returns

The character.

Return type

str

Raises

ValueError – If you request an invalid divider.

Example

Get what divider 7 is made of:

get_divider_character(7)
# returns '='.
area4.util.get_raw_file()

Get the raw divider file in a string array.

Returns

The array.

Return type

List[str]

area4.util.html_horizontal(closing_tag=True)

Get HTML horizontal divider.

Parameters

closing_tag (Optional[bool]) – If a closing tag should be added.

Returns

The HTML tag (the divider).

Return type

str

area4.util.markdown_horizontal()

Get Markdown horizontal divider.

Returns

The divider.

Return type

str

area4.util.non_single_character_dividers()

Get a list of all the dividers that are multiple unique characters.

Some examples of this include:

  • Divider 18 - ( ͡° ͜ʖ ͡°)

  • Divider 33 - ^,^,^,^,^,^,

  • Divider 34 - &*&*&*&*&*&*

Returns

A list of divider IDs.

Return type

List[int]

area4.util.reddit_horizontal()

Get Reddit horizontal divider.

Returns

The divider.

Return type

str

area4.util.reduce_to_unit(divider)

Reduce a repeating divider to the smallest repeating unit possible.

This function is used by make_div().

Parameters

divider (str) – The divider.

Returns

Smallest repeating unit possible.

Return type

str

Example

‘XxXxXxX’ -> ‘Xx’