Welcome to Area4’s documentation!
Concept
Warning
If you don’t understand what we mean by dividers, fear not.
We mean dividers that divide text or sections of text in a console, or use cases like that.
For example:
Hello World!
---------------------
Welcome to my library.
In this example, the line between the two sections would be the divider.
The great part about area4 is that it is built to be flexible.
We have all kinds of dividers, from simple text strings similar to the one from the example, to long emoji strings, to dividers in Markdown for programs such as GitHub bots!
Make sure to view our other documentation pages for more information!
Tip: Because area4 has a lot of emoji dividers, it can also double as an emoji database!
Installing
You may install in one of the following ways:
With Pip
To install via pip, open a terminal, and type one the following command:
# Windows:
$ pip install --upgrade area4
# macOS/Linux:
$ python3 -m pip install --upgrade area4
It should install. If the install fails because of a permissions error, try running the command with sudo or with the –user flag.
With a requirements.txt
To use area4 as a dependency for your project, you can add the following line:
area4
Note
You must know how to use a requirements file to take this path. If you don’t, search how to use a requirements file for Python dependencies.
With Pipenv
To install with pipenv, run:
pipenv install area4
Using
After you install the package (see the installing section), you need to import it into any Python file that you will use it in.
You can do this by adding the following line to the top:
import area4
Warning
Versions before 2.0 don’t work with the new methods. 1.x has reached its end-of-life, and you should migrate. See the migrating guide for how to do so.
If you want to, you can check to make sure the library is working by running:
print(area4.area4info())
Now, to get dividers, use this function:
print(
area4.divider(4)
) # This prints divider number 4 to the console
For what all the dividers look like, see the next section.
Divider Looks
The number before it is the number you pass to the divider function.
So if you want divider 1 you would use:
area4.divider(1)
.
If you don’t understand, see the examples part of the documentation.
Dashes
Underscores
Periods
Black squares
Up arrow emojis
Down arrow emojis
Equal signs
Hashtags
Asterisks (stars)
Commas
Slashes
Broken bars (|)
Tildes
Backslashes (not to be confused with #11)
Coffee cups
Plus signs
Cthulhus
Lenny faces
And (&) signs
Up arrow dividers (^)
Shrug emojis
Number 1s
Number 2s
Number 3s
Number 4s
Number 5s
Number 6s
Number 7s
Number 8s
Number 9s
Number 10s
<>s
Smiley faces I think
&*s
Random numbers (returned as string which is automatically converted from an integer)
The symbol that looks like ‘
Lowercase a
Uppercase a
Lowercase b
Uppercase b
Lowercase c
Uppercase c
Lowercase d
Uppercase d
Lowercase e
Uppercase e
Lowercase f
Uppercase f
Lowercase g
Uppercase g
Lowercase h
Uppercase h
Lowercase i
Uppercase i
Lowercase j
Uppercase j
Lowercase k
Uppercase k
Lowercase l
Uppercase l
Lowercase m
Uppercase m
Lowercase n
Uppercase n
Lowercase o
Uppercase o
Lowercase p
Uppercase p
Lowercase q
Uppercase q
Lowercase r
Uppercase r
Lowercase s
Uppercase s
Lowercase t
Uppercase t
Lowercase u
Uppercase u
Lowercase v
Uppercase v
Lowercase w
Uppercase w
Lowercase x
Uppercase x
Lowercase y
Uppercase y
Lowercase z
Uppercase z
Beach umbrella emojis
Airplane emojis
Orange leave emojis
Key emojis
Big smiles
Laughing face
Toung-sticking-out faces
Toung-sticking-out faces v2
Surprised faces
Upset face
Pretend-smile face
Scared face
Surprised face
Happy babies
Happy ladies
Happy men
Happy ladies
Happy men
Happy grannies
Happy grandpas
Thumbs up
Thumbs down
Punch
Fist
Punch left
Punch right
Crossed fingers
Crossed fingers v2
Unknown emoji
Ok-hand
Point left
Point right
Point up
Point down
Finger up
Hand
Hand v2
5 fingers on hand
Vulcan solute emojis
Bye wave
Call me wave
Strong arm emoji
Dog emojis
Cat emojis
Mice emojis
Hamster emojis
Bunny emojis
Fox emojis
Bear emojis
Panda emojis
Koalas
Tigers
Lions
Cows
Pigs
Frog
Monkeys
Monkey eyes shielded
Monkey eyes open
Monkey hands over mouth
Sitting monkey
Penguins
Chickens
Parrots
Birds
Hatching ducks
Ducks
Geese
Flower bundles
Pink flowers
Roses
Dead flowers
Pink flowers 2
Pink flowers 3
White flowers
Yellow flowers
Small suns
Big suns
Half moons facing left
Half moons facing right
Full moons
Stars
Multiple stars
Lightning bolts
Water bolts
Fires
Thunder clouds
Rainbows
Partly eaten chickens
Not-really-eaten chickens
Hot dogs
Hamburgers
French fries
Pizza
Sandwiches
Sno-cones
Ice creams in cups
Ice creams in cones
Pies
Cakes
Cakes (other variant)
Beers
Two touching beers
Two touching wine glasses
Single wine glasses
Soccer balls
Medals
Cars
Alarm clocks
Money bags
Balloons
Hearts
Pins
People
Dice
Bowling ball and pins
Cookies
Snowmen
Potatoes
Shrimp
Hot people
Cold people
Robot emojis
Person having party
Mind blown emojis
Be quiet emojis
Semicolons
Eye emojis
Ghost emojis
At signs
Telephone emojis
Colons
Curly brackets
[-] emojis
=_=+ emojis
Thinking emojis
*-
dividersFlower emojis
Persian/Arabic words stretching character
Percent symbols
Hearts (alternative to #200)
Negation (¬)
Apple logo emoji (macOS only)
Mountain ASCII characters
Upside-down mountain ASCII characters
Tomato emojis
Left brackets
Chili peppers
⊷ (Image Of symbols - see https://www.compart.com/en/unicode/U+22B7)
Akitas (dogs)
Dollar signs
Red dots
Chain links
Scooter emojis
Avacado emojis
1337 dividers
Smiling cats
Smiling cats 2
Laughing cats
Heart-eyed cats
Mischievous cats
Kissing cats
Surprised cats
Sad cats
Mad cats
Top hats
Party poppers
Sponges
Satelite antennas
Links
Papers with pencils
Crossed hammers and wrenches
Download item icons
Yarn balls
Flags
Flags alternative
Flags alternative 2
Cars alternative
Cars alternative 2
Question marks
Lolly pops
Cherries
Keyboards
Chess pawns
Trophies
Pencils
Safety pins
Tags
Jester cards
Bells
Crossed out bells
Gears
Right brackets
Lowercase ø
Uppercase Ø
Telescopes
Greater than sign
Flashing light
Police officer
Check mark
Check mark button
Cross mark button
Card Index
Baseballs
Softballs
Basketballs
Volleyballs
American footballs
Rugby footballs
Tennis rackets
Flying discs
Copyright symbols
Joysticks
With more coming soon!
Thanks to amrutha3 on GitHub for making the majority of the emoji dividers, and everybody who has added a divider.
Warning
Depending on what platform the user is on, some dividers may look different. This includes some CI systems, in which emojis are not rendered in build logs.
Custom Dividers
You can generate a custom divider with the make_div function
# Specify a repeating unit and a maximum length
area4.make_div('<>', length=24)
# Returns a string
# Add start or end elements
area4.make_div('=-', length=9, start='<', end='=>')
# Returns: '<=-=-=-=>'
# Resize existing dividers
area4.make_div(area4.divider(1), length=6)
# Returns: '------'
# Setting to custom div:
custom_div = area4.make_div('<>', length=24)
# or directly printing
print(area4.make_div('<>', length=24))
# specify an literal unit (the function will not attempt to find smaller repeating units)
area4.make_div('<><>~', length=10, literal_unit=True)
# Returns '<><>~<><>~' instead of '<><><><><>'
Warning
The make_div()
function will try to replicate whole repeating units to the specified length.
The output will always be less than or equal to the specified length.
Test the output to ensure the divider looks as you would like it.
BIG thank you to ninexball on GitHub for making this function and maintaining it!
Other Functions
This is a list of other functions you may want to use, and what the do in basic terms.
See the API Refrence page for more information.
Splitter
New in version 2.1.0.
The splitter function takes a string or number as a divider, and a series of strings to return, divided. If the first parameter is a number, it looks it up in the divider list. Otherwise, it uses the string provided as a divider. If only one additional string is provided, nothing is returned.
For example:
import area4
print(area4.splitter(1, "Welcome to", "My **app**"))
# outputs:
# Welcome to
# ------------
# My **app**
Get Divider Character
area4.utils.get_divider_character()
New in version 2.1.7.
Gets you the material, or character the divider is made of. You need to pass an integer of the divider you want to get the character it is made of.
For example:
from area4.util import get_divider_character
print(get_divider_character(7))
# This example prints a single equal sign to the console,
# because that divider is '============'
Reddit Horizontal
area4.utils.reddit_horizontal()
New in version 2.3.1.
This function returns the Reddit Markdown divider (for Reddit bots). This function takes no parameters.
Markdown Horizontal
area4.utils.markdown_horizontal()
New in version 2.9.0.
This function returns the Markdown divider (rendered as an HTML ‘hr’ tag by sites like GitHub). This function takes no parameters.
Note
If you want the HTML tag equivalent of the rendered output, see HTML Horizontal.
HTML Horizontal
area4.utils.html_horizontal()
New in version 3.1.0.
This function returns the HTML tag(s) for the divider
element (rendered as a literal line by default, unless changed
via CSS).
This function takes 1 optional parameter, closing_tag
,
more information is detailed in the API Reference section.
API Reference
Main Module
Main module.
- Copyright
2018-present Reece Dunham.
- License
MIT, see LICENSE for more details.
- area4.divider(number)
Get the divider you requested.
- Parameters
number (int) – The divider number (can’t be 0).
- Returns
The requested divider.
- Return type
- 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 toFalse
.
- Returns
A new, custom divider.
- Return type
- 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.
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
- 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.
- area4.util.markdown_horizontal()
Get Markdown horizontal divider.
- Returns
The divider.
- Return type
Migrating
Here are steps required to migrate to certain versions:
1.x -> 2.x
To migrate from v1, you will need to change all divider calls from:
area4.dividerX
# or
area4.divX()
Where X
is the divider number, to:
area4.divider(X)
2.x -> 3.x
This version removed the duplicate divider (was #201), so all the dividers with numbers/IDs BIGGER than 201 need to be shifted down by 1, so if you are using any of those dividers, you will need to change the number. For example:
area4.divider(208)
# needs to be changed to:
area4.divider(207)
# however, anything BELOW 201 does NOT need to be changed!
By Reece Dunham 1
Welcome to area4, the flexible divider library.
From here, you may want to proceed to the Concept page.
Want to skip right to the action? Select the Installing page.