# TextAlign
### Last version: 1.0.5
### Short description:
This module allows you to align text relative to the center, right, left and both sides
### It contains:
1. ```right(text, width)``` - this function align the "text" to right side with given "width"
2. ```left(text, width)``` - this function align the "text" to left side with given "width"
3. ```center(text, width)``` - this function align the "text" to center with given "width"
4. ```justify(text, width)``` - this function align the "text" to both sides with given "width"
### How to use:
```python
from text_align import justify
my_long_text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis dolor mauris, at elementum ligula tempor eget. In quis rhoncus nunc, at aliquet orci. Fusce at dolor sit amet felis suscipit tristique. Nam a imperdiet tellus. Nulla eu vestibulum urna. Vivamus tincidunt suscipit enim, nec ultrices nisi volutpat ac. Maecenas sit amet lacinia arcu, non dictum justo. Donec sed quam vel risus faucibus euismod. Suspendisse rhoncus rhoncus felis at fermentum. Donec lorem magna, ultricies a nunc sit amet, blandit fringilla nunc. In vestibulum velit ac felis rhoncus pellentesque. Mauris at tellus enim. Aliquam eleifend tempus dapibus. Pellentesque commodo, nisi sit amet hendrerit fringilla, ante odio porta lacus, ut elementum justo nulla et dolor."
aligned_text = justify(my_long_text, 55)
print(aligned_text)
'''
Output:
Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Vestibulum sagittis dolor mauris, at elementum
ligula tempor eget. In quis rhoncus nunc, at aliquet
orci. Fusce at dolor sit amet felis suscipit tristique.
Nam a imperdiet tellus. Nulla eu vestibulum urna.
Vivamus tincidunt suscipit enim, nec ultrices nisi
volutpat ac. Maecenas sit amet lacinia arcu, non dictum
justo. Donec sed quam vel risus faucibus euismod.
Suspendisse rhoncus rhoncus felis at fermentum. Donec
lorem magna, ultricies a nunc sit amet, blandit
fringilla nunc. In vestibulum velit ac felis rhoncus
pellentesque. Mauris at tellus enim. Aliquam eleifend
tempus dapibus. Pellentesque commodo, nisi sit amet
hendrerit fringilla, ante odio porta lacus, ut
elementum justo nulla et dolor.
'''
```
### Installation:
```shell
pip install text-align==1.0.5
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ej-you/TextAlign",
"name": "text-align",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "text_align python",
"author": "Ejyou",
"author_email": "ejyou.user@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/13/e3/bed8d5e35d3a3cc356225d98c8b732b9c8afdfc4b2d56d19ebfcd98c949f/text_align-1.0.5.tar.gz",
"platform": null,
"description": "# TextAlign\n\n### Last version: 1.0.5\n\n### Short description:\n\nThis module allows you to align text relative to the center, right, left and both sides\n\n### It contains:\n\n1. ```right(text, width)``` - this function align the \"text\" to right side with given \"width\"\n2. ```left(text, width)``` - this function align the \"text\" to left side with given \"width\"\n3. ```center(text, width)``` - this function align the \"text\" to center with given \"width\"\n4. ```justify(text, width)``` - this function align the \"text\" to both sides with given \"width\"\n\n### How to use:\n\n```python\nfrom text_align import justify\n\n\nmy_long_text = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis dolor mauris, at elementum ligula tempor eget. In quis rhoncus nunc, at aliquet orci. Fusce at dolor sit amet felis suscipit tristique. Nam a imperdiet tellus. Nulla eu vestibulum urna. Vivamus tincidunt suscipit enim, nec ultrices nisi volutpat ac. Maecenas sit amet lacinia arcu, non dictum justo. Donec sed quam vel risus faucibus euismod. Suspendisse rhoncus rhoncus felis at fermentum. Donec lorem magna, ultricies a nunc sit amet, blandit fringilla nunc. In vestibulum velit ac felis rhoncus pellentesque. Mauris at tellus enim. Aliquam eleifend tempus dapibus. Pellentesque commodo, nisi sit amet hendrerit fringilla, ante odio porta lacus, ut elementum justo nulla et dolor.\"\naligned_text = justify(my_long_text, 55)\nprint(aligned_text)\n'''\nOutput:\n\nLorem ipsum dolor sit amet, consectetur adipiscing\nelit. Vestibulum sagittis dolor mauris, at elementum\nligula tempor eget. In quis rhoncus nunc, at aliquet\norci. Fusce at dolor sit amet felis suscipit tristique.\nNam a imperdiet tellus. Nulla eu vestibulum urna.\nVivamus tincidunt suscipit enim, nec ultrices nisi\nvolutpat ac. Maecenas sit amet lacinia arcu, non dictum\njusto. Donec sed quam vel risus faucibus euismod.\nSuspendisse rhoncus rhoncus felis at fermentum. Donec\nlorem magna, ultricies a nunc sit amet, blandit\nfringilla nunc. In vestibulum velit ac felis rhoncus\npellentesque. Mauris at tellus enim. Aliquam eleifend\ntempus dapibus. Pellentesque commodo, nisi sit amet\nhendrerit fringilla, ante odio porta lacus, ut\nelementum justo nulla et dolor.\n'''\n```\n\n### Installation:\n\n```shell\npip install text-align==1.0.5\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "This module allows you to align text relative to the center, right, left and both sides",
"version": "1.0.5",
"project_urls": {
"Homepage": "https://github.com/ej-you/TextAlign"
},
"split_keywords": [
"text_align",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f8af67bb1bb764cf48f8b4015a29505710417ee40c9a48b5f40f2cb030f41104",
"md5": "6995cc7b2c5c79925ae9b6d5bb59b0d6",
"sha256": "4bdf30e2f9c8b8d1d8cf8003e30a4585faf2a1767cfa46f68913573b14e61d36"
},
"downloads": -1,
"filename": "text_align-1.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6995cc7b2c5c79925ae9b6d5bb59b0d6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 4852,
"upload_time": "2024-11-04T19:43:44",
"upload_time_iso_8601": "2024-11-04T19:43:44.787081Z",
"url": "https://files.pythonhosted.org/packages/f8/af/67bb1bb764cf48f8b4015a29505710417ee40c9a48b5f40f2cb030f41104/text_align-1.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "13e3bed8d5e35d3a3cc356225d98c8b732b9c8afdfc4b2d56d19ebfcd98c949f",
"md5": "c3bf169f6f9c98de05b8286e82caf5ca",
"sha256": "7d329ba53a2f5772acd67e98d55e9285128a7cc829bfb8ac010485728a80bf04"
},
"downloads": -1,
"filename": "text_align-1.0.5.tar.gz",
"has_sig": false,
"md5_digest": "c3bf169f6f9c98de05b8286e82caf5ca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 4203,
"upload_time": "2024-11-04T19:46:02",
"upload_time_iso_8601": "2024-11-04T19:46:02.991622Z",
"url": "https://files.pythonhosted.org/packages/13/e3/bed8d5e35d3a3cc356225d98c8b732b9c8afdfc4b2d56d19ebfcd98c949f/text_align-1.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-04 19:46:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ej-you",
"github_project": "TextAlign",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "text-align"
}